Skip to content

Commit 8b82e89

Browse files
committed
[controller] Add assertion on pipeline flush when entering debug mode
Signed-off-by: Andreas Kurth <[email protected]>
1 parent 88d27a0 commit 8b82e89

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rtl/ibex_controller.sv

+9
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,15 @@ module ibex_controller #(
997997
// If there's a pending exception req that doesn't need a PC set we must not see one
998998
`ASSERT(IbexNoPCSetOnSpecialReqIfNotExpected,
999999
exception_req_pending && !expect_exception_pc_set |-> ~pc_set_o)
1000+
1001+
// If entering or exiting debug mode, the pipeline must be flushed. This is because Ibex
1002+
// currently does not support some of the pipeline stages being in debug mode; either all or
1003+
// none of the pipeline stages must be in debug mode. As `flush_id_o` only affects the ID/EX
1004+
// stage but does not prevent a fetched instruction from proceeding to ID/EX the next cycle, the
1005+
// assertion additionally requires `pc_set_o`, which sets the PC in the IF stage to a new value,
1006+
// hence preventing a fetched instruction from proceeding to the ID/EX stage in the next cycle.
1007+
`ASSERT(IbexPipelineFlushOnChangingDebugMode,
1008+
debug_mode_d != debug_mode_q |-> flush_id_o & pc_set_o)
10001009
`endif
10011010

10021011
`ifdef RVFI

0 commit comments

Comments
 (0)