10. Debug Support¶
The VeeR EL2 core conforms to the “RISC-V Debug Specification 0.13.2, with JTAG DTM” document [3]. This chapter provides a description of the implemented debug-related control and status register definitions. For a RISC-V debug overview and detailed feature descriptions, refer to corresponding sections in [3].
10.1. Control/Status Registers¶
The RISC-V Debug architecture defines three separate address spaces: JTAG, Debug Module Interface, and RISC-V CSR. The registers associated with these three address spaces are described in the following sections:
10.1.1. Control/Status Registers in JTAG Address Space¶
Table 10.1 summarizes the control/status registers in the JTAG Debug Transport Module address space.
Addresses shown below are in the 5-bit JTAG address space. A control/status register is addressed by setting the 5bit JTAG IR register.
Note
The core complex clock (clk
) frequency must be at least twice the JTAG clock (jtag_tck
) frequency for the JTAG data to pass correctly through the clock domain crossing synchronizers.
JTAG DTM Address |
Name |
Description |
Section |
---|---|---|---|
0x01 |
IDCODE |
TAG IDCODE |
|
0x10 |
dtmcs |
DTM control and status |
|
0x11 |
dmi |
Debug module interface access |
|
0x1F |
BYPASS |
JTAG BYPASS |
10.1.1.1. IDCODE Register (IDCODE)¶
The IDCODE
register is a standard JTAG register.
It is selected in the JTAG TAP controller’s IR register when the TAP state machine is reset.
The IDCODE
register’s definition is exactly as defined in IEEE Std 1149.1-2013.
This register is read-only.
This register is mapped to the 5-bit JTAG address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
version |
31:28 |
Identifies release version of this part |
R |
(see Complex Port List) |
partnum |
27:12 |
Identifies designer’s part number of this part |
R |
(see Complex Port List) |
manufid |
11:1 |
Identifies designer/manufacturer of this part |
R |
(see Complex Port List) |
1 |
0 |
Must be ‘1’ |
R |
1 |
10.1.1.2. DTM Control and Status Register (dtmcs)¶
The dtmcs
register controls and provides status of the Debug Transport Module (DTM).
This register is mapped to the 5-bit JTAG address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
Reserved |
31:18 |
Reserved |
R |
0 |
dmihardreset |
17 |
Not implemented Note: Hard reset of DTM not required in VeeR EL2 because DMI accesses always succeed. Writes to this bit ignored. |
R |
0 |
dmireset |
16 |
Not implemented Note: Reset of DTM’s error state not required in VeeR EL2 because DMI accesses always succeed. Writes to this bit ignored. |
R |
0 |
Reserved |
15 |
Reserved |
R |
0 |
idle |
14:12 |
Hint to debugger of minimum number of cycles debugger should spend in Run-Test/Idle after every DMI scan to avoid a ‘busy’ return code (dmistat of 3). Debugger must still check dmistat when necessary:
Other values not implemented. |
R |
0 |
dmistat |
11:10 |
DMI status:
|
R |
0 |
abits |
9:4 |
Size of address field in |
R |
7 |
version |
3:0 |
Conforming to RISC-V Debug specification Version 0.13.2 |
R |
1 |
10.1.1.3. Debug Module Interface Access Register (dmi)¶
The dmi register allows access to the Debug Module Interface (DMI). In the JTAG TAP controller’s Update-DR state, the DTM starts the operation specified in the op field. In the JTAG TAP controller’s Capture-DR state, the DTM updates the data field with the result from that operation.
Note
No status is reported in the op field. Therefore, debuggers should refrain from batching together multiple scans.
This register is mapped to the 5-bit JTAG address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
address |
40:34 |
Address used for DMI access. In Update-DR, value used to access DM over DMI. |
R/W |
0 |
data |
33:2 |
Data to send to DM over DMI during Update-DR, and data returned from DM as result of previous operation. |
R/W |
0 |
op |
1:0 |
For write:
For read:
|
R/W |
0 |
10.1.1.4. BYPASS Register (BYPASS)¶
The BYPASS register is a standard JTAG register. It is implemented as a 1-bit register which has no functional effect, except adding a 1-bit delay. It allows a debugger to not communicate with this TAP (i.e., bypass it).
Note
All unused addresses in the 5-bit JTAG address space (i.e., all addresses except 0x01 (IDCODE
), 0x10 (dtmcs
), and 0x11 (dmi
)) select the BYPASS register as well.
This register is mapped to the 5-bit JTAG address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
bypass |
0 |
Bypass |
- |
0 |
10.1.2. Control/Status Registers in Debug Module Interface Address Space¶
Table 10.6 Summarizes The Control/Status Registers In The Debug Module Interface Address Space.
Registers in the Debug Module Interface address space are accessed through the dmi
register in the JTAG address space (see Debug Module Interface Access Register (dmi)).
The address field of the dmi
register selects the Debug Module Interface register to be accessed, the data field either provides the value to be written to the selected register or captures that register’s value, and the op field selects the operation to be performed.
Addresses shown below are offsets relative to the Debug Module base address. VeeR EL2 supports a single Debug Module with a base address of 0x00.
DMI Address |
Name |
Description |
Section |
---|---|---|---|
0x04 |
data0 |
Abstract data 0 |
|
0x05 |
data1 |
Abstract data 1 |
|
0x10 |
dmcontrol |
Debug module control |
|
0x11 |
dmstatus |
Debug module status |
|
0x16 |
abstractcs |
Abstract control and status |
|
0x17 |
command |
Abstract command |
|
0x18 |
abstractauto |
Abstract command autoexec |
|
0x38 |
sbcs |
System bus access control and status |
|
0x39 |
sbaddress0 |
System bus address 31:0 |
|
0x3C |
sbdata0 |
System bus data 31:0 |
|
0x3D |
sbdata1 |
System bus data 63:32 |
|
0x40 |
haltsum0 |
Halt summary 0 |
Note
ICCM, DCCM, and PIC memory ranges are only accessible using the access memory abstract command.
10.1.3. Debug Module Control Register (dmcontrol)¶
The dmcontrol
register controls the overall Debug Module as well as the hart.
Note
On any given write, a debugger may only write ‘1’ to either the resumereq or ackhavereset bit. The other bit must be written to ‘0’.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
haltreq |
31 |
Halt request:
|
R0/W |
0 |
resumereq |
30 |
Resume request:
Note: Also clears resume ack bit for hart. Note: Setting resumereq bit is ignored if haltreq bit is set. |
R0/W1 |
0 |
hartreset |
29 |
Not implemented (i.e., 0: Deasserted) |
R |
0 |
ackhavereset |
28 |
Reset core-internal, sticky
|
R0/W1 |
0 |
Reserved |
27 |
Reserved |
R |
0 |
hasel |
26 |
Selects definition of currently selected harts:
|
R |
0 |
hartsello |
25:16 |
Not implemented (VeeR EL2 is single-thread) |
R |
0 |
hartselhi |
15:6 |
Not implemented (VeeR EL2 is single-thread) |
R |
0 |
Reserved |
5:4 |
Reserved |
R |
0 |
setresethaltreq |
3 |
Not implemented Note: hasresethaltreq bit in |
R |
0 |
clrresethaltreq |
2 |
Not implemented Note: hasresethaltreq bit in |
R |
0 |
ndmreset |
1 |
Controls reset signal from DM to VeeR EL2 core. Signal resets hart, but not DM. To perform a reset, debugger writes ‘1’, and then writes ‘0’ to deassert reset. |
R/W |
0 |
dmactive |
0 |
Reset signal for Debug Module (DM):
|
R/W |
0 |
10.1.3.1. Debug Module Status Register (dmstatus)¶
The dmstatus
register reports status for the overall Debug Module as well as the hart.
This register is read-only.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
Reserved |
31:23 |
Reserved |
R |
0 |
impebreak |
22 |
Not implemented Note: VeeR EL2 does not implement a Program Buffer. |
R |
0 |
Reserved |
21:20 |
Reserved |
R |
0 |
allhavereset |
19 |
‘1’ when hart has been reset and reset has not been acknowledged |
R |
- |
anyhavereset |
18 |
‘1’ when hart has been reset and reset has not been acknowledged |
R |
- |
allresumeack |
17 |
‘1’ when hart has acknowledged last resume request |
R |
- |
anyresumeack |
16 |
‘1’ when hart has acknowledged last resume request |
R |
- |
allnonexistent |
15 |
Not implemented (VeeR EL2 is single-thread) |
R |
0 |
anynonexistent |
14 |
Not implemented (VeeR EL2 is single-thread) |
R |
0 |
allunavail |
13 |
‘1’ when hart is unavailable [1] |
R |
- |
anyunavail |
12 |
‘1’ when hart is unavailable [1] |
R |
- |
allrunning |
11 |
‘1’ when hart is running |
R |
- |
anyrunning |
10 |
‘1’ when hart is running |
R |
- |
allhalted |
9 |
‘1’ when hart is halted |
R |
- |
anyhalted |
8 |
‘1’ when hart is halted |
R |
- |
authenticated |
7 |
Not implemented (i.e., 1: Always authenticated) |
R |
1 |
authbusy |
6 |
Not implemented (i.e., 0: Authentication module never busy) |
R |
0 |
hasresethaltreq |
5 |
Not implemented Note: VeeR EL2 implements halt-on-reset with haltreq set out of reset method. |
R |
0 |
confstrptrvalid |
4 |
Not implemented Note: VeeR EL2 does not provide information relevant to configuration string. |
R |
0 |
version |
3:0 |
Debug Module present, conforming to RISC-V Debug specification Version 0.13.2 |
R |
2 |
10.1.3.2. Halt Summary 0 Register (haltsum0)¶
Each bit in the haltsum0
register indicates whether a specific hart is halted or not.
Since VeeR EL2 is singlethreaded, only one bit is implemented.
Note
Unavailable/nonexistent harts are not considered to be halted.
This register is read-only.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
Reserved |
31:1 |
Reserved |
R |
0 |
halted |
0 |
‘1’ when hart halted |
R |
0 |
10.1.3.3. Abstract Control and Status Register (abstractcs)¶
The abstractcs
register provides status information of the abstract command interface and enables clearing of detected command errors.
Note
Writing this register while an abstract command is executing causes its cmderr field to be set to ‘1’ (i.e., ‘busy’), if it is ‘0’.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
Reserved |
31:29 |
Reserved |
R |
0 |
progbufsize |
28:24 |
Not implemented Note: VeeR EL2 does not implement a Program Buffer. |
R |
0 |
Reserved |
23:13 |
Reserved |
R |
0 |
busy |
12 |
Abstract command interface activity:
Note: ‘Busy’ indication set when command register (see Abstract Command Register (command)) is written, cleared after command has completed. |
R |
0 |
Reserved |
11 |
Reserved |
R |
0 |
cmderr |
10:8 |
Set if abstract command fails. Reason for failure:
Note: Bits in this field remain set until cleared by writing ‘111’. Note: Next abstract command not started until value is reset to ‘0’. Note: Only contains valid value if busy is ‘0’. |
R/W1C |
0 |
Reserved |
7:4 |
Reserved |
R |
0 |
datacount |
3:0 |
2 data registers implemented as part of abstract command interface |
R |
2 |
10.1.4. Abstract Command Register (command)¶
Writes to the command register cause
the corresponding abstract command to be executed.
Writing this register while an abstract command is executing causes the cmderr field in the abstractcs register (see Abstract Control and Status Register (abstractcs)) to be set to ‘1’ (i.e., ‘busy’), if it is ‘0’. If the cmderr field is non-zero, writes to the command register are ignored.
Note
A non-zero cmderr field inhibits starting a new abstract command to accommodate debuggers which, for performance reasons, may send several commands to be executed in a row without checking the cmderr field in between. Checking the cmderr field only at the end of a sequence of commands is safe because later commands which might depend on a previous, but failed command are not executed.
Note
Access register and access memory abstract commands may only be executed when the core is in the debug halt (db-halt) state. If the debugger is requesting the execution of an abstract command while the core is not in the debug halt state, the command is aborted and the cmderr field is set to ‘4’ (i.e., ‘halt/resume’), if it is ‘0’.
Note
The access memory abstract command method provides access to ICCM, DCCM, and PIC memory ranges as well as to SoC memories.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
cmdtype |
31:24 |
Abstract command type:
Note: Other values not implemented or reserved for future use. Writing this field to value different than ‘0’ or ‘2’ causes abstract command to fail and cmderr field of |
R0/W |
0 |
Access Register Command |
||||
Reserved |
23 |
Reserved |
R |
0 |
aarsize |
22:20 |
Register access size:
Note: Other size values not implemented. Writing this field to value different than ‘2’ causes abstract command to fail and cmderr field of |
R/W |
2 |
aarpostincrement |
19 |
Access register post-increment control:
|
R/W |
0 |
postexec |
18 |
Not implemented (i.e., 0: No effect) Note: Writing to ‘1’ causes abstract command to fail and cmderr field of |
R |
0 |
transfer |
17 |
Transfer:
|
R |
1 |
write |
16 |
Read or write register:
|
R0/W |
0 |
regno |
15:0 |
Register access:
Note: Selecting illegal register address causes abstract command to fail and cmderr field of |
R0/W |
0 |
Access Memory Command (ICCM, DCCM, PIC, and SoC Memories) |
||||
aamvirtual |
23 |
Not implemented (i.e., 0: Addresses are physical) Note: VeeR EL2 supports physical addresses only. Since physical and virtual address are identical, no error is flagged [2] even if written to ‘1’. |
R |
0 |
aamsize |
22:20 |
Memory access size:
Note: Writing this field to value ‘0’ or ‘1’ for ICCM or PIC memory access causes abstract command to fail and cmderr field of Note: Other size values not implemented. Writing this field to value higher than ‘2’ causes abstract command to fail and cmderr field of |
R/W |
2 |
aampostincrement |
19 |
Access memory post-increment control:
|
R/W |
0 |
Reserved |
18:17 |
Reserved |
R |
0 |
write |
16 |
Read or write memory location:
|
R0/W |
0 |
target-specific |
15:14 |
Not implemented Note: VeeR EL2 does not use target-specific bits. |
R |
0 |
Reserved |
13:0 |
Reserved |
R |
0 |
10.1.4.1. Abstract Command Autoexec Register (abstractauto)¶
The abstractauto
register controls if reading or writing the data0/1
registers (see Abstract Data 0 / 1 Registers (data0/1)) automatically triggers the next execution of the abstract command in the command
register (see Abstract Command Register (command)).
This feature allows more efficient burst accesses.
Writing this register while an abstract command is executing causes the cmderr field in the abstractcs register (see Abstract Control and Status Register (abstractcs)) to be set to ‘1’ (i.e., ‘busy’), if it is ‘0’.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
Reserved |
31:2 |
Reserved |
R |
0 |
autoexecdata1 |
1 |
Auto-execution control for
|
R/W |
0 |
autoexecdata0 |
0 |
Auto-execution control for
|
R/W |
0 |
10.1.5. Abstract Data 0 / 1 Registers (data0/1)¶
The data0/1
registers are basic read/write registers which may be read or changed by abstract commands.
Note
The datacount field of the abstractcs
register (see Table 10.10) indicates that 2 (out of possible 12) registers are implemented in VeeR EL2.
The data0
register sources the value for and provides the return value of an abstract command.
The data1
register provides the address for an access memory abstract command.
Note
Selecting an address outside of the ICCM, DCCM, or PIC memory range but in one of the core-internal memory regions causes the abstract command to fail and the cmderr field of the abstractcs
register to be set to ‘3’. Similarly, selecting an unmapped SoC memory address causes the abstract command to fail, provided the SoC responds with a bus error, and the cmderr field of the abstractcs
register to be set to ‘5’.
Accessing these registers while an abstract command is executing causes the cmderr field of the abstractcs
register (see Table 10.10) to be set to ‘1’ (i.e., ‘busy’), if it was ‘0’.
Attempts to write the data0/1
registers while the busy bit of the abstractcs register (see Table 10.10) is set does not change their value.
The values in these registers may not be preserved after an abstract command has been executed. The only guarantees on their contents are the ones offered by the executed abstract command. If the abstract command fails, no assumptions should be made about the contents of these registers.
These registers are mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
data |
31:0 |
Abstract command data:
|
R/W |
0 |
10.1.5.1. System Bus Access Control and Status Register (sbcs)¶
The sbcs
register provides controls and status information of the system bus access interface.
Note
The system bus access method provides access to SoC memories only. Access to ICCM, DCCM, and PIC memory ranges is only available using the access memory abstract command method.
Note
The operation of the system bus access method does not depend on the core’s state. SoC memory locations may be accessed using this method even when the core is running.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
sbversion |
31:29 |
System Bus interface conforms to RISC-V Debug specification, Version 0.13.2 |
R |
1 |
Reserved |
28:23 |
Reserved |
R |
0 |
sbbusyerror |
22 |
Set when debugger attempts to read data while a read is in progress, or when debugger initiates a new access while one is still in progress (i.e., while sbbusy bit is set). Remains set until explicitly cleared by debugger. Note: When set, Debug Module cannot initiate more system bus accesses. |
R/W1C |
0 |
sbbusy |
21 |
System bus master interface status:
Note: Writes to this register while sbbusy bit is set result in undefined behavior. Debugger must not write this register until it reads sbbusy bit as ‘0’. Note: Bit reflects if system bus master interface is busy, not status of system bus itself. |
R |
0 |
sbreadonaddr |
20 |
Auto-read on address write:
|
R/W |
0 |
sbaccess |
19:17 |
Access size for system bus access:
Note: Other values not supported. No access performed, sberror field set to ‘4’. |
R/W |
2 |
sbautoincrement |
16 |
Auto-address increment:
|
R/W |
0 |
sbreadondata |
15 |
Auto-read on data read:
|
R/W |
0 |
sberror |
14:12 |
Set when Debug Module’s system bus master encounters an error: While this field is non-zero, no more system bus accesses can be initiated by the Debug Module.
Note: Bits in this field remain set until cleared by writing ‘111’. Note: Debug Module may not initiate next system bus access until value is reset to ‘0’. |
R/W1C |
0 |
sbasize |
11:5 |
Width of system bus addresses (in bits) |
R |
32 |
sbaccess128 |
4 |
128-bit system bus accesses not supported |
R |
0 |
sbaccess64 |
3 |
64-bit system bus accesses supported |
R |
1 |
sbaccess32 |
2 |
32-bit system bus accesses supported |
R |
1 |
sbaccess16 |
1 |
16-bit system bus accesses supported |
R |
1 |
sbaccess8 |
0 |
8-bit system bus accesses supported |
R |
1 |
10.1.5.2. System Bus Address 31:0 Register (sbaddress0)¶
The sbaddress0
register provides the address of the system bus access.
If the sbreadonaddr bit of the sbcs
register is ‘1’, writing the sbaddress0
register triggers a system bus read access from the new address.
Note
The sberror and sbbusyerror fields of the sbcs
register must both be ‘0’ for a system bus read operation to be performed.
Note
If the system bus master interface is busy (i.e., sbbusy bit of the sbcs
register is ‘1’) when a write access to this register is performed, the sbbusyerror bit in the sbcs
register is set and the access is aborted.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
address |
31:0 |
System bus address |
R/W |
0 |
10.1.5.3. System Bus Data 31:0 Register (sbdata0)¶
The sbdata0
register holds the right-justified lower bits for system bus read and write accesses.
A successful system bus read updates the sbdata0/1
registers with the value read from the system bus at the memory location addressed by the sbaddress0 register.
If the width of the read access is less than 64 bits, the remaining high bits may take on any value.
Reading the sbdata0
register provides the current value of this register.
If the sbreadondata bit of the sbcs register is ‘1’, reading this register also triggers a system bus read access which updates the sbdata0/1
registers with the value read from the memory location addressed by the sbaddress0
register.
Writing the sbdata0
register triggers a system bus write access which updates the memory location addressed by the sbaddress0
register with the new values in the sbdata0/1
registers.
Note
Only the sbdata0
register has this behavior. Accessing the sbdata1
register has no side effects.
A debugger must access the sbdata1
register first, before accessing the sbdata0 register.
Note
The sberror and sbbusyerror fields of the sbcs
register must both be ‘0’ for a system bus read or write operation to be performed.
Note
If the system bus master interface is busy (i.e., sbbusy bit of the sbcs register is ‘1’) when a read or write access to this register is performed, the sbbusyerror bit in the sbcs
register is set and the access is aborted.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
data |
31:0 |
System bus data[31:0] for system bus read and write accesses |
R/W |
0 |
10.1.5.4. System Bus Data 63:32 Register (sbdata1)¶
The sbdata1
register holds the upper 32 bits of the 64-bit wide system bus for read and write accesses.
Note
If the system bus master interface is busy (i.e., sbbusy bit of the sbcs register is ‘1’) when a read or write access to this register is performed, the sbbusyerror bit in the sbcs
register is set and the access is aborted.
This register is mapped to the Debug Module Interface address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
data |
31:0 |
System bus data[63:32] for system bus read and write accesses |
R/W |
0 |
10.1.6. Control/Status Registers in RISC-V CSR Address Space¶
A summary of standard RISC-V control/status registers with platform-specific adaptations in CSR space:
All reserved and unused bits in these control/status registers must be hardwired to ‘0’. Unless otherwise noted, all read/write control/status registers must have WARL (Write Any value, Read Legal value) behavior.
10.1.6.1. Trigger Select Register (tselect)¶
Note
Since triggers can be used both by Debug Mode and M-mode, the debugger must restore this register if it modified it.
This register is mapped to the standard read/write CSR address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
Reserved |
31:2 |
Reserved |
R |
0 |
index |
1:0 |
Index of trigger 0..3 Note: Triggers 0 and 2 may be chained, triggers 1 and 3 not. |
R/W |
0 |
10.1.6.2. Trigger Data 1 Register (tdata1)¶
This register is mapped to the standard read/write CSR address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
type |
31:28 |
See Table 10.20 below. |
R |
2 |
dmode |
27 |
See Table 10.20 below. |
See Table 10.20 below. |
See Table 10.20 below. |
data |
26:0 |
See Table 10.20 below. |
See Table 10.20 below. |
See Table 10.20 below. |
10.1.6.3. Match Control Register (mcontrol)¶
Note
VeeR EL2 does not support triggering on the data of a load or on the opcode of an executed instruction.
This register is mapped to the standard read/write CSR address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
type |
31:28 |
Address/data match trigger (= mcontrol) |
R |
2 |
dmode |
27 |
Mode write privileges to
Note: Only writable from Debug Mode. |
R/W |
0 |
maskmax |
26:21 |
\(2^{31}\) bytes is largest naturally aligned powers-of-two (NAPOT) range supported by hardware when match field is ‘1’. |
R |
31 |
hit |
20 |
Set by hardware when this trigger matches. Allows to determine which trigger(s) matched. May be set or cleared by trigger’s user at any time. Note: For chained triggers, hit bit of a matching second trigger is not set unless first trigger matches as well. |
R/W |
0 |
select |
19 |
Match selection: 0: Perform match on address 1: Perform match on store data value |
R/W |
0 |
timing |
18 |
Action for this trigger is taken just before instruction that triggered it is committed, but after all preceding instructions are committed. Note: No bus transaction is issued for an execute address trigger hit on a load to a side-effect address. |
R |
0 |
sizelo |
17:16 |
Match size:
|
R |
0 |
action |
15:12 |
Action to take when trigger fires:
Note: Other values reserved for future use. Note: Triggers do not fire if this field is ‘0’ and interrupts are disabled [3] (i.e., mie bit of |
R/W |
0 |
chain |
11 |
Trigger chaining:
Note: Supported for triggers 0 and 2 only, attempts to set this bit for triggers 1 and 3 are ignored. Note: In VeeR EL2, only pairs of triggers (i.e., triggers 0/1 and triggers 2/3) are chainable. Note: If chain bit of trigger 0/2 is ‘1’, it is chained to trigger 1/3. Only action field of trigger 1/3 is used (i.e., action field of trigger 0/2 is ignored). The action on second trigger is taken if and only if both triggers in chain match at the same time. Note: Because the chain bit affects the next trigger, hardware resets it to ‘0’ for |
R/W (for triggers 0 and 2) R (for triggers 1 and 3) |
0 |
match |
10:7 |
Match control:
Note: Other values not implemented or reserved for future use. |
R/W |
0 |
m |
6 |
When set, enable this trigger in M-mode |
R/W |
0 |
Reserved |
5 |
Reserved |
R |
0 |
s |
4 |
Not implemented |
R |
0 |
u |
3 |
Not implemented |
R |
0 |
execute |
2 |
When set, trigger fires on address of executed instruction Note: For writes, written to ‘0’ if select bit is written to ‘1’. |
R/W |
0 |
store |
1 |
When set, trigger fires on address or data of store |
R/W |
0 |
load |
0 |
When set, trigger fires on address of load Note: For writes, written to ‘0’ if select bit is written to ‘1’. |
R/W |
0 |
10.1.6.4. Trigger Data 2 Register (tdata2)¶
This register is mapped to the standard read/write CSR address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
value |
31:0 |
Match value:
|
R/W |
0 |
10.1.6.5. Debug Control and Status Register (dcsr)¶
The dcsr
register controls the behavior and provides status of the hart in Debug Mode.
The RISC-V Debug specification [3], Section 4.8.1 documents some required and several optional features. Table 10.22 describes the required features, the partial support of optional features in VeeR EL2, and indicates features not supported with “Not implemented”.
Note
This register is accessible in Debug Mode only. Attempting to access this register in machine mode raises an illegal instruction exception.
This register is mapped to the standard read/write CSR address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
xdebugver |
31:28 |
External debug support exists as described in this chapter and [3] |
R |
4 |
Reserved |
27:16 |
Reserved |
R |
0 |
ebreakm |
15 |
|
R/W |
0 |
Reserved |
14 |
Reserved |
R |
0 |
ebreaks |
13 |
Not implemented |
R |
0 |
ebreaku |
12 |
Not implemented |
R |
0 |
stepie |
11 |
|
R/W |
0 |
stopcount |
10 |
|
R/W |
0 |
stoptime |
9 |
Increment timers same as in non-debug mode |
R |
0 |
cause |
8:6 |
Reason for Debug Mode entry (if multiple reasons in single cycle, set cause to highest priority):
|
R |
0 |
Reserved |
5 |
Reserved |
R |
0 |
mprven |
4 |
Not implemented (i.e., 0: mprv field in |
R |
0 |
nmip |
3 |
Non-Maskable Interrupt (NMI) pending for hart when set Note: NMI may indicate a hardware error condition, reliable debugging may no longer be possible once bit is set. |
R |
0 |
step |
2 |
When set and not in Debug Mode, hart only executes single instruction and enters Debug Mode. If instruction does not complete due to exception, hart immediately enters Debug Mode before executing trap handler, with appropriate exception registers set. Note: Debugger must not change value while hart is running. |
R/W |
0 |
prv |
1:0 |
Indicates privilege level hart was operating in when Debug Mode was entered (3 = M-mode) |
R |
3 |
10.1.6.6. Debug PC Register (dpc)¶
The dpc
register provides the debugger information about the program counter (PC) when entering Debug Mode and control where to resume (RISC-V Debug specification [3], Section 4.8.2).
Upon entry to Debug Mode, the dpc
register is updated with the address of the next instruction to be executed.
The behavior is described in more detail in Table 10.23 below.
When resuming, the hart’s PC is updated to the address stored in the dpc register. A debugger may write the dpc
register to change where the hart resumes.
Note
This register is accessible in Debug Mode only. Attempting to access this register in machine mode raises an illegal instruction exception.
This register is mapped to the standard read/write CSR address space.
Field |
Bits |
Description |
Access |
Reset |
---|---|---|---|---|
dpc |
31:0 |
Address captured for:
Single step:
Trigger module: If timing (see timing bit in
Halt request:
|
R/W |
0 |