![]() ![]() | |||
![]() ![]() | ![]() ![]() | ||
| |||
| Home > Program Trace Macrocell Programmer’s Model > Event resources and PTM events > 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 lists 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:
The required operation, as shown in Table 3.7.
The first event resource, A.
The second event resource, B, if required. If only one resource is required this field is ignored.
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.
Figure 3.4 shows how an event is defined, including how the resource numbers are split into the resource type and index values.
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 shown in Table 3.8 and Figure 3.4. Write this information to bits [16:0] of the register. See Summary of the PTM events for a list of the event registers.
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
set bits [16:14] 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
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.