summaryrefslogtreecommitdiff
path: root/riscv
diff options
context:
space:
mode:
Diffstat (limited to 'riscv')
-rw-r--r--riscv/main.sail1
-rw-r--r--riscv/riscv_sys.sail5
2 files changed, 6 insertions, 0 deletions
diff --git a/riscv/main.sail b/riscv/main.sail
index 4209b7d1..0cc34061 100644
--- a/riscv/main.sail
+++ b/riscv/main.sail
@@ -56,6 +56,7 @@ function dump_state () : unit -> unit = {
function main () = {
PC = __GetSlice_int(64, elf_entry(), 0);
try {
+ init_sys ();
fetch_and_execute()
} catch {
Error_not_implemented(s) => print_string("Error: Not implemented: ", s),
diff --git a/riscv/riscv_sys.sail b/riscv/riscv_sys.sail
index ccbe58fb..2956caae 100644
--- a/riscv/riscv_sys.sail
+++ b/riscv/riscv_sys.sail
@@ -346,3 +346,8 @@ function handle_exception_ctl(cur_priv : privilege, ctl : ctl_result,
mepc
}
}
+
+function init_sys () : unit -> unit = {
+ cur_privilege = MACHINE;
+ misa->C() = true;
+}