Address | Name | Page |
---|---|---|
0x04 | Abstract Data 0 (data0 ) |
|
0x0f | Abstract Data 11 (data11 ) |
|
0x10 | Debug Module Control (dmcontrol ) |
|
0x11 | Debug Module Status (dmstatus ) |
|
0x12 | Hart Info (hartinfo ) |
|
0x13 | Halt Summary 1 (haltsum1 ) |
|
0x14 | Hart Array Window Select (hawindowsel ) |
|
0x15 | Hart Array Window (hawindow ) |
|
0x16 | Abstract Control and Status (abstractcs ) |
|
0x17 | Abstract Command (command ) |
|
0x18 | Abstract Command Autoexec (abstractauto ) |
|
0x19 | Configuration String Pointer 0 (confstrptr0 ) |
|
0x1a | Configuration String Pointer 1 (confstrptr1 ) |
|
0x1b | Configuration String Pointer 2 (confstrptr2 ) |
|
0x1c | Configuration String Pointer 3 (confstrptr3 ) |
|
0x1d | Next Debug Module (nextdm ) |
|
0x20 | Program Buffer 0 (progbuf0 ) |
|
0x2f | Program Buffer 15 (progbuf15 ) |
|
0x30 | Authentication Data (authdata ) |
|
0x34 | Halt Summary 2 (haltsum2 ) |
|
0x35 | Halt Summary 3 (haltsum3 ) |
|
0x37 | System Bus Address 127:96 (sbaddress3 ) |
|
0x38 | System Bus Access Control and Status (sbcs ) |
|
0x39 | System Bus Address 31:0 (sbaddress0 ) |
|
0x3a | System Bus Address 63:32 (sbaddress1 ) |
|
0x3b | System Bus Address 95:64 (sbaddress2 ) |
|
0x3c | System Bus Data 31:0 (sbdata0 ) |
|
0x3d | System Bus Data 63:32 (sbdata1 ) |
|
0x3e | System Bus Data 95:64 (sbdata2 ) |
|
0x3f | System Bus Data 127:96 (sbdata3 ) |
|
0x40 | Halt Summary 0 (haltsum0 ) |
Debug Module Status (dmstatus
, at 0x11)
[dmstatus]
This register reports status for the overall Debug Module as well as
the currently selected harts, as defined in hasel
. Its address will
not change in the future, because it contains version
.
This entire register is read-only.
Field | Description | Access | Reset |
---|---|---|---|
[impebreak] |impebreak| | If 1, then there is an implicit This must be 1 when |
R | Preset |
[allhavereset] |allhavereset| | This field is 1 when all currently selected harts have been reset and reset has not been acknowledged for any of them. | R | - |
[anyhavereset] |anyhavereset| | This field is 1 when at least one currently selected hart has been reset and reset has not been acknowledged for that hart. | R | - |
[allresumeack] |allresumeack| | This field is 1 when all currently selected harts have acknowledged their last resume request. | R | - |
[anyresumeack] |anyresumeack| | This field is 1 when any currently selected hart has acknowledged its last resume request. | R | - |
[allnonexistent] |allnonexistent| | This field is 1 when all currently selected harts do not exist in this platform. | R | - |
[anynonexistent] |anynonexistent| | This field is 1 when any currently selected hart does not exist in this platform. | R | - |
|allunavail| | This field is 1 when all currently selected harts are unavailable. | R | - |
|anyunavail| | This field is 1 when any currently selected hart is unavailable. | R | - |
[allrunning] |allrunning| | This field is 1 when all currently selected harts are running. | R | - |
[anyrunning] |anyrunning| | This field is 1 when any currently selected hart is running. | R | - |
[allhalted] |allhalted| | This field is 1 when all currently selected harts are halted. | R | - |
[anyhalted] |anyhalted| | This field is 1 when any currently selected hart is halted. | R | - |
[authenticated] |authenticated| | 0: Authentication is required before using the DM. 1: The authentication check has passed. On components that don’t implement authentication, this bit must be preset as 1. |
R | Preset |
[authbusy] |authbusy| | 0: The authentication module is ready to process the next
read/write to 1: The authentication module is busy. Accessing
|
R | 0 |
[hasresethaltreq] |hasresethaltreq| | 1 if this Debug Module supports halt-on-reset functionality
controllable by the setresethaltreq and clrresethaltreq bits.
0 otherwise. |
R | Preset |
[confstrptrvalid] |confstrptrvalid| | 0: 1: |
R | Preset |
[version] |version| | 0: There is no Debug Module present. 1: There is a Debug Module and it conforms to version 0.11 of this specification. 2: There is a Debug Module and it conforms to version 0.13 of this specification. 15: There is a Debug Module but it does not conform to any available version of this spec. |
R | 2 |
Debug Module Control (dmcontrol
, at 0x10)
[dmcontrol]
This register controls the overall Debug Module
as well as the currently selected harts, as defined in hasel
.
[hartsel]
Throughout this document we refer to hartsel
, which is hartselhi
combined with hartsello
. While the spec allows for 20 hartsel
bits,
an implementation may choose to implement fewer than that. The actual
width of hartsel
is called HARTSELLEN
. It must be at least 0
and at most 20. A debugger should discover HARTSELLEN
by writing
all ones to hartsel
(assuming the maximum size) and reading back the
value to see which bits were actually set. Debuggers must not change
hartsel
while an abstract command is executing.
On any given write, a debugger may only write 1 to at most one of the
following bits: resumereq
, hartreset
, ackhavereset
,
setresethaltreq
, and clrresethaltreq
. The others must be written 0.
[resethaltreq]
resethaltreq
is an optional internal bit of per-hart state that cannot be
read, but can be written with setresethaltreq
and clrresethaltreq
.
Field | Description | Access | Reset |
---|---|---|---|
[haltreq] |haltreq| | Writing 0 clears the halt request bit for all currently selected harts. This may cancel outstanding halt requests for those harts. Writing 1 sets the halt request bit for all currently selected harts. Running harts will halt whenever their halt request bit is set. Writes apply to the new value of |
W | - |
[resumereq] |resumereq| | Writing 1 causes the currently selected harts to resume once, if they are halted when the write occurs. It also clears the resume ack bit for those harts.
Writes apply to the new value of |
W1 | - |
[hartreset] |hartreset| | This optional field writes the reset bit for all the currently selected harts. To perform a reset the debugger writes 1, and then writes 0 to deassert the reset signal. While this bit is 1, the debugger must not change which harts are selected. If this feature is not implemented, the bit always stays 0, so after writing 1 the debugger can read the register back to see if the feature is supported. Writes apply to the new value of |
R/W | 0 |
[ackhavereset] |ackhavereset| | 0: No effect. 1: Clears Writes apply to the new value of |
W1 | - |
[hasel] |hasel| | Selects the definition of currently selected harts. 0: There is a single currently selected hart, that is selected by 1: There may be multiple currently selected harts – the hart
selected by An implementation which does not implement the hart array mask register must tie this field to 0. A debugger which wishes to use the hart array mask register feature should set this bit and read back to see if the functionality is supported. |
R/W | 0 |
[hartsello] |hartsello| | The low 10 bits of hartsel : the DM-specific index of the hart to
select. This hart is always part of the currently selected harts. |
R/W | 0 |
[hartselhi] |hartselhi| | The high 10 bits of hartsel : the DM-specific index of the hart to
select. This hart is always part of the currently selected harts. |
R/W | 0 |
[setresethaltreq] |setresethaltreq| | This optional field writes the halt-on-reset request bit for all
currently selected harts, unless Writes apply to the new value of If |
W1 | - |
[clrresethaltreq] |clrresethaltreq| | This optional field clears the halt-on-reset request bit for all currently selected harts. Writes apply to the new value of |
W1 | - |
[ndmreset] |ndmreset| | This bit controls the reset signal from the DM to the rest of the system. The signal should reset every part of the system, including every hart, except for the DM and any logic required to access the DM. To perform a system reset the debugger writes 1, and then writes 0 to deassert the reset. | R/W | 0 |
[dmactive] |dmactive| | This bit serves as a reset signal for the Debug Module itself. 0: The module’s state, including authentication mechanism,
takes its reset values (the 1: The module functions normally. No other mechanism should exist that may result in resetting the Debug Module after power up, with the possible (but not recommended) exception of a global reset signal that resets the entire platform. A debugger may pulse this bit low to get the Debug Module into a known state. Implementations may pay attention to this bit to further aid debugging, for example by preventing the Debug Module from being power gated while debugging is active. |
R/W | 0 |
Hart Info (hartinfo
, at 0x12)
[hartinfo]
This register gives information about the hart currently
selected by hartsel
.
This register is optional. If it is not present it should read all-zero.
If this register is included, the debugger can do more with
the Program Buffer by writing programs which
explicitly access the data
and/or dscratch
registers.
This entire register is read-only.
Field | Description | Access | Reset |
---|---|---|---|
[nscratch] |nscratch| | Number of dscratch registers available for the debugger
to use during program buffer execution, starting from dscratch0 .
The debugger can make no assumptions about the contents of these
registers between commands. |
R | Preset |
[dataaccess] |dataaccess| | 0: The 1: The |
R | Preset |
[datasize] |datasize| | If If Since there are at most 12 |
R | Preset |
[dataaddr] |dataaddr| | If If |
R | Preset |
Hart Array Window Select (hawindowsel
, at 0x14)
[hawindowsel]
This register selects which of the 32-bit portion of the hart array mask
register (see Section [hartarraymask]) is accessible in hawindow
.
Field | Description | Access | Reset |
---|---|---|---|
[hawindowsel] |hawindowsel| | The high bits of this field may be tied to 0, depending on how large the array mask register is. E.g. on a system with 48 harts only bit 0 of this field may actually be writable. | R/W | 0 |
Hart Array Window (hawindow
, at 0x15)
[hawindow]
This register provides R/W access to a 32-bit portion of the
hart array mask register (see Section [hartarraymask]).
The position of the window is determined by hawindowsel
. I.e. bit 0
refers to hart ${\tt {hawindowsel}}* 32$, while bit 31 refers to hart
${\tt {hawindowsel}}* 32 + 31$.
Since some bits in the hart array mask register may be constant 0, some
bits in this register may be constant 0, depending on the current value
of hawindowsel
.
Abstract Control and Status (abstractcs
, at 0x16)
[abstractcs]
Writing this register while an abstract command is executing causes
cmderr
to be set to 1 (busy) if it is 0.
datacount
must be at least 1 to support RV32 harts, 2 to support
RV64 harts, or 4 to support RV128 harts.
Field | Description | Access | Reset |
---|---|---|---|
[progbufsize] |progbufsize| | Size of the Program Buffer, in 32-bit words. Valid sizes are 0 - 16. | R | Preset |
[busy] |busy| | 1: An abstract command is currently being executed. This bit is set as soon as |
R | 0 |
[cmderr] |cmderr| | Gets set if an abstract command fails. The bits in this field remain set until they are cleared by writing 1 to them. No abstract command is started until the value is reset to 0. This field only contains a valid value if 0 (none): No error. 1 (busy): An abstract command was executing while 2 (not supported): The requested command is not supported, regardless of whether the hart is running or not. 3 (exception): An exception occurred while executing the command (e.g. while executing the Program Buffer). 4 (halt/resume): The abstract command couldn’t execute because the hart wasn’t in the required state (running/halted), or unavailable. 5 (bus): The abstract command failed due to a bus error (e.g. alignment, access size, or timeout). 7 (other): The command failed for another reason. |
R/W1C | 0 |
[datacount] |datacount| | Number of data registers that are implemented as part of the
abstract command interface. Valid sizes are 1 – 12. |
R | Preset |
Abstract Command (command
, at 0x17)
[command] Writes to this register cause the corresponding abstract command to be executed.
Writing this register while an abstract command is executing causes
cmderr
to be set to 1 (busy) if it is 0.
If cmderr
is non-zero, writes to this register are ignored.
cmderr
inhibits starting a new command to accommodate debuggers
that, for performance reasons, send several commands to be executed
in a row without checking cmderr
in between. They can safely do
so and check cmderr
at the end without worrying that one command
failed but then a later command (which might have depended on the
previous one succeeding) passed.
Field | Description | Access | Reset |
---|---|---|---|
[cmdtype] |cmdtype| | The type determines the overall functionality of this abstract command. | W | 0 |
[control] |control| | This field is interpreted in a command-specific manner, described for each abstract command. | W | 0 |
Abstract Command Autoexec (abstractauto
, at 0x18)
[abstractauto] This register is optional. Including it allows more efficient burst accesses. A debugger can detect whether it is support by setting bits and reading them back.
Writing this register while an abstract command is executing causes
cmderr
to be set to 1 (busy) if it is 0.
Field | Description | Access | Reset |
---|---|---|---|
[autoexecprogbuf] |autoexecprogbuf| | When a bit in this field is 1, read or write accesses to the
corresponding progbuf word cause the command in command to
be executed again. |
R/W | 0 |
[autoexecdata] |autoexecdata| | When a bit in this field is 1, read or write accesses to the
corresponding data word cause the command in command to be
executed again. |
R/W | 0 |
Configuration String Pointer 0 (confstrptr0
, at 0x19)
[confstrptr0]
When confstrptrvalid
is set, reading this register returns bits 31:0
of the configuration string pointer. Reading the other confstrptr
registers returns the upper bits of the address.
When system bus mastering is implemented, this must be an address that can be used with the System Bus Access module. Otherwise, this must be an address that can be used to access the configuration string from the hart with ID 0.
If confstrptrvalid
is 0, then the confstrptr
registers
hold identifier information which is not
further specified in this document.
The configuration string itself is described in the Privileged Spec.
This entire register is read-only.
Next Debug Module (nextdm
, at 0x1d)
[nextdm] If there is more than one DM accessible on this DMI, this register contains the base address of the next one in the chain, or 0 if this is the last one in the chain.
This entire register is read-only.
Abstract Data 0 (data0
, at 0x04)
[data0]
data0
through data11
are basic read/write registers that may
be read or changed by abstract commands. datacount
indicates how many
of them are implemented, starting at data0
, counting up.
Table [tab:datareg] shows how abstract commands use these
registers.
Accessing these registers while an abstract command is executing causes
cmderr
to be set to 1 (busy) if it is 0.
Attempts to write them while busy
is set does not change their value.
The values in these registers may not be preserved after an abstract command is executed. The only guarantees on their contents are the ones offered by the command in question. If the command fails, no assumptions can be made about the contents of these registers.
Program Buffer 0 (progbuf0
, at 0x20)
[progbuf0]
progbuf0
through progbuf15
provide read/write access to the
optional program buffer. progbufsize
indicates how many of them are
implemented starting at progbuf0
, counting up.
Accessing these registers while an abstract command is executing causes
cmderr
to be set to 1 (busy) if it is 0.
Attempts to write them while busy
is set does not change their value.
Authentication Data (authdata
, at 0x30)
[authdata] This register serves as a 32-bit serial port to/from the authentication module.
When authbusy
is clear, the debugger can communicate with the
authentication module by reading or writing this register. There is no
separate mechanism to signal overflow/underflow.
Halt Summary 0 (haltsum0
, at 0x40)
[haltsum0] Each bit in this read-only register indicates whether one specific hart is halted or not. Unavailable/nonexistent harts are not considered to be halted.
The LSB reflects the halt status of hart {hartsel[19:5],5’h0}, and the MSB reflects halt status of hart {hartsel[19:5],5’h1f}.
This entire register is read-only.
Halt Summary 1 (haltsum1
, at 0x13)
[haltsum1] Each bit in this read-only register indicates whether any of a group of harts is halted or not. Unavailable/nonexistent harts are not considered to be halted.
This register may not be present in systems with fewer than 33 harts.
The LSB reflects the halt status of harts {hartsel[19:10],10’h0} through {hartsel[19:10],10’h1f}. The MSB reflects the halt status of harts {hartsel[19:10],10’h3e0} through {hartsel[19:10],10’h3ff}.
This entire register is read-only.
Halt Summary 2 (haltsum2
, at 0x34)
[haltsum2] Each bit in this read-only register indicates whether any of a group of harts is halted or not. Unavailable/nonexistent harts are not considered to be halted.
This register may not be present in systems with fewer than 1025 harts.
The LSB reflects the halt status of harts {hartsel[19:15],15’h0} through {hartsel[19:15],15’h3ff}. The MSB reflects the halt status of harts {hartsel[19:15],15’h7c00} through {hartsel[19:15],15’h7fff}.
This entire register is read-only.
Halt Summary 3 (haltsum3
, at 0x35)
[haltsum3] Each bit in this read-only register indicates whether any of a group of harts is halted or not. Unavailable/nonexistent harts are not considered to be halted.
This register may not be present in systems with fewer than 32769 harts.
The LSB reflects the halt status of harts 20’h0 through 20’h7fff. The MSB reflects the halt status of harts 20’hf8000 through 20’hfffff.
This entire register is read-only.
System Bus Access Control and Status (sbcs
, at 0x38)
[sbcs]
Field | Description | Access | Reset |
---|---|---|---|
[sbversion] |sbversion| | 0: The System Bus interface conforms to mainline drafts of this spec older than 1 January, 2018. 1: The System Bus interface conforms to this version of the spec. Other values are reserved for future versions. |
R | 1 |
[sbbusyerror] |sbbusyerror| | Set when the debugger attempts to read data while a read is in
progress, or when the debugger initiates a new access while one is
already in progress (while While this field is set, no more system bus accesses can be initiated by the Debug Module. |
R/W1C | 0 |
[sbbusy] |sbbusy| | When 1, indicates the system bus master is busy. (Whether the system bus itself is busy is related, but not the same thing.) This bit goes high immediately when a read or write is requested for any reason, and does not go low until the access is fully completed. Writes to |
R | 0 |
[sbreadonaddr] |sbreadonaddr| | When 1, every write to sbaddress0 automatically triggers a
system bus read at the new address. |
R/W | 0 |
[sbaccess] |sbaccess| | Select the access size to use for system bus accesses. 0: 8-bit 1: 16-bit 2: 32-bit 3: 64-bit 4: 128-bit If |
R/W | 2 |
[sbautoincrement] |sbautoincrement| | When 1, sbaddress is incremented by the access size (in
bytes) selected in sbaccess after every system bus access. |
R/W | 0 |
[sbreadondata] |sbreadondata| | When 1, every read from sbdata0 automatically triggers a
system bus read at the (possibly auto-incremented) address. |
R/W | 0 |
[sberror] |sberror| | When the Debug Module’s system bus master encounters an error, this field gets set. The bits in this field remain set until they are cleared by writing 1 to them. While this field is non-zero, no more system bus accesses can be initiated by the Debug Module. An implementation may report “Other” (7) for any error condition. 0: There was no bus error. 1: There was a timeout. 2: A bad address was accessed. 3: There was an alignment error. 4: An access of unsupported size was requested. 7: Other. |
R/W1C | 0 |
[sbasize] |sbasize| | Width of system bus addresses in bits. (0 indicates there is no bus access support.) | R | Preset |
[sbaccess128] |sbaccess128| | 1 when 128-bit system bus accesses are supported. | R | Preset |
[sbaccess64] |sbaccess64| | 1 when 64-bit system bus accesses are supported. | R | Preset |
[sbaccess32] |sbaccess32| | 1 when 32-bit system bus accesses are supported. | R | Preset |
[sbaccess16] |sbaccess16| | 1 when 16-bit system bus accesses are supported. | R | Preset |
[sbaccess8] |sbaccess8| | 1 when 8-bit system bus accesses are supported. | R | Preset |
System Bus Address 31:0 (sbaddress0
, at 0x39)
[sbaddress0]
If sbasize
is 0, then this register is not present.
When the system bus master is busy, writes to this register will set
sbbusyerror
and don’t do anything else.
If sberror
is 0, sbbusyerror
is 0, and sbreadonaddr
is set then writes to this register start the following:
Set sbbusy
.
Perform a bus read from the new value of sbaddress
.
If the read succeeded and sbautoincrement
is set, increment
sbaddress
.
Clear sbbusy
.
Field | Description | Access | Reset |
---|---|---|---|
[address] |address| | Accesses bits 31:0 of the physical address in sbaddress . |
R/W | 0 |
System Bus Address 63:32 (sbaddress1
, at 0x3a)
[sbaddress1]
If sbasize
is less than 33, then this register is not present.
When the system bus master is busy, writes to this register will set
sbbusyerror
and don’t do anything else.
Field | Description | Access | Reset |
---|---|---|---|
[address] |address| | Accesses bits 63:32 of the physical address in sbaddress (if
the system address bus is that wide). |
R/W | 0 |
System Bus Address 95:64 (sbaddress2
, at 0x3b)
[sbaddress2]
If sbasize
is less than 65, then this register is not present.
When the system bus master is busy, writes to this register will set
sbbusyerror
and don’t do anything else.
Field | Description | Access | Reset |
---|---|---|---|
[address] |address| | Accesses bits 95:64 of the physical address in sbaddress (if
the system address bus is that wide). |
R/W | 0 |
System Bus Address 127:96 (sbaddress3
, at 0x37)
[sbaddress3]
If sbasize
is less than 97, then this register is not present.
When the system bus master is busy, writes to this register will set
sbbusyerror
and don’t do anything else.
Field | Description | Access | Reset |
---|---|---|---|
[address] |address| | Accesses bits 127:96 of the physical address in sbaddress (if
the system address bus is that wide). |
R/W | 0 |
System Bus Data 31:0 (sbdata0
, at 0x3c)
[sbdata0]
If all of the sbaccess
bits in sbcs
are 0, then this register
is not present.
Any successful system bus read updates sbdata
. If the width of
the read access is less than the width of sbdata
, the contents of
the remaining high bits may take on any value.
If sberror
or sbbusyerror
both aren’t 0 then accesses do nothing.
If the bus master is busy then accesses set sbbusyerror
, and don’t do
anything else.
Writes to this register start the following:
Set sbbusy
.
Perform a bus write of the new value of sbdata
to sbaddress
.
If the write succeeded and sbautoincrement
is set,
increment sbaddress
.
Clear sbbusy
.
Reads from this register start the following:
“Return” the data.
Set sbbusy
.
If sbreadondata
is set, perform a system bus read from the
address contained in sbaddress
, placing the result in sbdata
.
If sbautoincrement
is set, increment sbaddress
.
Clear sbbusy
.
Only sbdata0
has this behavior. The other sbdata
registers
have no side effects. On systems that have buses wider than 32 bits, a
debugger should access sbdata0
after accessing the other sbdata
registers.
Field | Description | Access | Reset |
---|---|---|---|
[data] |data| | Accesses bits 31:0 of sbdata . |
R/W | 0 |
System Bus Data 63:32 (sbdata1
, at 0x3d)
[sbdata1]
If sbaccess64
and sbaccess128
are 0, then this
register is not present.
If the bus master is busy then accesses set sbbusyerror
, and don’t do
anything else.
Field | Description | Access | Reset |
---|---|---|---|
[data] |data| | Accesses bits 63:32 of sbdata (if the system bus is that
wide). |
R/W | 0 |
System Bus Data 95:64 (sbdata2
, at 0x3e)
[sbdata2]
This register only exists if sbaccess128
is 1.
If the bus master is busy then accesses set sbbusyerror
, and don’t do
anything else.
Field | Description | Access | Reset |
---|---|---|---|
[data] |data| | Accesses bits 95:64 of sbdata (if the system bus is that
wide). |
R/W | 0 |
System Bus Data 127:96 (sbdata3
, at 0x3f)
[sbdata3]
This register only exists if sbaccess128
is 1.
If the bus master is busy then accesses set sbbusyerror
, and don’t do
anything else.
Field | Description | Access | Reset |
---|---|---|---|
[data] |data| | Accesses bits 127:96 of sbdata (if the system bus is that
wide). |
R/W | 0 |
There are separate
setresethaltreq
andclrresethaltreq
bits so that it is possible to writedmcontrol
without changing the halt-on-reset request bit for each selected hart, when not all selected harts have the same configuration.