diff options
Diffstat (limited to 'riscv/riscv_sys.sail')
| -rw-r--r-- | riscv/riscv_sys.sail | 10 |
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) { |
