9.4. Programming Watchpoints

These are just examples of how to program the watchpoint register to generate breakpoints and watchpoints; many other ways of programming the registers are possible. For instance, simple range breakpoints can be provided by setting one or more of the address mask bits.

To make a watchpoint unit cause watchpoints (ie on data accesses):

  1. Program its Address Value register with the address of the data access to be watchpointed.

  2. Program the Address Mask register to 0x00000000.

  3. Program the Data Value register only if you require a data-dependent watchpoint; that is, only if the actual data value read or written must be matched as well as the address. If the data value is irrelevant, program the Data Mask register to 0xFFFFFFFF (all bits set to 1) otherwise program it to 0x00000000.

  4. Program the Control Value register with:

    nOPC = 1

    nRW = 0 for a read

    nRW = 1 for a write

    MAS[1:0] with the value corresponding to the appropriate data size.

  5. Program the Control Mask register with:

    nOPC = 0

    nRW = 0

    MAS[1:0] = 0

    all other bits to 1

    Note that nRW or MAS[1:0] may be set to 1 if both reads and writes or data size accesses are to be watchpointed respectively.

  6. If you wish to make the distinction between user and non-user mode data accesses, program the nTRANS bit in the Control Value and Control Mask registers accordingly.

  7. If required, program the EXTERN, RANGE and CHAIN bits in the same way.

Copyright © 1997, 1998 ARM Limited. All rights reserved.DDI 0087E