Skip to content

dm_csrs: ignore abstract commands when cmderr is non-zero - #206

Merged
phsauter merged 2 commits into
pulp-platform:masterfrom
devtyagi3909:fix-cmderr-compliance
Sep 15, 2026
Merged

phsauter merged 2 commits into
pulp-platform:masterfrom
devtyagi3909:fix-cmderr-compliance

Conversation

@devtyagi3909

Copy link
Copy Markdown
Contributor

This addresses the compliance bug tracked in openhwfoundation/cva6#3498.

According to the RISC-V External Debug Support spec (0.13.2), if cmderr is non-zero, writes to the command register must be ignored and no new abstract command can be started.

Currently, dm_csrs only gates command writes and abstractauto triggers on !cmdbusy_i. This allows a debugger to silently execute broken command sequences if it fails to check and clear cmderr.

This PR introduces a strict cmderr_q == dm::CmdErrNone gate to both execution paths to bring the DM into spec compliance.

@phsauter

Copy link
Copy Markdown
Collaborator

Relates to #196 (and fixes part of it).
The changes look good, if you can fix the lints (line length), I will merge it.

@devtyagi3909

Copy link
Copy Markdown
Contributor Author

lints fixed. ready to merge.

@phsauter
phsauter merged commit 643607e into pulp-platform:master Sep 15, 2026
6 checks passed
@devtyagi3909
devtyagi3909 deleted the fix-cmderr-compliance branch September 15, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants