riscv-non-isa/riscv-trace-spec

Which instruction should be reported when trigger's timing = 0/1.

Opened this issue · 0 comments

If timing = 1, the trigger fires after the instruction retire, so it's not ambiguous that we should report the instruction that fires.
But if timing = 0, the trigger fires before the instruction retire, so whether we should report the prior instruction before the instruction that fires?

What will happen when triggers with different actions fires at the same time?
For example, if one trigger whose action = 1, timing = 0, and one trigger whose action = 4, timing=0 fire at the same time, when entering debug mode, the instruction that fires doesn't actually retire. If we need to trace the instruction, we need to wait the instruction write back and really reitre. But when enter debug,dpc could be changed. So when exit debug, the first instruction won't be the triggered instruction.

(riscv-debug-stable 5.3 says What happens with trace actions when triggers with different actions are also firing is left to the trace specification, But we didn't find the related description)