![](http://datasheet.mmic.net.cn/230000/79RC32438-200BB_datasheet_15568909/79RC32438-200BB_518.png)
IDT EJTAG System
Hardware Breakpoints
79RC32438 User Reference Manual
20 - 52
November 4, 2002
Notes
Number of Instruction Breakpoints Without Single Stepping
If hardware single stepping is not implemented, then at least two instruction breakpoints are required.
Four instruction hardware breakpoints are recommended.
Data Breakpoints with Data Value Compares
Data breakpoints should be implemented with data value compares. Also, data value compares should
be implemented even if it is not possible to break on loads with precise data value compares. For more
information on precise exceptions, refer to section “Precise / Imprecise Debug Exceptions on Data Break-
points with Data Value Compares” on page 20-52.
Data Breakpoint Compare on Invalid Data
Data breakpoints should only compare on valid data, meaning they only generate debug exceptions
based on valid data in the compare. This does also apply to compare on store data for a store to an
unaligned address. For example, no debug exception should be generated for a bus error on a load that
has a pending data breakpoint to compare on the data returned by the load. However, in some cases, the
indication of invalid data is late relative to the data, for example, for a cache error as a result of a complex
error detection. In this case, data breakpoints can indicate a debug exception because the data was
believed to be valid at the time of the compare, and the pending error is then indicated to the debug handler
through the DBusEP or CacheEP bit in the Debug register, because the error occurred after the debug
exception. Note that for bus errors due to external events, the bus error indication usually is available when
the compare in the data breakpoint would take place. Thus, it is possible to avoid a debug exception.
Precise / Imprecise Debug Exceptions on Data Breakpoints with Data Value Compares
Data breakpoints are recommended to generate precise debug exceptions, if possible in the implemen-
tation. Thus the DEPC register and DBD bit in the Debug register point to the load/store that caused the
debug exception to occur. This instruction can then be re-executed when execution resumes after the
debug handler. However, data breakpoints are allowed to cause imprecise debug exceptions when the
breakpoint is set up with data value compares; for example, if data breakpoints with compares on loaded
data values cannot be made precise due to a non-blocking load. In this case, the DEPC register and DBD
bit in the Debug register point to an instruction in the execution flow after the load/store that caused the
imprecise debug exception. The BS bit can be updated when the match is detected, even though a debug
exception is not taken until later due to internal stalls (for example, a nulled instruction in the pipeline at the
time the match is detected). It is implementation specific as to which cases a data breakpoint can cause an
imprecise debug exception. It is recommended that the data breakpoints cause imprecise matches in as
few cases as possible.
Implementations can require imprecise debug exceptions from data breakpoints on loads with value
compares in a specific address range, if re-execution of a load in this range is not acceptable. This case is
possible if the load has side effects such as removing an entry on a queue. Imprecise debug exceptions for
value compares ensure that the destination register is properly updated with the loaded value, whereby re-
execution of the load is avoided.
Breakpoint Examples
Instruction Breakpoint Examples
This section provides examples that illustrate using an instruction break.
Instruction Break in Small Range of Instructions with ASID
This example shows how to set up an instruction breakpoint to break on the fetch of any one of the four
instructions in the virtual address range shown below:
0x0000 0010
J L1
// ASID = 0x5
0x0000 0014
NOP
0x0000 0018
J L2
0x0000 001C
NOP