From ec7d9a39e8d1fb70a7f3ca83980d9e906ca49472 Mon Sep 17 00:00:00 2001 From: Prashanth Mundkur Date: Fri, 29 Mar 2019 10:49:09 -0700 Subject: Generalize the previous commit to handle hardwired misa.c. --- model/riscv_sys_control.sail | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'model/riscv_sys_control.sail') 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()); -- cgit v1.1