Skip to content

Commit 7873956

Browse files
committed
[ibex_core] Fix assertion when SecureIbex is false
This assertion wasn't quite correct if SecureIbex is false because it was checking for the magic IbexMuBiOn value instead of just looking at the bottom bit. Fixes #2249.
1 parent cecf4fd commit 7873956

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

rtl/ibex_core.sv

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,13 +1020,19 @@ module ibex_core import ibex_pkg::*; #(
10201020
end
10211021
end
10221022

1023-
// When fetch is disabled no instructions should be executed. Once fetch is disabled either the
1023+
// A 1-bit encoding of fetch_enable_i to avoid polluting the NoExecWhenFetchEnableNotOn assertion
1024+
// with notes about SecureIbex and mubi values.
1025+
logic fetch_enable_raw;
1026+
assign fetch_enable_raw = SecureIbex ? (fetch_enable_i == IbexMuBiOn) : fetch_enable_i[0];
1027+
1028+
// When fetch is disabled, no instructions should be executed. Once fetch is disabled either the
10241029
// ID/EX stage is not valid or the PC of the ID/EX stage must remain as it was at disable. The
10251030
// ID/EX valid should not ressert once it has been cleared.
1026-
`ASSERT(NoExecWhenFetchEnableNotOn, fetch_enable_i != IbexMuBiOn |=>
1027-
(~instr_valid_id || (pc_id == pc_at_fetch_disable)) && ~$rose(instr_valid_id))
1031+
`ASSERT(NoExecWhenFetchEnableNotOn,
1032+
!fetch_enable_raw |=>
1033+
(~instr_valid_id || (pc_id == pc_at_fetch_disable)) && ~$rose(instr_valid_id))
10281034

1029-
`endif
1035+
`endif // INC_ASSERT
10301036

10311037
////////////////////////
10321038
// RF (Register File) //

0 commit comments

Comments
 (0)