Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Debug Module

Phase 1B: Core DM Registers

Status of SpinalHDL DebugModule on upstream dev checked on hardware (Arty A7, VexRiscv and VexiiRiscv, over SWD) against the ratified RISC-V Debug Specification 1.0.

✅ implemented · ⚠️ implemented, with an open issue · ⚪ optional in the specification and not implemented, so not needed for conformance.


Spec Feature (Chapter)Vexriscv Debug ImplementationImplementation Details
Ch 3: Debug Module (DM)
dmcontrol (0x10)✅ Implementeddmactive, ndmreset, haltreq, resumereq, ackhavereset, hartsello/hi. Missing (optional): hasel, setresethaltreq/clrresethaltreq, hartreset, keepalive. ackhavereset acked the previously selected hart: fixed in SpinalHDL#1972 (merged)
dmstatus (0x11)✅ Implementedversion=2 (0.13) on upstream dev, the workspace pin, and the Arty image, authenticated=1, all halted/running/unavail/nonexistent/resumeack/havereset flags, impebreak=1. A nonexistent hart read as halted, running and unavailable at once: fixed in SpinalHDL#1972 (merged). SpinalHDL#2017 (open, e93be07d6) sets DebugModuleFiber to version 3 and leaves dtmcs.version at 1. A generator that passes version = dtmcs.version + 1 reports 2
hartinfo (0x12)✅ Implementeddataaddr=0, datasize=0, dataaccess=0, nscratch=0
abstractcs (0x16)✅ Implementeddatacount, progbufsize, busy, cmderr. A write while busy now sets cmderr=1 and does not W1C until idle: SpinalHDL#1990 (merged). Only codes 0–4 are raised; the unused OTHER code encodes as 6 instead of 7 (latent). Fix proposed in SpinalHDL#2017 (open, 55ce20ee4): explicit encoding, 0–5 unchanged, OTHER = 7, still latent
command (0x17) — Access Register✅ Implementedcmdtype=0 with full FSM: transfer, write, postexec, aarsize validation. GPRs; FPRs only with a 64-bit FPU on VexRiscv, never on VexiiRiscv. CSRs and aarpostincrement return NOT_SUPPORTED (allowed). A command to a nonexistent hart hung busy: fixed in SpinalHDL#1972 (merged). A command write while busy or cmderr≠0 used to replace the stored command: fixed in SpinalHDL#1990 (merged). FPR access on a hart without an FPU returned cmderr 2 instead of 3: fixed in SpinalHDL#2012 (merged f88dc4bf, 2026-11-27), which also makes transfer=0 ignore regno and aarsize
command (0x17) — Access Memory⚪ Not implemented (optional)Returns NOT_SUPPORTED (cmderr=2), the required answer for an unimplemented command
command (0x17) — Quick Access⚪ Not implemented (optional)Returns NOT_SUPPORTED (cmderr=2), the required answer for an unimplemented command
abstractauto (0x18)✅ Implementedautoexecdata and autoexecProgbuf for burst access. A write while busy used to take effect: fixed in SpinalHDL#1990 (merged)
progbuf0-N (0x20+)✅ ImplementedParameterized progbuf memory (2 words), multi-word execution with counter, redo support, exception → cmderr=3. Reads return 0 (allowed in 1.0) and count as accesses. A write while busy used to take effect: fixed in SpinalHDL#1990 (merged)
data0-N (0x04+)✅ ImplementedMemory-backed, hart writes via fromHarts, and an accepted debugger write updates the memory the debugger reads. 1 word on RV32, 2 on RV64. A write or read while busy used to go through without cmderr=1: fixed in SpinalHDL#1990 (merged). A debugger write used to reach the hart without reading back: fixed in SpinalHDL#2013 (merged e386ec23, 2026-11-27). The read returns the debugger's value, including after an Access Register write
sbcs (0x38) — System Bus Access✅ Implemented (optional, VexiiRiscv --debug-sysbus only)sbversion=1, sbasize=32, sbaccess32 only, sbbusyerror, sbbusy, sbreadonaddr, sbautoincrement, sbreadondata, sberror. Not present on VexRiscv. Bus errors and unaligned addresses were not reported in sberror: fixed in SpinalHDL#1977 (merged)
sbaddress0 (0x39)✅ ImplementedRead/write with auto-increment. It did not increment after writes or after the sbreadonaddr read, and writes were dropped while sberror≠0: fixed in SpinalHDL#1977 (merged)
sbdata0 (0x3c)✅ ImplementedRead/write with bus triggers. Block writes with sbautoincrement all landed on the first address, sbdata0 was overwritten by the write acknowledge, and a read while busy did not set sbbusyerror: fixed in SpinalHDL#1977 (merged)
sbaddress1-3 / sbdata1-3⚪ Not implemented (optional)32-bit address/data only; these registers are not present with sbasize ≤ 32 and 32-bit access
sbcs 8/16/64/128-bit access⚪ Not implemented (optional)Only sbaccess32 supported; other sizes set sberror=4
haltsum0 (0x40)✅ ImplementedPer-hart halted bits, up to 32 harts. Optional when only one hart is connected
haltsum1-3⚪ Not implemented (optional)Only haltsum0 exists; the others are only needed above 32 harts
authdata (0x30)⚪ Not implemented (optional)Always authenticated (authenticated=1)
confstrptr0-3⚪ Not implemented (optional)confstrptrvalid=0
nextdm (0x1d)⚪ Not implemented (optional)Reads 0: the only Debug Module on this DMI
dmcs2 (0x32)⚪ Not implemented (optional)Halt groups; every field is optional
Hart arrays (hawindowsel/hawindow)⚪ Not implemented (optional)hasel reads 0, one hart selected at a time
custom0-15⚪ Not implemented (optional)—
Multi-hart support✅ ImplementedParameterized p.harts, per-hart buses, hartSel selection; independent halt/resume and abstract commands per hart (2-hart VexiiRiscv). Hart-selection bugs fixed in SpinalHDL#1972 (merged).