microwatt
microwatt copied to clipboard
Add instruction breakpoint
Add a instruction breakpoint to microwatt. When the PC hits this value, take a trace exception at 0xD00.
The ISA defines the CIABR which is the "completed" instruction. This means take the exception after the instruction is run which is not ideal from a software perspective. An implementation that takes the breakpoint before the instruction is executed would be more useful but we'd have to call it an IABR not CIABR.
Extra credit for adding single stepping and/or branch tracing via MSR[TE].
I've got a bit of a WIP here: https://github.com/iamjpn/microwatt/tree/ciabr
Doesn't actually seem to complete first the instruction though.
What do you mean by that? @iamjpn
Doesn't actually seem to complete first the instruction though.
What do you mean by that? @iamjpn
What I mean is that currently the exception is taken before the instruction is completed.
breakpoint:
addi %r4, %r4, 1
b 1f // should be skipped
//cmpwi %r4, 1
//bne 1f
That's why I commented out that cmpwi in the test. I've got to fix that up.
As mentioned in the first comment, it would be useful to have it that way but it's not arch compliant.
I reimplemented @iamjpn work for a newer version of the code and wanted to make it arch compliant, but I'm having trouble getting the completed instruction address instead of the next instruction address.
https://github.com/iagocaran/microwatt