3.4.1. General behavior of address comparators

To define an address comparator:

In addition, to define an ARC:

The PTM keeps a record of the destination address of the last waypoint, and treats this waypoint destination address as the start address of a block of instructions. Between two waypoints the program flow is continuous. The next waypoint marks the end of the block of instructions, and at that point the PTM can check whether any address comparators matched any address in that block of instructions.

For example, consider the following sequence of code execution:

  1. The instruction at 0x1000 is a direct branch to 0x2000.

  2. The program executes from 0x2000 to 0x2100.

  3. The instruction at 0x2100 is a direct branch to 0x3000.

If an address comparator matches on address 0x2050, then when the program flow reaches the waypoint at 0x2100, the comparators must determine whether the instruction at address 0x2050 executed. Because the PTM can determine that the program executed from 0x2000 to 0x2100, it also determines that the comparator matched.

Because the program executed from 0x2000 to 0x2100, there was no change in security state or instruction set state in this block of instructions, and any change in state does not take effect until after execution of the block is complete.

Note

When processing a new waypoint, the PTM defines the block of instructions executed up to the waypoint from:

  • The target address of the previous waypoint. This is the start address of the block of instructions.

  • The address of either:

    • the current waypoint, if no exception has occurred

    • the last instruction before the exception.

    This is the address of the last instruction successfully executed, and is the end address of the block of instructions.

An instruction block end address might not be the exact address of the waypoint instruction that defines the end of the block, but:

This means that a PTM implementation has some flexibility in the addresses used for comparison. See Table 3.2 for more information.

Table 3.2. Permitted instruction block end addresses

Instruction type [a]AddressPermitted?
Instruction [b]Block end
ARM0x1000< 0x1000No, this is less than the address of the last instruction, 0x1000.
0x10000x1000Yes
0x10000x1001Yes
0x10000x1002Yes
0x10000x1003Yes
0x10000x1004No, this is not less than the address of the next instruction, 0x1004.
32-bit Thumb0x1000< 0x1000No, this is less than the address of the last instruction, 0x1000.
0x10000x1000Yes
0x10000x1001Yes
0x10000x1002Yes
0x10000x1003Yes
0x10000x1004No, this is not less than the address of the next instruction, 0x1004.
16-bit Thumb0x1000< 0x1000No, this is less than the address of the last instruction, 0x1000.
0x10000x1000Yes
0x10000x1001Yes
0x10000x1002No, this is not less than the address of the next instruction, 0x1002.

[a] Instruction set, and instruction length for Thumb instructions.

[b] Address of the last instruction executed, see text.


Note

If instruction execution wraps round the top of the memory space then processor operation is unpredictable. If the current waypoint address is less than the previous waypoint address, and no branch or exception has occurred, then instruction execution has wrapped in this way. In this situation, the behavior of address range comparators is implementation specific.

If the processor does not execute any instructions between two waypoints then the comparators are not affected by the second waypoint. Examples of where no instructions are executed between two waypoints are:

Terms used to describe address comparator behavior

The PTM tests all the address comparators whenever it processes a waypoint. The following terms are used when describing the behavior of SACs and ARCs:

Current waypoint

The waypoint currently being executed, for which the PTM is testing the comparators.

Previous waypoint

The last waypoint executed by the processor, before the current waypoint.

Instruction block

The block of instructions executed between the previous waypoint and the current waypoint. This block is defined by two addresses, START and END, defined as:

START

The destination address of the previous waypoint.

END

The address of the current waypoint.

CompAddr

When testing a SAC, the address programmed in the Address Comparator Value Register.

CompAddrLow

When testing an ARC, the address programmed in the lower-numbered Address Comparator Value Register, that defines the low address of the address range. For example, if you are using Address Comparator Value Registers 1 and 2 to define an ARC, CompAddrLow is the address held in Address Comparator Value Register 1.

CompAddrHigh

When testing an ARC, the address programmed in the higher-numbered Address Comparator Value Register, that defines the high address of the address range. For example, if you are using Address Comparator Value Registers 1 and 2 to define an ARC, CompAddrHigh is the address held in Address Comparator Value Register 2.

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