Chapter 20 S12X Debug (S12XDBGV3) Module
MC9S12XDP512 Data Sheet, Rev. 2.17
Freescale Semiconductor
777
Loop1 Mode only inhibits consecutive duplicate source address entries that would typically be stored in
most tight looping constructs. It does not inhibit repeated entries of destination addresses or vector
addresses, since repeated entries of these would most likely indicate a bug in the user’s code that the
S12XDBG module is designed to help nd.
NOTE
In certain very tight loops, the source address will have already been fetched
again before the background comparator is updated. This results in the
source address being stored twice before further duplicate entries are
suppressed. This condition occurs with branch-on-bit instructions when the
branch is fetched by the rst P-cycle of the branch or with loop-construct
instructions in which the branch is fetched with the rst or second P cycle.
See examples below:
LOOP
INX
; 1-byte instruction fetched by 1st P-cycle of BRCLR
BRCLR
CMPTMP,#$0c, LOOP
; the BRCLR instruction also will be fetched by 1st
; P-cycle of BRCLR
LOOP2
BRN
*
; 2-byte instruction fetched by 1st P-cycle of DBNE
NOP
; 1-byte instruction fetched by 2nd P-cycle of DBNE
DBNE
A,LOOP2
; this instruction also fetched by 2nd P-cycle of DBNE
20.4.5.2.3
Detail Mode
In Detail Mode, address and data for all memory and register accesses is stored in the trace buffer. In the
case of XGATE tracing this means that initialization of the R1 register during a vector fetch is not traced.
This mode is intended to supply additional information on indexed, indirect addressing modes where
storing only the destination address would not provide all information required for a user to determine
where the code is in error. This mode also features information byte storage to the trace buffer, for each
address byte storage. The information byte indicates the size of access (word or byte), the type of access
(read or write).
When tracing S12XCPU activity in Detail Mode, all cycles are traced except those when the S12XCPU is
either in a free or opcode fetch cycle. In this mode the XGATE program counter is also traced to provide
a snapshot of the XGATE activity. CXINF information byte bits indicate the type of XGATE activity
occurring at the time of the trace buffer entry. When tracing S12XCPU activity alone in Detail Mode, the
address range can be limited to a range specied by the TRANGE bits in DBGTCR. This function uses
comparators C and D to dene an address range inside which S12XCPU activity should be traced (see
Table 20-39). Thus the traced S12XCPU activity can be restricted to register range accesses.
When tracing XGATE activity in Detail Mode, all load and store cycles are traced. Additionally the
S12XCPU program counter is stored at the time of the XGATE trace buffer entry to provide a snapshot of
S12XCPU activity.
20.4.5.2.4
Pure PC Mode
In Pure PC Mode, tracing from the CPU the PC addresses of all executed opcodes are stored with the
exception of WAI and STOP instructions.
In Pure PC Mode, tracing from the XGATE the PC addresses of all executed opcodes are stored.