aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_sys_control.sail
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-03-29 10:49:09 -0700
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-03-29 10:49:09 -0700
commitec7d9a39e8d1fb70a7f3ca83980d9e906ca49472 (patch)
tree7e0cf12092247f3f3b8f1a40eef86553c22c5778 /model/riscv_sys_control.sail
parentfe2b7a1cabe6c3dbc9d6573217173d2b428d81eb (diff)
downloadsail-riscv-ec7d9a39e8d1fb70a7f3ca83980d9e906ca49472.zip
sail-riscv-ec7d9a39e8d1fb70a7f3ca83980d9e906ca49472.tar.gz
sail-riscv-ec7d9a39e8d1fb70a7f3ca83980d9e906ca49472.tar.bz2
Generalize the previous commit to handle hardwired misa.c.
Diffstat (limited to 'model/riscv_sys_control.sail')
-rw-r--r--model/riscv_sys_control.sail13
1 files changed, 7 insertions, 6 deletions
diff --git a/model/riscv_sys_control.sail b/model/riscv_sys_control.sail
index f0c058d..48a3d90 100644
--- a/model/riscv_sys_control.sail
+++ b/model/riscv_sys_control.sail
@@ -417,18 +417,19 @@ function handle_interrupt(i : InterruptType, del_priv : Privilege) -> unit =
/* state state initialization */
+val sys_enable_rvc = {c: "sys_enable_rvc", ocaml: "Platform.enable_rvc", _: "sys_enable_rvc"} : unit -> bool
function init_sys() -> unit = {
cur_privilege = Machine;
mhartid = EXTZ(0b0);
misa->MXL() = arch_to_bits(if sizeof(xlen) == 32 then RV32 else RV64);
- misa->A() = true; /* atomics */
- misa->C() = true; /* RVC */
- misa->I() = true; /* base integer ISA */
- misa->M() = true; /* integer multiply/divide */
- misa->U() = true; /* user-mode */
- misa->S() = true; /* supervisor-mode */
+ misa->A() = true; /* atomics */
+ misa->C() = sys_enable_rvc (); /* RVC */
+ misa->I() = true; /* base integer ISA */
+ misa->M() = true; /* integer multiply/divide */
+ misa->U() = true; /* user-mode */
+ misa->S() = true; /* supervisor-mode */
mstatus = set_mstatus_SXL(mstatus, misa.MXL());
mstatus = set_mstatus_UXL(mstatus, misa.MXL());