-
Notifications
You must be signed in to change notification settings - Fork 353
Add dcsr cetrig control #1255
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
base: riscv
Are you sure you want to change the base?
Add dcsr cetrig control #1255
Conversation
Ubuntu 20.04 is no longer available. See actions/runner-images#11101 Checkpatch-ignore: BAD_SIGN_OFF Change-Id: I0ec3e3342f9212a2a79d8dca6274e7db62ecedab Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
…-spec This pulls in some improvements from the riscv-debug-spec repo, and cleans up the licensing (riscv-debug-spec changed the license to dual CC-BY-4.0 and BSD-2-Clause specifically to make sure the generated debug_defines files don't conflict with OpenOCD licensing) Signed-off-by: Bernhard Rosenkränzer <bero@baylibre.com>
6b88574
to
605e820
Compare
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.
Thank you for the patch!
Overall it looks great, the only concern I have is with the new return from riscv013_halt_reason()
. I'm not sure RISCV_HALT_ERROR
is the proper return code. I'd suggest adding a new status and handling it differently at the callsite.
Also, how did you test the changes? Is this at all possible to extend riscv-tests
to include relevant tests?
@@ -5367,6 +5368,14 @@ static enum riscv_halt_reason riscv013_halt_reason(struct target *target) | |||
return RISCV_HALT_INTERRUPT; | |||
case CSR_DCSR_CAUSE_GROUP: | |||
return RISCV_HALT_GROUP; | |||
case CSR_DCSR_CAUSE_OTHER: | |||
if (get_field(dcsr, CSR_DCSR_EXTCAUSE) == 0) { | |||
LOG_TARGET_WARNING(target, "halted because of hart in a critical error state."); |
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.
LOG_TARGET_WARNING(target, "halted because of hart in a critical error state."); | |
LOG_TARGET_INFO(target, "halted because of hart in a critical error state."); |
I believe INFO
is more appropriate here, since this is completely normal from the debugger's point of view.
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.
Addressed
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.
I am sorry but would like to disagree.
Even though this is not an error of OpenOCD or of the debug transport (JTAG adapter or similar), it is situation that is clearly exceptional and requires user attention. As such, it should be prominently displayed to the user. So a warning is in my opinion warranted here.
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.
@JanMatCodasip, I will insist)
- IMHO a similar example will be an assertion failure. GDB does not warn about an assertion failure -- it just notifies you.
- To be honest, this seems like an issue with the spec, but: what if the
Smdbltrp
extension is not implemented? Thecause
may still beother
but this is not an exceptional situation.
d1d2b0a
to
aed2254
Compare
|
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.
Overall this looks good. I have managed a partial review and am sending my comments so far.
d368717
to
31e3406
Compare
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.
I have few more comments, otherwise the changes look good.
@@ -5367,6 +5368,14 @@ static enum riscv_halt_reason riscv013_halt_reason(struct target *target) | |||
return RISCV_HALT_INTERRUPT; | |||
case CSR_DCSR_CAUSE_GROUP: | |||
return RISCV_HALT_GROUP; | |||
case CSR_DCSR_CAUSE_OTHER: | |||
if (get_field(dcsr, CSR_DCSR_EXTCAUSE) == 0) { | |||
LOG_TARGET_WARNING(target, "halted because of hart in a critical error state."); |
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.
I am sorry but would like to disagree.
Even though this is not an error of OpenOCD or of the debug transport (JTAG adapter or similar), it is situation that is clearly exceptional and requires user attention. As such, it should be prominently displayed to the user. So a warning is in my opinion warranted here.
31e3406
to
fb914e0
Compare
Introduce RISC-V-sepecific `configure` parameter `-cetrig`
fb914e0
to
65b6aab
Compare
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.
LGTM, thank you.
Introduce RISC-V-sepecific
configure
parameter-cetrig