ibex icon indicating copy to clipboard operation
ibex copied to clipboard

Single stepping over `lw` doesn't cause a jump back to Debug Mode

Open udinator opened this issue 6 years ago • 1 comments

Hi all, I'm seeing something interesting occur when I run riscv_debug_single_step_test on Ibex in the experimental-maxperf-pmp-bmfull configuration. Screenshot from 2020-07-09 16-22-06 In the waveform, Ibex has just finished single stepping over the instruction at pc_id=0x8000_b25e, and has just executed the dret indicating the end of the debug rom at pc_id=0x8000_b7ca (debug_single_step_i in the controller is still high, so I am expecting Ibex to execute the next instruction it sees and re-enter debug mode). Ibex correctly returns to execute the instruction at pc_id=0x8000_b262, which is a lw instruction, and the controller raises enter_debug_mode accordingly as the core stalls to allow the memory transaction to finish. However after the load transaction has cleared (the cycle before marker M1), enter_debug_mode drops to 0 as instr_valid_i suddenly drops to 0. This causes the core to incorrectly execute the next instruction (pc_id=0x8000_b266) and step into debug mode only after this instruction has passed through the ID stage (at marker M2) - Ibex should have stepped into debug mode after pc_id=0x8000_b262.

udinator avatar Jul 09 '20 23:07 udinator

I am looking into this today

GregAC avatar Jul 14 '20 07:07 GregAC