Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CS 220 / ARM / ARM7TDMI_TechnicalReferenceManual.pdf
Скачиваний:
102
Добавлен:
16.04.2015
Размер:
1.63 Mб
Скачать

Debug in Depth

B.17 Coupling breakpoints and watchpoints

You can couple watchpoint units 1 and 0 together using the CHAIN and RANGE inputs. Using CHAIN enables Watchpoint 0 to be triggered only if Watchpoint 1 has previously matched. The use of RANGE enables simple range checking to be performed by combining the outputs of both watchpoints.

B.17.1 Breakpoint and watchpoint coupling example

Let:

Av[31:0] be the value in the address value register

Am[31:0] be the value in the address mask register

A[31:0] be the address bus from the ARM7TDMI core

Dv[31:0] be the value in the data value register

Dm[31:0] be the value in the data mask register

D[31:0] be the data bus from the ARM7TDMI core

Cv[8:0] be the value in the control value register

Cm[7:0] be the value in the control mask register

C[9:0] be the combined control bus from the ARM7TDMI core, other watchpoint registers and the EXTERN signal.

CHAINOUT signal

The CHAINOUT signal is derived as follows:

WHEN (({Av[31:0],Cv[4:0]} XNOR {A[31:0],C[4:0]}) OR {Am[31:0],Cm[4:0]} == 0xFFFFFFFFF) CHAINOUT = ((({Dv[31:0],Cv[7:5]} XNOR {D[31:0],C[7:5]}) OR {Dm[31:0],Cm[7:5]}) == 0x7FFFFFFFF)

The CHAINOUT output of watchpoint register 1 provides the CHAIN input to Watchpoint 0. This CHAIN input enables for quite complicated configurations of breakpoints and watchpoints.

Note

There is no CHAIN input to Watchpoint 1 and no CHAIN output from Watchpoint 0.

Take, for example, the request by a debugger to breakpoint on the instruction at location YYY when running process XXX in a multi process system. If the current process ID is stored in memory, you can implement the above function with a watchpoint and breakpoint chained together. The watchpoint address points to a known memory location containing the current process ID, the watchpoint data points to the required process ID and the ENABLE bit is set to off.

B-52

Copyright © 1994-2001. All rights reserved.

ARM DDI 0029G

Debug in Depth

The address comparator output of the watchpoint is used to drive the write enable for the CHAINOUT latch. The input to the latch is the output of the data comparator from the same watchpoint. The output of the latch drives the CHAIN input of the breakpoint comparator. The address YYY is stored in the breakpoint register and when the CHAIN input is asserted, the breakpoint address matches and the breakpoint triggers correctly.

B.17.2 RANGEOUT signal

The RANGEOUT signal is derived as follows:

RANGEOUT = ((({Av[31:0],Cv[4:0]} XNOR {A[31:0],C[4:0]}) OR {Am[31:0],Cm[4:0]}) == 0xFFFFFFFFF) AND

((({Dv[31:0],Cv[7:5]} XNOR {D[31:0],C[7:5]}) OR Dm[31:0],Cm[7:5]}) == 0x7FFFFFFFF)

The RANGEOUT output of watchpoint register 1 provides the RANGE input to watchpoint register 0. This RANGE input enables you to couple two breakpoints together to form range breakpoints.

Selectable ranges are restricted to being powers of 2. For example, if a breakpoint is to occur when the address is in the first 256 bytes of memory, but not in the first 32 bytes, program the watchpoint as follows:

For Watchpoint 1:

1.Program Watchpoint 1 with an address value of 0x00000000 and an address mask of 0x0000001F.

2.Clear the ENABLE bit.

3.Program all other Watchpoint 1 registers as normal for a breakpoint. An address within the first 32 bytes causes the RANGE output to go HIGH but does not trigger the breakpoint.

For Watchpoint 0:

1.Program Watchpoint 0 with an address value of 0x00000000 and an address mask of 0x000000FF.

2.Set the ENABLE bit.

3.Program the RANGE bit to match a 0.

4.Program all other Watchpoint 0 as normal for a breakpoint.

If Watchpoint 0 matches but Watchpoint 1 does not, that is the RANGE input to

Watchpoint 0 is 0, the breakpoint is triggered.

ARM DDI 0029G

Copyright © 1994-2001. All rights reserved.

B-53

Соседние файлы в папке ARM