Table 105:
NAPOT Size Encoding
a…a01111
32-byte NAPOT range
…
…
a01…1111
2
31
-byte NAPOT range
The
maskmax
field is a 6-bit read-only field that specifies the largest supported NAPOT range.
The value is the logarithm base 2 of the number of bytes in the largest supported NAPOT range.
A value of 0 indicates that only exact address matches are supported (1-byte range). A value of
31 corresponds to the maximum NAPOT range, which is 2
31
bytes in size. The largest range is
encoded in
maddress
with the 30 least-significant bits set to 1, bit 30 set to 0, and bit 31 holding
the only address bit considered in the address comparison.
To provide breakpoints on an exact range, two neighboring breakpoints can be combined with
the
chain
bit. The first breakpoint can be set to match on an address using
action
of 2 (greater
than or equal). The second breakpoint can be set to match on address using
action of 3
(less
than). Setting the
chain
bit on the first breakpoint prevents the second breakpoint from firing
unless they both match.
Breakpoint Match Address Register (
Each breakpoint match address register is an XLEN-bit read/write register used to hold signifi-
cant address bits for address matching and also the unary-encoded address masking informa-
tion for NAPOT ranges.
Breakpoint traps are taken precisely. Implementations that emulate misaligned accesses in soft-
ware will generate a breakpoint trap when either half of the emulated access falls within the
address range. Implementations that support misaligned accesses in hardware must trap if any
byte of an access falls within the matching range.
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.
Chapter 21 Debug
FE310-G003 Manual
© SiFive, Inc.
Page 115
Содержание FE310-G003
Страница 1: ...SiFive FE310 G003 Manual v1p1 SiFive Inc ...