SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
The Program Counter (PC) Trace module can be used to keep track of PC discontinuities or jumps, as a means to trace an entire program execution sequence over a period of time. When trace is completed or stopped, trace data can be read out using a debugger and analyzed to reconstruct the code execution sequence. The PC Trace module provides multiple modes and controls to govern when to trace and when not to trace. The trace module is tightly coupled with the Enhanced Bus Comparator, the System Event Counter Unit, and certain critical system level event signals.
Trace data is stored in an addressable memory buffer that can be read by software or a debugger. The trace data stored in this buffer includes additional status information on trace validity that can be used to correctly reconstruct the code execution system. For each discontinuity, two PC values are stored: the source of the discontinuity, and the destination. Figure 14-5 illustrates the operation of the PC trace module. The trace buffer is a circular buffer with overflow: when the buffer becomes full, new trace data is written starting from the top of the buffer, and an overflow status bit is set.