Repository navigation
dm_mem: bind abstract commands to admission hartsel - #204
Conversation
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.
|
Thanks for the PR, this looks like the correct general approach. I think it is best to merge #194 first. That PR removes the Some other thoughts: Please latch Optionally, since the current debug spec explicitly recommends the hardware to enforce the busy-time restriction, it would be nice to just ignore writes to |
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.
3a6ddc5 to
2a1801d
Compare
|
Thanks @phsauter! I've force-pushed an update that incorporates all your feedback:
I will leave the multi-hart regression test to the follow-up PR, but everything on the RTL side should now be fully covered and spec-compliant! |
| assign dmcontrol_write_accepted = dmi_req_ready_o && dmi_req_valid_i && | ||
| dtm_op == dm::DTM_WRITE && | ||
| dm_csr_addr == dm::DMControl; | ||
| assign dmcontrol_write_resumereq = dmcontrol_write_accepted && dmi_req_i.data[30]; |
There was a problem hiding this comment.
I think this got lost in the rebase because its now handled immediately here:
assign dmcontrol_write_resumereq = dmcontrol_write_accepted && !cmdbusy_i && dmi_req_i.data[30];
phsauter
left a comment
There was a problem hiding this comment.
Just one thing probably caused by the rebase, the rest is good.
|
I had to add one more commit to #194 to fix an edge-case but now it is merged, so yours is next. |
|
Done! Added the |
Fixes #203.
As described in the issue,
dm_mempreviously keyedgo/resumeflags and abstract command completion off the livehartselvalue instead of the hart selected at command admission. Ifdmcs.hartselchanged mid-command, the execution would be incorrectly relocated to the new hart.This PR introduces
cmd_hartsel_q, which latcheshartselat command admission (during theIdlestate) and uses the latched value throughout theGo,Resume, andCmdExecutingstates, as well as for theFlagsBaseAddrpolling logic. This ensures that the command is safely bound to the originally selected hart regardless of subsequenthartselchanges whilebusy=1.