![]() ![]() | |||
![]() ![]() | ![]() ![]() | ||
| |||
| Home > Program Trace Macrocell Programmer’s Model > TraceEnable > The TraceEnable start/stop block | |||
The TraceEnable start/stop block generates an enable input for the TraceEnable control. The block is turned on by a start input, and remains on until it receives a stop input.
The start inputs for the TraceEnable start/stop block are:
one or more SACs, selected by the TraceEnable Start/Stop Control Register
if supported, one or more EmbeddedICE watchpoint comparator inputs, selected by the TraceEnable Start/Stop EmbeddedICE Control Register.
Similarly, the stop inputs for the block are one or more SACs, and possibly one or more EmbeddedICE watchpoint comparator inputs, as defined in the same registers.
The SACs are defined by the address comparators, see Address comparators. When an SAC defines a stop input to the start/stop block, the block remains on for that instruction and is turned off at the next waypoint after the instruction.
It is implementation defined whether a PTM implements EmbeddedICE watchpoint comparator inputs, but if it does:
it implements between one and eight watchpoint comparator inputs
signals from the processor drive the comparator inputs, typically the RANGEOUT signals
it is implementation defined whether the comparator inputs are inputs to the start/stop block.
For more information about the EmbeddedICE watchpoint comparator inputs, including checking whether and how they are implemented, see EmbeddedICE watchpoint comparator inputs.
The instructions between one waypoint and the next waypoint make up a block of instructions. The general operation of the start/stop block is:
if a block of instructions includes a trace start/stop block start point then trace that block of instructions
if a block of instructions includes a trace start/stop block stop point then:
trace that block of instructions
do not trace the next block of instructions, unless it includes a new start point.
The way that the PTM traces the block of instructions that includes the trace start/stop block stop point makes it easy to use the block to control tracing a function, where:
an SAC defines the start point, corresponding to a single entry point to the function
multiple SACs define multiple stop points, each corresponding to a different function exit point.
If a start point and a stop point occur in the same block of instructions, then the start/stop block is:
on for that entire block of instructions
off after the last instruction in the block.
This behavior is the same regardless of whether the start point comes before the stop point, or after the stop point. This means that, when programming the SACs that are selected for TraceEnable start/stop block control, you must ensure that the stop SAC for one section of code that you want to trace is not in the same block of instructions as the start SAC for the next section of code you want to trace. If you fail to do this, the second section of code is not traced.
Multiple start points in a block of instructions are treated as a single start point.
Multiple stop points in a block of instructions are treated as a single stop point.