Debug-mode breakpoint traps jump to the debug trap vector without altering machine-mode reg-
isters.
Machine-mode breakpoint traps jump to the exception vector with "Breakpoint" set in the
mcause
register and with
badaddr
holding the instruction or data address that caused the trap.
Sharing Breakpoints Between Debug and Machine Mode
When debug mode uses a breakpoint register, it is no longer visible to machine mode (that is,
the
tdrtype
will be 0). Typically, a debugger will leave the breakpoints alone until it needs them,
either because a user explicitly requested one or because the user is debugging code in ROM.
This section describes the debug module’s memory map when accessed via the regular system
interconnect. The debug module is only accessible to debug code running in debug mode on a
hart (or via a debug transport module).
Debug RAM and Program Buffer (
The E31 Core Complex has 16 32-bit words of program buffer for the debugger to direct a hart
to execute arbitrary RISC-V code. Its location in memory can be determined by executing
aiupc
instructions and storing the result into the program buffer.
The E31 Core Complex has one 32-bit words of debug data RAM. Its location can be deter-
mined by reading the
DMHARTINFO
register as described in the RISC-V Debug Specification.
This RAM space is used to pass data for the Access Register abstract command described in
the RISC-V Debug Specification. The E31 Core Complex supports only general-purpose regis-
ter access when harts are halted. All other commands must be implemented by executing from
the debug program buffer.
In the E31 Core Complex, both the program buffer and debug data RAM are general-purpose
RAM and are mapped contiguously in the Core Complex memory space. Therefore, additional
data can be passed in the program buffer, and additional instructions can be stored in the debug
data RAM.
Debuggers must not execute program buffer programs that access any debug module memory
except defined program buffer and debug data addresses.
The E31 Core Complex does not implement the
DMSTATUS.anyhavereset
or
DMSTATUS.allhavereset
bits.
This ROM region holds the debug routines on SiFive systems. The actual total size may vary
between implementations.
Copyright © 2017–2018, SiFive Inc. All rights reserved.
35