Skip to content

dm: Fix multi-hart resume acknowledgement handling - #194

Merged
phsauter merged 5 commits into
masterfrom
phsauter/issue164
Sep 3, 2026
Merged

phsauter merged 5 commits into
masterfrom
phsauter/issue164

Conversation

@phsauter

@phsauter phsauter commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #164 and addresses #161.

Clear and evaluate resume acknowledgements per hart so stale acknowledgements cannot complete another hart’s resume request.
Adds Verilator regressions testing for multi-hart configurations.

@phsauter
phsauter force-pushed the phsauter/issue164 branch 3 times, most recently from 057b685 to b9b99d2 Compare August 11, 2026 09:09
phsauter and others added 3 commits August 11, 2026 15:37
Keep accepted resume actions pending per hart until acknowledged, clear only the acknowledgement of the request target, and preserve same-cycle request and acknowledgement priority.

Co-authored-by: Luis Donatien <luis.waucquez.jimenez@alumnos.upm.es>
Exercise retained per-hart requests and flag routing, stale and simultaneous acknowledgements, WARL hart selection, selectable harts, and reset precedence through the integrated Debug Module. Share the Verilator runner and Bender checkout across focused simulator targets.
Mask the write-only haltreq field from DMControl reads while retaining the stored request that drives the selected hart. Extend the multi-hart regression to verify both behaviors.
Expose per-hart pending resume actions directly through the flag page so they cannot block or discard unrelated abstract commands. Admit pending actions only for available halted harts, preserve acknowledgements across non-DM reset, reset them through dmactive, and reject invalid debug-memory hart IDs.
devtyagi3909 added a commit to devtyagi3909/riscv-dbg that referenced this pull request Sep 2, 2026
Fixes pulp-platform#203.

Previously, dm_mem used the live dmcs.hartsel value to route the 'go'
and 'resume' flags during command execution, and to wait for completion.
If hartsel was changed by the debugger mid-command (while busy=1), the
in-flight command would erroneously be relocated to the newly selected
hart, causing cross-hart register injection or unrecoverable wedges.

This introduces a cmd_hartsel_q register that latches the target hart at
command admission (in the Idle state) and uses the latched value for
go/resume routing and completion tracking, ensuring execution is bound
to the hart selected when the command was admitted.

It also enforces the debug spec recommendation by having dm_csrs ignore
writes to dmcontrol (except dmactive and ndmreset) while cmdbusy is high.

Rebased on top of pulp-platform#194.
@phsauter
phsauter merged commit 6644a09 into master Sep 3, 2026
7 checks passed
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.

1 participant