Skip to content

Commit

Permalink
add cmd line to ocaml emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
ved-rivos committed Jan 28, 2024
1 parent 8a02c9e commit 289fdc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ocaml_emulator/platform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ let config_mtval_has_illegal_inst_bits = ref false
let config_enable_pmp = ref false
let config_enable_writable_fiom = ref true
let config_enable_vext = ref true
let config_enable_svnapot = ref false
let config_enable_svpbmt = ref false

let platform_arch = ref P.RV64

Expand Down Expand Up @@ -87,6 +89,8 @@ let mtval_has_illegal_inst_bits () = !config_mtval_has_illegal_inst_bits
let enable_pmp () = !config_enable_pmp
let enable_zfinx () = false
let enable_writable_fiom () = !config_enable_writable_fiom
let enable_svnapot () = !config_enable_svnapot
let enable_svpbmt () = !config_enable_svpbmt

let rom_base () = arch_bits_of_int64 P.rom_base
let rom_size () = arch_bits_of_int !rom_size_ref
Expand Down
8 changes: 7 additions & 1 deletion ocaml_emulator/riscv_ocaml_sim.ml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ let options = Arg.align ([("-dump-dts",
" requested isa");
("-with-dtc",
Arg.String PI.set_dtc,
" full path to dtc to use")
" full path to dtc to use");
("-enable-svnapot",
Arg.Set P.config_enable_svnapot,
" enable svnapot extension");
("-enable-svpbmt",
Arg.Set P.config_enable_svpbmt,
" enable svpbmt extension")
])

let usage_msg = "RISC-V platform options:"
Expand Down

0 comments on commit 289fdc7

Please sign in to comment.