4.5.7. Context ID packet

When the Context ID changes, the PTM outputs a Context ID packet to give the new value. The packet consists of a one-byte Context ID packet header, followed by 1, 2 or 4 bytes that give the new Context ID value, as Figure 4.38 shows.

Figure 4.38. Context ID packet

To view this graphic, your browser must support the SVG format. Either install a browser with native support, or install an appropriate plugin such as Adobe SVG Viewer.


The Context ID value is not compressed. The PTM always outputs the number of bytes specified in the ContextIDsize field of the Main Control Register. See Main Control Register, ETMCR.

The PTM outputs the Context ID packet immediately after tracing the first waypoint after the processor Context ID changes. When interpreting the trace output, the new Context ID value can be applied only to instructions after that waypoint. Table 4.10 shows an example of tracing a Context ID change.

Table 4.10. Tracing a change of Context ID

ExecutionTraceComments
B to 0x1000E atom-
NOP--
MCR to Context ID Register--
ISB

E atom

Atom packet generated to output assembled atoms.

Trace implies code up to the ISB instruction was executed with the old Context ID.

Context ID packet

Context ID changed.

NOP--
NOP--
LDR PC, with value of 0x2000Branch address packet, target address 0x2000Trace implies code up to and including the LDR PC instruction is executed with the new Context ID.

The PTM must generate an atom packet to output any assembled atoms before it generates the Context ID packet.

The Context ID might change on a security level change. In this case, the PTM outputs a Context ID packet immediately after the branch address packet that traces the security level change.

Writes to the Context ID register in the processor are not required to take effect until the next ISB, exception, or exception return. Therefore, a change in the Context ID might not be reported until it actually changes in the processor.

Note

  • A PTM might only output a Context ID packet when it detects an actual change in the Context ID. For example, if an MCR writes to the Context ID Register but does not change the Context ID then the PTM might not output a Context ID packet.

  • If there are multiple Context ID changes between two waypoints, the PTM only considers the last change. If this last change restores the Context ID to the value it had at the first waypoint then the PTM might not output any Context ID packet. However this situation is unlikely, because software normally issues an ISB instruction after changing the Context ID, and the ISB is a waypoint instruction.

Copyright © 1999-2002, 2004-2008, 2011 ARM. All rights reserved.ARM IHI 0035B
Non-ConfidentialID060811