summaryrefslogtreecommitdiff
path: root/riscv/riscv_sys.sail
diff options
context:
space:
mode:
authorBrian Campbell2018-11-29 13:44:58 +0000
committerBrian Campbell2018-11-29 13:44:58 +0000
commit28b05bee5f0b2b81dc1bff72b5de9cc142a2b4b9 (patch)
tree4a69b375295f1d594fe4df91c40176c1acb30617 /riscv/riscv_sys.sail
parent3a0bcd6e7f1dd565fb41574285c9c09bbbe14697 (diff)
parentef5d0748c36cd8d66a5fd7436a13392f218e806f (diff)
Merge branch 'rvfi-dii' into sail2
(except without the accidentally committed aarch64 files from the branch)
Diffstat (limited to 'riscv/riscv_sys.sail')
-rw-r--r--riscv/riscv_sys.sail10
1 files changed, 10 insertions, 0 deletions
diff --git a/riscv/riscv_sys.sail b/riscv/riscv_sys.sail
index 9c49d9e5..81871f91 100644
--- a/riscv/riscv_sys.sail
+++ b/riscv/riscv_sys.sail
@@ -874,10 +874,20 @@ union ctl_result = {
/* TODO: CTL_URET */
}
+$ifdef RVFI_DII
+val rvfi_trap : unit -> unit effect {wreg}
+function rvfi_trap () =
+ rvfi_exec->rvfi_trap() = 0x01
+$else
+val rvfi_trap : unit -> unit
+function rvfi_trap () = ()
+$endif
+
/* handle exceptional ctl flow by updating nextPC and operating privilege */
function handle_trap(del_priv : Privilege, intr : bool, c : exc_code, pc : xlenbits, info : option(xlenbits))
-> xlenbits = {
+ rvfi_trap();
print("handling " ^ (if intr then "int#" else "exc#") ^ BitStr(c) ^ " at priv " ^ del_priv ^ " with tval " ^ BitStr(tval(info)));
match (del_priv) {