Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Donahue <[email protected]>
Signed-off-by: Yazan Hussnain <[email protected]>
  • Loading branch information
YazanHussnain-10x and pdonahue-ventana authored Oct 31, 2024
1 parent ab5f9b0 commit c8a0156
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions model/riscv_sys_control.sail
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down Expand Up @@ -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 => {
Expand Down
14 changes: 7 additions & 7 deletions model/riscv_sys_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}

Expand Down Expand Up @@ -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 }
}

Expand Down Expand Up @@ -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,
Expand All @@ -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
}
Expand Down

0 comments on commit c8a0156

Please sign in to comment.