Skip to content

Commit

Permalink
ELP state is preserved in xStatus by traps
Browse files Browse the repository at this point in the history
  • Loading branch information
ved-rivos committed Nov 28, 2023
1 parent 7c52934 commit 97e3fcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions model/riscv_sys_control.sail
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ val rvfi_trap : unit -> unit
function rvfi_trap () = ()
$endif

val zicfilp_preserve_elp : (Privilege) -> unit

/* handle exceptional ctl flow by updating nextPC and operating privilege */

function trap_handler(del_priv : Privilege, intr : bool, c : exc_code, pc : xlenbits, info : option(xlenbits), ext : option(ext_exception))
Expand All @@ -417,6 +419,7 @@ function trap_handler(del_priv : Privilege, intr : bool, c : exc_code, pc : xlen

cur_privilege = del_priv;

zicfilp_preserve_elp(del_priv);
handle_trap_extension(del_priv, pc, ext);

if get_config_print_reg()
Expand All @@ -442,6 +445,7 @@ function trap_handler(del_priv : Privilege, intr : bool, c : exc_code, pc : xlen

cur_privilege = del_priv;

zicfilp_preserve_elp(del_priv);
handle_trap_extension(del_priv, pc, ext);

if get_config_print_reg()
Expand All @@ -462,6 +466,7 @@ function trap_handler(del_priv : Privilege, intr : bool, c : exc_code, pc : xlen

cur_privilege = del_priv;

zicfilp_preserve_elp(del_priv);
handle_trap_extension(del_priv, pc, ext);

if get_config_print_reg()
Expand Down

0 comments on commit 97e3fcf

Please sign in to comment.