Chapter 20 S12X Debug (S12XDBGV3) Module
MC9S12XDP512 Data Sheet, Rev. 2.17
Freescale Semiconductor
769
The trace buffer is visible through a 2-byte window in the register address map and can be read out using
standard 16-bit word reads.
Figure 20-22. S12XDBG Overview
20.4.2
Comparator Modes
The S12XDBG contains four comparators, A, B, C, and D. Each comparator can be congured to monitor
either S12XCPU or XGATE buses using the SRC bit in the corresponding comparator control register.
Each comparator compares the selected address bus with the address stored in DBGXAH, DBGXAM, and
DBGXAL. Furthermore, comparators A and C also compare the data buses to the data stored in DBGXDH,
DBGXDL and allow masking of individual data bus bits.
All comparators are disabled in BDM and during BDM accesses.
The comparator match control logic (see
Figure 20-22) congures comparators to monitor the buses for
an exact address or an address range, whereby either an access inside or outside the specied range
generates a match condition. The comparator conguration is controlled by the control register contents
and the range control by the DBGC2 contents.
On a match a trigger can initiate a transition to another state sequencer state (see
Section 20.4.3”). The
comparator control register also allows the type of access to be included in the comparison through the use
of the RWE, RW, SZE, and SZ bits. The RWE bit controls whether read or write comparison is enabled
for the associated comparator and the RW bit selects either a read or write access for a valid match.
Similarly the SZE and SZ bits allows the size of access (word or byte) to be considered in the compare.
Only comparators B and D feature SZE and SZ.
The TAG bit in each comparator control register is used to determine the triggering condition. By setting
TAG, the comparator will qualify a match with the output of opcode tracking logic and a trigger occurs
S12XCPU BUS
TRACE BUFFER
B
US
INTERF
A
C
E
TRIGGER
EXTERNAL TAGHI / TAGLO
MATCH0
STATE
XGATE BUS
COMPARATOR B
COMPARATOR C
COMPARATOR D
COMPARATOR A
STATE SEQUENCER
MATCH1
MATCH2
MATCH3
TRACE
READ TRACE DATA (DBG READ DATA BUS)
CONTROL
SECURE
BREAKPOINT REQUESTS
COMP
ARA
T
O
R
MA
TCH
CONTR
OL
XGATE S/W BREAKPOINT REQUEST
TRIGGER
TAG &
TRIGGER
CONTROL
LOGIC
TAGS
TAGHITS
STATE
S12XCPU & XGATE