Skip to content
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

Clarify the restriction on dmcontrol writes while abstractcs.busy is high #1040

Closed
wants to merge 1 commit into from

Conversation

en-sc
Copy link
Contributor

@en-sc en-sc commented May 17, 2024

With the clarification, it's obvious that the DM can be reset without knowing the hartsel.

Fixes #1021

Copy link
Collaborator

@rtwfroody rtwfroody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the spirit of this change. I wonder if it also needs a line in the definition of dmactive that makes it clear that when 0 is written to dmactive that all other dmcontrol bits are ignored.

Comment on lines 371 to 372
While an abstract command is executing ({abstractcs-busy} in {dm-abstractcs} is high), a debugger must not change {hartsel}, and must not write 1 to {dmcontrol-haltreq}, {dmcontrol-resumereq}, {dmcontrol-ackhavereset}, {dmcontrol-setresethaltreq}, or {dmcontrol-clrresethaltreq},
unless the DM is reset by the same write to {dm-dmcontrol} ({dmcontrol-dmactive} is lowered).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is getting really long.

Suggested change
While an abstract command is executing ({abstractcs-busy} in {dm-abstractcs} is high), a debugger must not change {hartsel}, and must not write 1 to {dmcontrol-haltreq}, {dmcontrol-resumereq}, {dmcontrol-ackhavereset}, {dmcontrol-setresethaltreq}, or {dmcontrol-clrresethaltreq},
unless the DM is reset by the same write to {dm-dmcontrol} ({dmcontrol-dmactive} is lowered).
While an abstract command is executing ({abstractcs-busy} in {dm-abstractcs} is high), a debugger must not change {hartsel}, and must not write 1 to {dmcontrol-haltreq}, {dmcontrol-resumereq}, {dmcontrol-ackhavereset}, {dmcontrol-setresethaltreq}, or {dmcontrol-clrresethaltreq}.
The exception to this rule is when 0 is written to {dmcontrol-dmactive}. In that case the DM is reset, and the other values written to {dm-dmcontrol} are ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

… is high

With the clarification, it's obvious that the DM can be reset without
knowing the `hartsel`.

Fixes riscv#1021
@en-sc en-sc force-pushed the en-sc/dmactive-hartsel branch from 6a08d8c to 8f8bd09 Compare May 23, 2024 16:55
Copy link
Contributor

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me.

Tim: I wonder if it also needs a line in the definition of dmactive that makes it clear that when 0 is written to dmactive that all other dmcontrol bits are ignored.

I would be in favor of adding this, too.

@rtwfroody rtwfroody added the 1.0 label Jun 10, 2024
rtwfroody added a commit that referenced this pull request Jun 13, 2024
Also the debugger should write dmcontrol=0 to perform a reset, instead
of "may".

Fixes #1021.

Alternate to #1040, after some discussion in the meeting. #1040 didn't
address what happens while dmactive is changing. This version is not a
substantive change, so also a bit easier to merge.
@rtwfroody
Copy link
Collaborator

This is not backwards compatible, and the issue is not severe enough to warrant a backwards-incompatible change.

@rtwfroody rtwfroody closed this Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to reset the DM on the first connection on both 0.13 and 1.0 spec versions
3 participants