From c8a0156aa9f8805ec9bb69f6880ca77cc65bfaaf Mon Sep 17 00:00:00 2001 From: Yazan Hussnain <127395748+YazanHussnain-10x@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:08:22 +0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Paul Donahue <48959409+pdonahue-ventana@users.noreply.github.com> Signed-off-by: Yazan Hussnain <127395748+YazanHussnain-10x@users.noreply.github.com> --- model/riscv_sys_control.sail | 6 +++--- model/riscv_sys_regs.sail | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/model/riscv_sys_control.sail b/model/riscv_sys_control.sail index 5a3f24a9c..d8e66314b 100644 --- a/model/riscv_sys_control.sail +++ b/model/riscv_sys_control.sail @@ -296,14 +296,14 @@ $endif /* Disable trigger firing in trap handler */ function TriggerFireMatch(cur_priv : Privilege) -> bool = { - /* Second solution of reenterancy problem */ + /* Second solution of reentrancy problem */ if (sys_reent_opt1()) then { match cur_priv { Machine => bits_to_bool(tcontrol[mte]), _ => true } } - /* First solution of reenterancy problem */ + /* First solution of reentrancy problem */ else { match cur_privilege { Machine => bits_to_bool(mstatus[MIE]), @@ -553,7 +553,7 @@ function instrDataMatch(cur_priv : Privilege, addr : xlenbits, data : xlenbits, if ((((MCtrl6[m] == 0b1) & (cur_priv == Machine)) | /* Trigger is enabled in M-mode */ ((MCtrl6[s] == 0b1) & (cur_priv == Supervisor)) | /* Trigger is enabled in S-mode */ ((MCtrl6[u] == 0b1) & (cur_priv == User)) ) & /* Trigger is enabled in U-mode */ - (TriggerFireMatch(cur_priv))) then { /* Trigger match valid? check re-enternacy */ + (TriggerFireMatch(cur_priv))) then { /* Trigger match valid? check reentranacy */ match match_type { /* Check For PC or Instruction Match */ INSTR_MATCH => { diff --git a/model/riscv_sys_regs.sail b/model/riscv_sys_regs.sail index b44c8bd54..7c55af699 100644 --- a/model/riscv_sys_regs.sail +++ b/model/riscv_sys_regs.sail @@ -364,8 +364,8 @@ function legalize_medeleg(o : Medeleg, v : xlenbits) -> Medeleg = { /* M-EnvCalls delegation is not supported */ let m = Mk_Medeleg(v); let m = [m with MEnvCall = 0b0]; - /* medeleg[3] <-> Breakpoint Exception is hard-wire to 0 for second solution - of re-enterancy problem */ + /* medeleg[3] <-> Breakpoint Exception is hard-wired to 0 for second solution + of reentrancy problem */ if (sys_reent_opt1()) then { let m = [m with Breakpoint = bool_bits(not(sys_reent_opt1()))]; m } else { m } } @@ -694,7 +694,7 @@ register tselect : xlenbits /* Legalize TSELECT */ function legalize_tselect(o : xlenbits, v : xlenbits) -> xlenbits = { let t : xlenbits = o; - // TODO: Avoid hardcode value + // TODO: Avoid hardcoded value if (unsigned(v) <= (sizeof(N_TRIGGERS) - 1)) then { v } else { t } } @@ -742,7 +742,7 @@ bitfield MatchControlType6 : bits(27) = { size : 18 .. 16, /* Trigger Action */ action : 15 .. 12, - /* trigger chaning */ + /* trigger chaining */ chain : 11, /* Trigger match options */ match_opt : 10 .. 7, @@ -754,13 +754,13 @@ bitfield MatchControlType6 : bits(27) = { s : 4, /* Enable Mcontrol6 trigger in U-mode */ u : 3, - /* Trigger fires on the virtual address or opcode WARL + /* Trigger fires on the virtual address or opcode of an instruction that is executed */ execute : 2, - /* Trigger fires on the virtual address or data of WARL + /* Trigger fires on the virtual address or data of any store */ store : 1, - /* Trigger fires on the virtual address or data of WARL + /* Trigger fires on the virtual address or data of any load */ load : 0 }