3.8.3. Defining a PTM event

You define a PTM event as a boolean operation that is applied to one or two of the event resources. If A and B are two event resources, Table 3.7 shows the supported operations and their encodings.

Table 3.7. Boolean operations for defining PTM events

Encoding

Function

b000

A

b001

NOT(A)

b010

A AND B

b011

NOT(A) AND B

b100

NOT(A) AND NOT(B)

b101

A OR B

b110

NOT(A) OR B

b111

NOT(A) OR NOT(B)


To define a PTM event, you program 17 bits of an event register with the encodings for:

You identify PTM resources by their resource numbers. To form a resource number, concatenate the appropriate resource type and index value from Table 3.5. For example, Context ID comparator 2 is event type b101, with index value b1001 (9), so its resource number is b101 1001.

Table 3.8 shows the bitfields used to define an event.

Table 3.8. Defining a PTM event

Bits

Description

[16:14]

Boolean function

[13:7]

Resource B

[6:0]

Resource A


Figure 3.5 shows how an event is defined, including how the resource numbers are split into the resource type and index values.

Figure 3.5. Defining a PTM event

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.


Note

To permanently enable or disable an event, you must specify:

  • Resource A as the hard-wired resource, resource type b110 with index b1111 (15)

  • the boolean function as either:

    • A, to enable the event

    • Not (A), to disable the event.

To define a PTM event you program an event register with the information in Table 3.8 and Figure 3.5. Write this information to bits [16:0] of the register. See Summary of the PTM events for a list of the event registers.

Read values of event registers

A PTM contains a number of event registers which are used to select event resources for controlling tracing or triggering. These registers include the Trigger Event Register, see Trigger Event Register, ETMTRIGGER and the TraceEnable Event Register, see TraceEnable Event Register, ETMTEEVR. These registers are read/write if bit [11] of the ETMCCER is set.

From PFTv1.1, if an invalid resource is programmed, such as one which is architecturally Reserved or a resource which is not supported by the specific implementation, the read value returned is unknown and the behavior of the event is unpredictable.

This enables implementations with a small number of event resources to minimize the number of register bits used to store the event resource selection.

Examples of event programming

Example 3.1 shows how to program an event to occur when the sequencer reaches state 3.

Example 3.1. Encoding an event based on a single resource

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.

  • Set bits [16:14] to select the Boolean A function, b000.

  • Define Resource A as sequencer state 3:

    • resource type b101, for the sequencer

    • index value b0010, for state 3.

Because the selected Boolean function does not use Resource B the value of the Resource B register field is ignored.


Example 3.2 shows how to program an event to occur when counter 2 reaches zero while the processor is executing instructions in the in address range defined by ARC 3.

Example 3.2. Encoding an event based on a combination of resources

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.

  • Set bits [16:14] to select the Boolean A AND B function, b010.

  • Define Resource B as ARC 3:

    • resource type b001, for an ARC

    • index value b0010, for ARC 3.

  • Define Resource A as counter 2:

    • resource type b100, for a counter

    • index value b0001, for counter 2.


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