Description
The 1.0 version of the debug specification gives a lot of freedom to the trigger implementers if and how to implement support for mcontrol6.hit{0,1}
bits. At the same time it is not clearly reported back to the external debugger if hit bits are supported.
As an extreme case, the current version of the spec permits that a given mcontrol6 trigger supports the hit bits for certain combination of fields of mcontrol6 and but does not support them for other combination of the fields of that very same trigger.
For these reasons, it is difficult for the external debugger to distinguish what hit[1:0] == 0b00
actually means:
- a) Hit bits are not supported on this trigger, and we do not know if the trigger fired.
- b) Hit bits are supported on this trigger, and the trigger has not fired.
In order to reliably tell these two cases apart, the external debugger currently needs to perform a lengthy procedure:
for each mcontrol6 trigger whose hit[1:0] == 0b00:
try writing 0b01, 0b10 and 0b11 to hit[1:0], and retain other tdata1 bits;
if any of the cases results in hit[1:0] non-zero:
restore hit[1:0] to 0b00;
return this_trigger_is_not_hit;
else:
return this_trigger_does_not_support_hit;
With the above in mind, I propose that 1.1 version of the spec introduces a clear mechanism that will tell external debuggers whether mcontrol6.hit bits are supported in the hardware.
I can think of these options:
Option 1: Make mcontrol6.hit
bits mandatory for all trigger implementations and increment tinfo.version
.
Option 2: Introduce new mcontrol6.hit2
bit which would allow to encode all the outcomes below. Don't allow partial implementation of some but not all of the hit bits. Make the hit bits read only, similarly to Increment dcsr.cause
.tinfo.version
.
- mcontrol.hit[2:0] == 0b000 - Trigger not hit
- mcontrol.hit[2:0] == 0b001 - Trigger hit before
- mcontrol.hit[2:0] == 0b010 - Trigger hit sometime after
- mcontrol.hit[2:0] == 0b011 - Trigger hit immediately after
- mcontrol.hit[2:0] == 0b100 - Hit information not supported
- mcontrol.hit[2:0] == 0b101, 0b110, 0b111 - Reserved for future use
What is your opinion on this? Thank you.
Activity