summaryrefslogtreecommitdiff
path: root/src/sail.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-12-13 16:20:48 +0000
committerAlasdair Armstrong2018-12-13 16:20:48 +0000
commitb167a59affdb6428fa0656a092b335a3a6899d56 (patch)
treef8b5a9d7a11bd1753d2861653841448db8f7cb07 /src/sail.ml
parentf19023bedee7b32a39b23907b0a1cd732a1e3bc9 (diff)
Add hooks to call cgen stub file for RISC-V
Diffstat (limited to 'src/sail.ml')
-rw-r--r--src/sail.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sail.ml b/src/sail.ml
index 73173946..0d26df9c 100644
--- a/src/sail.ml
+++ b/src/sail.ml
@@ -64,6 +64,7 @@ let opt_print_ocaml = ref false
let opt_print_c = ref false
let opt_print_latex = ref false
let opt_print_coq = ref false
+let opt_print_cgen = ref false
let opt_memo_z3 = ref false
let opt_sanity = ref false
let opt_includes_c = ref ([]:string list)
@@ -143,6 +144,9 @@ let options = Arg.align ([
( "-trace",
Arg.Tuple [Arg.Set C_backend.opt_trace; Arg.Set Ocaml_backend.opt_trace_ocaml],
" Instrument ouput with tracing");
+ ( "-cgen",
+ Arg.Set opt_print_cgen,
+ " Generate CGEN source");
( "-lem",
Arg.Set opt_print_lem,
" output a Lem translated version of the input");
@@ -352,6 +356,9 @@ let main() =
Util.opt_warnings := true;
C_backend.compile_ast (C_backend.initial_ctx type_envs) (!opt_includes_c) ast_c
else ());
+ (if !(opt_print_cgen)
+ then Cgen_backend.output type_envs ast
+ else ());
(if !(opt_print_lem)
then
let mwords = !Pretty_print_lem.opt_mwords in