aboutsummaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-07-09 15:49:06 -0700
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-07-09 15:49:06 -0700
commit85b7df234470a2225336976002977d287d31be77 (patch)
treebc2fc0847722de390056d1a4df185799fd90ac54 /model
parent638789c3d2cf056a5b1e1f29124e2f6cbc8f1081 (diff)
parent6541c02412d6c8744f4c3a137ec302ea40d8117d (diff)
downloadsail-riscv-85b7df234470a2225336976002977d287d31be77.zip
sail-riscv-85b7df234470a2225336976002977d287d31be77.tar.gz
sail-riscv-85b7df234470a2225336976002977d287d31be77.tar.bz2
Merge branch 'master-cleanup' of github.com:rems-project/sail-riscv into master-cleanup
Diffstat (limited to 'model')
-rw-r--r--model/riscv_ext_regs.sail8
-rw-r--r--model/riscv_step_rvfi.sail1
2 files changed, 9 insertions, 0 deletions
diff --git a/model/riscv_ext_regs.sail b/model/riscv_ext_regs.sail
index 55600af..9ff83b3 100644
--- a/model/riscv_ext_regs.sail
+++ b/model/riscv_ext_regs.sail
@@ -4,3 +4,11 @@
val ext_init_regs : unit -> unit effect {wreg}
function ext_init_regs () = ()
+
+/*!
+This function is called after above when running rvfi and allows the model
+to be initialised differently (e.g. CHERI cap regs are initialised
+to omnipotent instead of null).
+ */
+val ext_rvfi_init : unit -> unit effect {wreg}
+function ext_rvfi_init () = ()
diff --git a/model/riscv_step_rvfi.sail b/model/riscv_step_rvfi.sail
index f594c00..0efcdce 100644
--- a/model/riscv_step_rvfi.sail
+++ b/model/riscv_step_rvfi.sail
@@ -19,5 +19,6 @@ function ext_init() = {
rvfi_zero_exec_packet();
rvfi_halt_exec_packet();
let _ = rvfi_get_exec_packet();
+ ext_rvfi_init();
()
}