-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
triggers: icount: not to decrease on firing icount trigger with Debug Mode action #1337
triggers: icount: not to decrease on firing icount trigger with Debug Mode action #1337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the case here? It seems this would apply only in the screwy case that someone wrote (via csrw) pending=1 && count>0
.
Even in that case, icount breakpoints decrement on traps, too, so why shouldn't it decrement on this trap?
@scottj97 is right. The icount should decrease the counter on firing with action=breakpoint. Sorry for the misunderstanding of the specification. From the current implementation, the icount does not decrease the counter on entering debug mode due to debug interrupt but does on entering debug mode due to trigger firing. Although both conditions enter debug mode, the icount.count behaves differently under those conditions. |
Clarifying desired behavior in riscv/riscv-debug-spec#842. |
b12d7ae
to
4fce5a4
Compare
The issue (riscv/riscv-debug-spec#842) clarifies that the icount decreases on firing a breakpoint action but not on entering Debug Mode action. For example, consider the case by @scottj97, where The commit (4fce5a4) updates the behavior correspondingly. |
4fce5a4
to
e7505b3
Compare
… Mode action The icount decreases on firing beakpoint action but not on entering Debug Mode action. Reference: riscv/riscv-debug-spec#842
6ce7bbf
to
fb18fe2
Compare
Firing a icount trigger does not execute current instruction and should not decrease.
Update (2023.06.19) riscv/riscv-debug-spec#842 (comment):
The icount decreases on firing trigger action=breakpoint but not on firing trigger action=debug_mode when icount.count=1.