![]() ![]() | |||
![]() ![]() | ![]() ![]() | ||
| |||
| Home > Program Flow Tracing > About Program Flow Tracing > Tracing branches | |||
When the processor executes a direct branch instruction, if a trace decompressor knows whether the instruction passed its condition code check it can determine the destination address of the instruction, because it knows the instruction address and opcode. Therefore, by default, a PTM traces a direct branch by generating an atom:
an E atom indicates that the branch instruction passed its condition code check
an N atom indicates that the branch instruction failed its condition code check.
The PTM can assemble a number of atoms, and output them as a single byte of trace in an atom header.
For an indirect branch instruction, when the return stack is disabled or not implemented:
If the instruction fails its condition code check there is no branch and the PTM generates an N atom.
If the instruction passes its condition code check the PTM must trace the destination address explicitly, and it generates a branch address packet to do this. A branch address packet implies an E atom.
A return stack is an optional PFT feature that reduces the number of branch packets generated by the PTM. and therefore significantly reduces the amount of trace output. For more information see Use of a return stack.
A trace decompressor can configure the PTM to use
branch address packets to trace direct branches, by configuring
it for branch broadcasting. For example, this
might be useful for tracing a BLX <immed> branch
that changes to Thumb state. Generating a branch address packet
means that the change to Thumb state is indicated explicitly in
the trace stream.