ARM7 Technical Reference Manual
ARM7 Technical Reference Manual
ARM7 Technical Reference Manual
(Rev 3)
Change history
November 2000 F SGML, new layout, new title, incorporation of errata, and technical changes.
Proprietary Notice
Words and logos marked with ® or ™ are registered trademarks or trademarks owned by ARM Limited. Other
brands and names mentioned herein may be the trademarks of their respective owners.
Neither the whole nor any part of the information contained in, or the product described in, this document
may be adapted or reproduced in any material form except with the prior written permission of the copyright
holder.
The product described in this document is subject to continuous developments and improvements. All
particulars of the product and its use contained in this document are given by ARM in good faith. However,
all warranties implied or expressed, including but not limited to implied warranties of merchantability, or
fitness for purpose, are excluded.
This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable
for any loss or damage arising from the use of any information in this document, or any error or omission in
such information, or any incorrect use of the product.
Figure B-2 on page B-5 reprinted with permission IEEE Std 1149.1-1990. IEEE Standard Test Access Port
and Boundary Scan Architecture Copyright 1994-2001, by IEEE. The IEEE disclaims any responsibility or
liability resulting from the placement and use in the described manner.
Product Status
Web Address
http://www.arm.com
Preface
About this document .................................................................................. xviii
Further reading ............................................................................................ xxi
Feedback .................................................................................................... xxii
Chapter 1 Introduction
1.1 About the ARM7TDMI core ......................................................................... 1-2
1.2 Architecture ................................................................................................. 1-5
1.3 Block, core, and functional diagrams .......................................................... 1-7
1.4 Instruction set summary ............................................................................ 1-10
Glossary
This preface introduces the ARM7TDMI core and its reference documentation. It
contains the following sections:
• About this document on page xviii
• Further reading on page xxi
• Feedback on page xxii.
Intended audience
This document has been written for experienced hardware and software engineers who
are working with the ARM7TDMI processor.
Chapter 1 Introduction
Introduction to the architecture.
Typographical conventions
bold Highlights interface elements, such as menu names and buttons. Also
used for terms in descriptive lists, where appropriate.
typewriter Denotes text that can be entered at the keyboard, such as commands, file
and program names, and source code.
typewriter italic
Denotes arguments to commands and functions where the argument is to
be replaced by a specific value.
typewriter bold
Denotes language keywords when used outside example code and ARM
processor signal names.
The key provided in Figure P-1 explains the components used in timing diagrams. Any
variations are labeled when they occur. Therefore, no additional meaning must be
attached unless specifically stated.
Shaded bus and signal areas are undefined, so the bus or signal can assume any value
within the shaded area at that time. The actual level is unimportant and does not affect
normal operation.
Clock
HIGH to LOW
Transient
HIGH/LOW to HIGH
Bus stable
Bus change
Further reading
This section lists publications by ARM Limited and third parties.
ARM periodically provides updates and corrections to its documentation. For current
errata sheets, addenda, and list of Frequently Asked Questions go to the ARM website:
www.arm.com
ARM publications
This document contains information that is specific to the ARM7TDMI core. Refer to
the following documents for other relevant information:
Other publications
Feedback
ARM Limited welcomes feedback both on the ARM7TDMI core, and on the
documentation.
If you have any comments or suggestions about this product, please contact your
supplier giving:
• the product name
• a concise explanation of your comments.
If you have any comments about this document, please send email to errata@arm.com
giving:
• the document title
• the document number
• the page number(s) to which your comments refer
• a concise explanation of your comments.
This chapter introduces the ARM7TDMI core. It contains the following sections:
• About the ARM7TDMI core on page 1-2
• Architecture on page 1-5
• Block, core, and functional diagrams on page 1-7
• Instruction set summary on page 1-10.
The ARM7TDMI core uses a pipeline to increase the speed of the flow of instructions
to the processor. This allows several operations to take place simultaneously, and the
processing and memory systems to operate continuously.
During normal operation, while one instruction is being executed, its successor is being
decoded, and a third instruction is being fetched from memory.
The program counter points to the instruction being fetched rather than to the instruction
being executed. This is important because it means that the Program Counter (PC)
value used in an executing instruction is always two instructions ahead of the address.
The ARM7TDMI core has a Von Neumann architecture, with a single 32-bit data bus
carrying both instructions and data. Only load, store, and swap instructions can access
data from memory.
The ARM7TDMI processor memory interface has been designed to allow performance
potential to be realized, while minimizing the use of memory. Speed-critical control
signals are pipelined to allow system control functions to be implemented in standard
low-power logic. These control signals facilitate the exploitation of the fast-burst access
modes supported by many on-chip and off-chip memory technologies.
1.2 Architecture
The ARM7TDMI processor has two instruction sets:
• the 32-bit ARM instruction set
• the 16-bit Thumb instruction set.
Microprocessor architectures traditionally had the same width for instructions, and data.
Therefore 32-bit architectures had higher performance manipulating 32-bit data, and
could address a large address space much more efficiently than 16-bit architectures.
16-bit architectures typically had higher code density than 32-bit architectures, but
approximately half the performance.
The Thumb instruction set is a subset of the most commonly used 32-bit ARM
instructions. Thumb instructions are each 16 bits long, and have a corresponding 32-bit
ARM instruction that has the same effect on the processor model. Thumb instructions
operate with the standard ARM register configuration, allowing excellent
interoperability between ARM and Thumb states.
Thumb therefore offers a long branch range, powerful arithmetic operations, and a large
address space.
Thumb code is typically 65% of the size of ARM code, and provides 160% of the
performance of ARM code when running from a 16-bit memory system. Thumb,
therefore, makes the ARM7TDMI core ideally suited to embedded applications with
restricted memory bandwidth, where code density and footprint is important.
The availability of both 16-bit Thumb and 32-bit ARM instruction sets gives designers
the flexibility to emphasize performance or code size on a subroutine level, according
to the requirements of their applications. For example, critical loops for applications
such as fast interrupts and DSP algorithms can be coded using the full ARM instruction
set then linked with Thumb code.
RANGEOUT0
Scan chain 2
RANGEOUT1 EmbeddedICE
EXTERN1 Logic
EXTERN0
Scan chain 0
nOPC
nRW
MAS[1:0]
nTRANS
nMREQ
A[31:0] ARM7TDMI
main All other
processor signals
D[31:0] logic
Bus splitter
Scan chain 1
DIN[31:0]
DOUT[31:0]
SCREG[3:0]
TAPSM[3:0]
A[31:0]
ALE ABE
Scan control
Incrementer bus
DBGACK
PC bus
Address ECLK
incrementer nEXEC
ISYNC
BL[3:0]
Register bank APE
(31 x 32-bit registers) MCLK
(6 status registers) nWAIT
nRW
MAS[1:0]
nIRQ
Instruction
ALU bus
32 x 8 decoder and
nFIQ
Multiplier nRESET
logic control
ABORT
A bus
nTRANS
nMREQ
nOPC
B bus
SEQ
Barrel shifter LOCK
nCPI
CPA
CPB
nM[4:0]
32-bit ALU TBE
TBIT
HIGHZ
Instruction pipeline
Write data register Read data register
Thumb instruction controller
DBE
nENOUT nENIN
D[31:0]
MCLK
Clocks and TCK
nWAIT
timing TMS
ECLK
TDI
nIRQ nTRST
Interrupts nFIQ TDO Boundary
ISYNC TAPSM[3:0] scan
IR[3:0]
nRESET
nTDOEN
BUSEN
TCK1
HIGHZ
TCK2
nHIGHZ
SCREG[3:0] Boundary
BIGEND
11 scan
nENIN control
nENOUT signals
Bus Processor
nENOUTI nM[4:0]
controls mode
ABE
Processor
ALE TBIT
state
APE
DBE A[31:0]
TBE ARM7TDMI
BUSDIS
DOUT[31:0]
ECAPCLK
This section provides a summary of the ARM, and Thumb instruction sets:
• ARM instruction summary on page 1-12
• Thumb instruction summary on page 1-19.
Type Description
#32bit_Imm A 32-bit constant, formed by right-rotating an 8-bit value by an even number of bits.
The ARM instruction set formats are shown in Figure 1-5 on page 1-11.
Refer to the ARM Architectural Reference Manual for more information about the ARM
instruction set formats.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data processing and
FSR transfer
Cond 0 0 1 Opcode S Rn Rd Operand 2
Multiply Cond 0 0 0 0 0 0 A S Rd Rn Rs 1 0 0 1 Rm
Undefined Cond 0 1 1 1
Coprocessor data
transfer
Cond 1 1 0 P U N W L Rn CRd CP# Offset
Coprocessor data
operation Cond 1 1 1 0 CP Opc CRn CRd CP# CP 0 CRm
Coprocessor register
transfer Cond 1 1 1 0 CP Opc L CRn Rd CP# CP 1 CRm
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note
Some instruction codes are not defined but do not cause the Undefined instruction trap
to be taken, for instance a multiply instruction with bit 6 changed to a 1. These
instructions must not be used because their action might change in future ARM
implementations. The behavior of these instruction codes on the ARM7TDMI
processor is unpredictable.
Coprocessors Data operation CDP{cond} p<cpnum>, <op1>, CRd, CRn, CRm, <op2>
Move to ARM register from coprocessor MRC{cond} p<cpnum>, <op1>, Rd, CRn, CRm, <op2>
Move to coprocessor from ARM register MCR{cond} p<cpnum>, <op1>, Rd, CRn, CRm, <op2>
Addressing modes
The addressing modes are procedures shared by different instructions for generating
values used by the instructions. The five addressing modes used by the ARM7TDMI
processor are:
Mode 1 Shifter operands for data processing instructions.
Mode 2 Load and store word or unsigned byte.
Mode 3 Load and store halfword or load signed byte.
Mode 4 Load and store multiple.
Mode 5 Load and store coprocessor.
The addressing modes are listed with their types and mnemonics Table 1-3.
Type or
Addressing mode Mnemonic or stack type
addressing mode
Pre-indexed offset -
Post-indexed offset -
Type or
Addressing mode Mnemonic or stack type
addressing mode
Post-indexed offset -
Type or
Addressing mode Mnemonic or stack type
addressing mode
Operand 2
An operand is the part of the instruction that references data or a peripheral device.
Operand 2 is listed in Table 1-4.
Register Rm
Fields
Condition fields
MI Negative N set
VS Overflow V set
VC No overflow V clear
LE Less than, or equal Z set or N<>V (N set and V clear) or (N clear and V set)
The Thumb instruction set formats are shown in Figure 1-6 on page 1-20.
Refer to the ARM Architectural Reference Manual for more information about the ARM
instruction set formats.
Format 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Rn/
Add and subtract 02 0 0 0 1 1 1 Op Rs Rd
offset3
Move, compare, add, and subtract
03 0 0 1 Op Rd Offset8
immediate
ALU operation 04 0 1 0 0 0 0 Op Rs Rd
Format 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OR ORR Rd, Rs
Shift/Rotate Logical shift left LSL Rd, Rs, #5bit_shift_imm LSL Rd, Rs
Branch Conditional -
Unconditional B label
Address -
This chapter describes the ARM7TDMI core programmer’s model. It contains the
following sections:
• About the programmer’s model on page 2-2
• Processor operating states on page 2-3
• Memory formats on page 2-4
• Data types on page 2-6
• Operating modes on page 2-7
• Registers on page 2-8
• The program status registers on page 2-13
• Exceptions on page 2-16
• Interrupt latencies on page 2-23
• Reset on page 2-24.
In Thumb state, the Program Counter (PC) uses bit 1 to select between alternate
halfwords.
Note
Transition between ARM and Thumb states does not affect the processor mode or the
register contents.
The operating state of the ARM7TDMI core can be switched between ARM state and
Thumb state using the BX instruction. This is described in the ARM Architecture
Reference Manual.
All exception handling is entered in ARM state. If an exception occurs in Thumb state,
the processor reverts to ARM state. The transition back to Thumb state occurs
automatically on return. An exception handler can change to Thumb state but it must
return to ARM state to allow the exception handler to terminate correctly.
The ARM7TDMI processor is bi-endian and can treat words in memory as being stored
in either:
• Little-endian on page 2-4.
• Big-Endian on page 2-5
Note
Little-endian is traditionally the default format for ARM processors.
The endian format of a CPU dictates where the most significant byte or digits must be
placed in a word. Because numbers are calculated by the CPU starting with the least
significant digits, little-endian numbers are already set up for the processing order.
Endian configuration has no relevance unless data is stored as words and then accessed
in smaller sized quantities (halfwords or bytes).
2.3.1 Little-endian
For a word-aligned address A, Figure 2-1 shows how the word at address A, the
halfword at addresses A and A+2, and the bytes at addresses A, A+1, A+2, and A+3
map on to each other when the core is configured as little-endian.
31 24 23 16 15 8 7 0
Word at address A
Halfword at address A+2 Halfword at address A
Byte at address A+3 Byte at address A+2 Byte at address A+1 Byte at address A
2.3.2 Big-Endian
In big-endian format, the ARM7TDMI processor stores the most significant byte of a
word at the lowest-numbered byte, and the least significant byte at the
highest-numbered byte. So the byte at address 0 of the memory system connects to data
lines 31 through 24.
For a word-aligned address A, Figure 2-2 shows how the word at address A, the
halfword at addresses A and A+2, and the bytes at addresses A, A+1, A+2, and A+3
map on to each other when the core is configured as big-endian.
31 24 23 16 15 8 7 0
Word at address A
Halfword at address A Halfword at address A+2
Byte at address A Byte at address A+1 Byte at address A+2 Byte at address A+3
Note
Memory systems are expected to support all data types. In particular, the system must
support subword writes without corrupting neighboring bytes in that word.
• User mode is the usual ARM program execution state, and is used for executing
most application programs.
Modes other than User mode are collectively known as privileged modes. Privileged
modes are used to service interrupts or exceptions, or to access protected resources.
User usr
Interrupt irq
Supervisor svc
Abort abt
System sys
Undefined und
2.6 Registers
The ARM7TDMI processor has a total of 37 registers:
• 31 general-purpose 32-bit registers
• 6 status registers.
These registers are not all accessible at the same time. The processor state and operating
mode determine which registers are available to the programmer.
In ARM state, 16 general registers and one or two status registers are accessible at any
one time. In privileged modes, mode-specific banked registers become available. Figure
2-3 on page 2-10 shows which registers are available in each mode.
In privileged modes, another register, the Saved Program Status Register (SPSR), is
accessible. This contains the condition code flags and the mode bits saved as a result of
the exception which caused entry to the current mode.
Banked registers are discrete physical registers in the core that are mapped to the
available registers depending on the current processor operating mode. Banked register
contents are preserved across operating mode changes.
In ARM state, many FIQ handlers do not have to save any registers.
The User, IRQ, Supervisor, Abort, and undefined modes each have two banked registers
mapped to r13 and r14, allowing a private SP and LR for each mode.
= banked register
The Thumb-state register set is a subset of the ARM-state set. The programmer has
access to:
• 8 general registers, r0–r7
• the PC
• the SP
• the LR
• the CPSR.
There are banked SPs, LRs, and SPSRs for each privileged mode. This register set is
shown in Figure 2-4.
= banked register
The Thumb-state registers relate to the ARM-state registers in the following way:
• Thumb-state r0–r7 and ARM-state r0–r7 are identical
• Thumb-state CPSR and SPSRs and ARM-state CPSR and SPSRs are identical
• Thumb-state SP maps onto the ARM-state r13
• Thumb-state LR maps onto the ARM-state r14
• the Thumb-state PC maps onto the ARM-state PC (r15).
Note
Registers r0–r7 are known as the low registers. Registers r8–r15 are known as the high
registers.
In Thumb state, the high registers, r8–r15, are not part of the standard register set. The
assembly language programmer has limited access to them, but can use them for fast
temporary storage.
You can use special variants of the MOV instruction to transfer a value from a low
register, in the range r0–r7, to a high register, and from a high register to a low register.
The CMP instruction allows you to compare high register values with low register
values. The ADD instruction enables you to add high register values to low register
values. For more details, please refer to the ARM Architecture Reference Manual.
Condition
code flags Reserved Control bits
31 30 29 28 27 26 25 24 23 8 7 6 5 4 3 2 1 0
N Z C V • • • • • • I F T M4 M3 M2 M1 M0
Note
To maintain compatibility with future ARM processors, you must not alter any of the
reserved bits. One method of preserving these bits is to use a read-write-modify strategy
when changing the CPSR.
The N, Z, C, and V bits are the condition code flags, you can set them by arithmetic and
logical operations. They can also be set by MSR and LDM instructions. The
ARM7TDMI processor tests these flags to determine whether to execute an instruction.
All instructions can execute conditionally in ARM state. In Thumb state, only the
Branch instruction can be executed conditionally. For more information about
conditional execution, refer to the ARM Architecture Reference Manual.
The bottom eight bits of a PSR are known collectively as the control bits. They are the:
• interrupt disable bits
• T bit
• mode bits.
The control bits change when an exception occurs. When the processor is operating in
a privileged mode, software can manipulate these bits.
T bit
Caution
Never use an MSR instruction to force a change to the state of the T bit in the CPSR. If
you do this, the processor enters an unpredictable state.
Mode bits
Bits M[4:0] determine the processor operating mode as shown in Table 2-2. Not all
combinations of the mode bits define a valid processor mode, so take care to use only
the bit combinations shown.
10000 User r0–r7, SP, LR, PC, CPSR r0–r14, PC, CPSR
10001 FIQ r0–r7, SP_fiq, LR_fiq, PC, CPSR, SPSR_fiq r0–r7, r8_fiq–r14_fiq, PC, CPSR,
SPSR_fiq
10010 IRQ r0–r7, SP_irq, LR_irq, PC, CPSR, SPSR_irq r0–r12, r13_irq, r14_irq, PC, CPSR,
SPSR_irq
10011 Supervisor r0–r7, SP_svc, LR_svc, PC, CPSR, r0–r12, r13_svc, r14_svc, PC, CPSR,
SPSR_svc SPSR_svc
10111 Abort r0–r7, SP_abt, LR_abt, PC, CPSR, r0–r12, r13_abt, r14_abt, PC, CPSR,
SPSR_abt SPSR_abt
11011 Undefined r0–r7, SP_und, LR_und, PC, CPSR, r0–r12, r13_und, r14_und, PC, CPSR,
SPSR_und SPSR_und
11111 System r0–r7, SP, LR, PC, CPSR r0–r14, PC, CPSR
The remaining bits in the PSRs are unused, but are reserved. When changing a PSR flag
or control bits, make sure that these reserved bits are not altered. Also, make sure that
your program does not rely on reserved bits containing specific values because future
processors might have these bits set to 1 or 0.
2.8 Exceptions
Exceptions arise whenever the normal flow of a program has to be halted temporarily,
for example, to service an interrupt from a peripheral. Before attempting to handle an
exception, the ARM7TDMI processor preserves the current processor state so that the
original program can resume when the handler routine has finished.
If two or more exceptions arise simultaneously, the exceptions are dealt with in the fixed
order given in Table 2-3.
Table 2-3 summarizes the PC value preserved in the relevant r14 on exception entry, and
the recommended instruction for exiting the exception handler.
BL MOV PC, R14 PC+4 PC+2 Where PC is the address of the BL, SWI, or
undefined instruction fetch that had the
SWI MOVS PC, R14_svc PC+4 PC+2 Prefetch Abort
UDEF MOVS PC, R14_und PC+4 PC+2
FIQ SUBS PC, R14_fiq, #4 PC+4 PC+4 Where PC is the address of the instruction
that was not executed because the FIQ or
IRQ SUBS PC, R14_irq, #4 PC+4 PC+4 IRQ took priority
DABT SUBS PC, R14_abt, #8 PC+8 PC+8 Where PC is the address of the Load or Store
instruction that generated the Data Abort
3. Forces the CPSR mode bits to a value that depends on the exception.
4. Forces the PC to fetch the next instruction from the relevant exception vector.
The ARM7TDMI processor can also set the interrupt disable flags to prevent otherwise
unmanageable nestings of exceptions.
Note
Exceptions are always entered in ARM state. When the processor is in Thumb state and
an exception occurs, the switch to ARM state takes place automatically when the
exception vector address is loaded into the PC. An exception handler might change to
Thumb state but it must return to ARM state to allow the exception handler to terminate
correctly.
1. Move the LR, minus an offset to the PC. The offset varies according to the type
of exception, as shown in Table 2-3 on page 2-16.
Note
The action of restoring the CPSR from the SPSR automatically resets the T bit to
whatever value it held immediately prior to the exception.
The Fast Interrupt Request (FIQ) exception supports data transfers or channel
processes. In ARM state, FIQ mode has eight banked registers to remove the
requirement for register saving. This minimizes the overhead of context switching.
An FIQ is externally generated by taking the nFIQ input LOW. The input passes into
the core through a synchronizer.
Irrespective of whether exception entry is from ARM state or from Thumb state, an FIQ
handler returns from the interrupt by executing:
SUBS PC,R14_fiq,#4
FIQ exceptions can be disabled within a privileged mode by setting the CPSR F flag.
When the F flag is clear, the ARM7TDMI processor checks for a LOW level on the
output of the FIQ synchronizer at the end of each instruction.
The Interrupt Request (IRQ) exception is a normal interrupt caused by a LOW level on
the nIRQ input. IRQ has a lower priority than FIQ, and is masked on entry to an FIQ
sequence. As with the nFIQ input, nIRQ passes into the core through a synchronizer.
Irrespective of whether exception entry is from ARM state or Thumb state, an IRQ
handler returns from the interrupt by executing:
SUBS PC,R14_irq,#4
You can disable IRQ at any time, by setting the I bit in the CPSR from a privileged
mode.
2.8.6 Abort
An abort indicates that the current memory access cannot be completed. An abort is
signaled by the external ABORT input. The ARM7TDMI processor checks for the abort
exception at the end of memory access cycles.
• Work out the cause of the abort and make the requested data available.
• Load the instruction that caused the abort using an LDR Rn,[R14_abt,#-8]
instruction to determine whether that instruction specifies base register
write-back. If it does, the abort handler must then:
— determine from the instruction what the offset applied to the base register
by the write-back was
— apply the opposite offset to the value that will be reloaded into the base
register when the abort handler returns.
This ensures that when the instruction is retried, the base register will have been
restored to the value it had when the instruction was originally executed.
The application program needs no knowledge of the amount of memory available to it,
nor is its state in any way affected by the abort.
Prefetch Abort
When a Prefetch Abort occurs, the ARM7TDMI processor marks the prefetched
instruction as invalid, but does not take the exception until the instruction reaches the
Execute stage of the pipeline. If the instruction is not executed, for example because it
fails its condition codes or because a branch occurs while it is in the pipeline, the abort
does not take place.
After dealing with the reason for the abort, the handler executes the following
instruction irrespective of the processor operating state:
SUBS PC,R14_abt,#4
This action restores both the PC and the CPSR, and retries the aborted instruction.
Data Abort
When a Data Abort occurs, the action taken depends on the instruction type:
• Single data transfer instructions (LDR and STR). If write back base register is
specified by the instruction then the abort handler must be aware of this. In the
case of a load instruction the ARM7TDMI processor prevents overwriting of the
destination register with the loaded data.
• Block data transfer instructions (LDM and STM) complete. When write-back is
specified, the base register is updated.
If the base register is in the transfer list and has already been overwritten with
loaded data by the time that the abort is indicated then the base register reverts to
the original value. The ARM7TDMI processor prevents all register overwriting
with loaded data after an abort is indicated. This means that the final value of the
base register is always the written-back value, if write-back is specified, at its
original value. It also means that the ARM7TDMI core always preserves r15 in
an aborted LDM instruction, because r15 is always either the last register in the
transfer list or not present in the transfer list.
After fixing the reason for the abort, the handler must execute the following return
instruction irrespective of the processor operating state at the point of entry:
SUBS PC,R14_abt,#8
This action restores both the PC and the CPSR, and retries the aborted instruction.
The Software Interrupt instruction (SWI) is used to enter Supervisor mode, usually to
request a particular supervisor function. The SWI handler reads the opcode to extract
the SWI function number.
This action restores the PC and CPSR, and returns to the instruction following the SWI.
When the ARM7TDMI processor encounters an instruction that neither it, nor any
coprocessor in the system can handle, the ARM7TDMI core takes the undefined
instruction trap. Software can use this mechanism to extend the ARM instruction set by
emulating undefined coprocessor instructions.
After emulating the failed instruction, the trap handler executes the following
irrespective of the processor operating state:
MOVS PC,R14_und
This action restores the CPSR and returns to the next instruction after the undefined
instruction.
For more information about undefined instructions, see the ARM Architecture Reference
Manual.
Table 2-4 lists the exception vector addresses. In this table, I and F represent the
previous value of the IRQ and FIQ interrupt disable bits respectively in the CPSR.
When multiple exceptions arise at the same time, a fixed priority system determines the
order in which they are handled. The priority order is listed in Table 2-5.
Priority Exception
Highest Reset
Data Abort
FIQ
IRQ
Prefetch Abort
• The undefined instruction and SWI exceptions are mutually exclusive. Each
corresponds to a particular, non-overlapping, decoding of the current instruction.
• When FIQs are enabled, and a Data Abort occurs at the same time as an FIQ, the
ARM7TDMI processor enters the Data Abort handler, and proceeds immediately
to the FIQ vector.
A normal return from the FIQ causes the Data Abort handler to resume execution.
Data Aborts must have higher priority than FIQs to ensure that the transfer error
does not escape detection. You must add the time for this exception entry to the
worst-case FIQ latency calculations in a system that uses aborts to support virtual
memory.
When FIQs are enabled, the worst-case latency for FIQ comprises a combination of:
• The longest time the request can take to pass through the synchronizer, Tsyncmax
(four processor cycles).
• The time for the longest instruction to complete, Tldm. The longest instruction, is
an LDM which loads all the registers including the PC. Tldm is 20 cycles in a zero
wait state system.
• The time for the Data Abort entry, Texc (three cycles).
The total latency is therefore 29 processor cycles, just over 0.7 microseconds in a
system that uses a continuous 40MHz processor clock. At the end of this time, the
ARM7TDMI processor executes the instruction at 0x1c.
The maximum IRQ latency calculation is similar, but must allow for the fact that FIQ,
having higher priority, can delay entry into the IRQ handling routine for an arbitrary
length of time.
The minimum latency for FIQ or IRQ is the shortest time the request can take through
the synchronizer, Tsyncmin, plus Tfiq, a total of five processor cycles.
2.10 Reset
When the nRESET signal goes LOW a reset occurs, and the ARM7TDMI core
abandons the executing instruction and continues to increment the address bus as if still
fetching word or halfword instructions. nMREQ and SEQ indicates internal cycles
during this time.
1. Overwrites R14_svc and SPSR_svc by copying the current values of the PC and
CPSR into them. The values of the PC and CPSR are indeterminate.
2. Forces M[4:0] to b10011, Supervisor mode, sets the I and F bits, and clears the
T-bit in the CPSR.
After reset, all register values except the PC and CPSR are indeterminate.
This chapter describes the ARM7TDMI processor memory interface. It contains the
following sections:
• About the memory interface on page 3-2
• Bus interface signals on page 3-3
• Bus cycle types on page 3-4
• Addressing signals on page 3-11
• Address timing on page 3-14
• Data timed signals on page 3-17
• Stretching access times on page 3-29
• Action of ARM7TDMI core in debug state on page 3-31
• Privileged mode access on page 3-32
• Reset sequence after power up on page 3-33.
The ARM7TDMI processor uses both the rising and falling edges of MCLK.
Bus cycles can be extended using the nWAIT signal. This signal is described in
Stretching access times on page 3-29. All other sections of this chapter describe a
simple system in which nWAIT is permanently HIGH.
• memory request signals are broadcast in the bus cycle ahead of the bus cycle to
which they refer
• address class signals are broadcast half a clock cycle ahead of the bus cycle to
which they refer.
MCLK
APE
nMREQ
SEQ
A[31:0]
D[31:0]
The ARM7TDMI processor bus interface can perform four different types of bus cycle:
• a coprocessor register transfer cycle uses the data bus to communicate with a
coprocessor, but does not require any action by the memory system.
Bus cycle types are encoded on the nMREQ and SEQ signals as listed in Table 3-1.
A memory controller for the ARM7TDMI processor must commit to a memory access
only on an N-cycle or an S-cycle.
A nonsequential cycle is the simplest form of bus cycle, and occurs when the processor
requests a transfer to or from an address that is unrelated to the address used in the
preceding cycle. The memory controller must initiate a memory access to satisfy this
request.
The address class and (nMREQ and SEQ) signals that comprise an N-cycle are
broadcast on the bus. At the end of the next bus cycle the data is transferred between the
CPU and the memory. It is not uncommon for a memory system to require a longer
access time (extending the clock cycle) for nonsequential accesses. This is to allow time
for full address decoding or to latch both a row and column address into DRAM. This
is illustrated in Figure 3-2 on page 3-6.
Note
In Figure 3-2 on page 3-6, nMREQ and SEQ are highlighted where they are valid to
indicate the N-cycle.
N-cycle S-cycle
MCLK
A[31:0] a a+4
nMREQ
SEQ
nRAS
nCAS
D[31:0]
Sequential cycles are used to perform burst transfers on the bus. This information can
be used to optimize the design of a memory controller interfacing to a burst memory
device, such as a DRAM.
During a sequential cycle, the ARM7TDMI processor requests a memory location that
is part of a sequential burst. For the first cycle in the burst, the address can be the same
as the previous internal cycle. Otherwise the address is incremented from the previous
cycle:
• for a burst of word accesses, the address is incremented by 4 bytes
• for a burst of halfword accesses, the address is incremented by 2 bytes.
A burst always starts with an N-cycle or a merged IS-cycle (see Nonsequential cycles
on page 3-5), and continues with S-cycles. A burst comprises transfers of the same type.
The A[31:0] signal increments during the burst. The other address class signals are
unaffected by a burst.
All accesses in a burst are of the same data width, direction, and protection type. For
more details, see Addressing signals on page 3-11.
Memory systems can often respond faster to a sequential access and can require a
shorter access time compared to a nonsequential access. An example of a burst access
is shown in Figure 3-3.
nMREQ
SEQ
nRAS
nCAS
D[31:0]
During an internal cycle, the ARM7TDMI processor does not require a memory access,
as an internal function is being performed, and no useful prefetching can be performed
at the same time.
Where possible the ARM7TDMI processor broadcasts the address for the next access,
so that decode can start, but the memory controller must not commit to a memory
access. This is shown in Figure 3-4 and, is further described in Nonsequential memory
cycle on page 3-6.
nMREQ
SEQ
nRAS
nCAS
D[31:0]
I-cycle S-cycle
MCLK
A[31:0]
nMREQ
SEQ
nRAS
nCAS
D[31:0]
Note
When designing a memory controller, ensure that the design also works when an I-cycle
is followed by an N-cycle to a different address. This sequence can occur during
exceptions, or during writes to the PC. It is essential that the memory controller does
not commit to the memory cycle during an I-cycle.
During a coprocessor register transfer cycle, the ARM7TDMI processor uses the data
buses to transfer data to or from a coprocessor. A memory cycle is not required and the
memory controller does not initiate a transaction. The memory system must not drive
onto the data bus during a coprocessor register transfer cycle.
N-cycle C-cycle
MCLK
A[31:0]
nMREQ
SEQ
D[31:0]
Memory Memory Coprocessor
nMREQ
SEQ
nRAS
nCAS
D[31:0]
3.4.1 A[31:0]
A[31:0] is the 32-bit address bus that specifies the address for the transfer. All addresses
are byte addresses, so a burst of word accesses results in the address bus incrementing
by four for each cycle.
When a word access is signaled the memory system ignores the bottom two bits, A[1:0],
and when a halfword access is signaled the memory system ignores the bottom bit,
A[0].
All data values must be aligned on their natural boundaries. All words must be
word-aligned.
3.4.2 nRW
nRW specifies the direction of the transfer. nRW indicates an ARM7TDMI processor
write cycle when HIGH, and an ARM7TDMI processor read cycle when LOW. A burst
of S-cycles is always either a read burst, or a write burst. The direction cannot be
changed in the middle of a burst.
3.4.3 MAS[1:0]
The MAS[1:0] bus encodes the size of the transfer. The ARM7TDMI processor can
transfer word, halfword, and byte quantities.
All writable memory in an ARM7TDMI processor based system must support the
writing of individual bytes or halfwords to allow the use of the C Compiler and the
ARM debug tool chain, for example Multi-ICE.
The address produced by the processor is always a byte address. However, the memory
system must ignore the bottom redundant bits of the address. The significant address
bits are listed in Table 3-3.
00 Byte A[31:0]
01 Halfword A[31:1]
10 Word A[31:2]
11 Reserved -
Note
During instruction accesses the redundant address bits are undefined. The memory
system must ignore these redundant bits.
A writable memory system for the ARM7TDMI processor must have individual byte
write enables. Both the C Compiler and the ARM debug tool chain, for example,
Multi-ICE, assume that arbitrary bytes in the memory can be written. If individual byte
write capability is not provided, you might not be able to use either of these tools
without data corruption.
3.4.4 nOPC
The nOPC output conveys information about the transfer. An MMU can use this signal
to determine whether an access is an opcode fetch or a data transfer. This signal can be
used with nTRANS to implement an access permission scheme. The meaning of nOPC
is listed in Table 3-4.
nOPC Opcode/data
0 Opcode
1 Data
3.4.5 nTRANS
The nTRANS output conveys information about the transfer. A MMU can use this
signal to determine whether an access is from a privileged mode or User mode. This
signal can be used with nOPC to implement an access permission scheme. The
meaning of nTRANS is listed in Table 3-5.
nTRANS Mode
0 User
1 Privileged
More information relevant to the nTRANS signal and security is provided in Privileged
mode access on page 3-32.
3.4.6 LOCK
3.4.7 TBIT
TBIT is used to indicate the operating state of the ARM7TDMI processor. When in:
• ARM state, the TBIT signal is LOW
• Thumb state, the TBIT signal is HIGH.
Note
Memory systems do not usually have to use TBIT because MAS[1:0] indicates the size
of the instruction required.
Note
ARM Limited strongly recommends that pipelined address timing is used in new design
to obtain optimum system performance.
ARM Limited strongly recommends that ALE is tied HIGH and not used in new
designs.
Address depipelined configuration is controlled by the APE or ALE input signal. The
configuration is provided to ease the design of the ARM7TDMI processor in both
SRAM and DRAM-based systems.
APE affects the timing of the address bus A[31:0], plus nRW, MAS[1:0], LOCK,
nOPC, and nTRANS.
MCLK
APE
nMREQ
SEQ
A[31:0]
D[31:0]
SRAMs and ROMs require that the address is held stable throughout the memory cycle.
In a system containing SRAM and ROM only, APE can be tied permanently LOW,
producing the desired address timing. In this configuration the address becomes valid
after the falling edge of MCLK as shown in Figure 3-9 on page 3-15.
Note
The AMBA specification for Advanced High-performance Bus (AHB) and Advanced
System Bus (ASB) requires a pipelined address bus. This means that APE must be
configured HIGH.
MCLK
APE
nMREQ
SEQ
A[31:0]
D[31:0]
Many systems contain a mixture of DRAM, SRAM and ROM. To cater for the different
address timing requirements, APE can be safely changed during the LOW phase of
MCLK. Typically, APE is held at one level during a burst of sequential accesses to one
type of memory. When a nonsequential access occurs, the timing of most systems
enforce a wait state to allow for address decoding. As a result of the address decode,
APE can be driven to the correct value for the particular bank of memory being
accessed. The value of APE can be held until the memory control signals denote
another nonsequential access.
Previous ARM processors included the ALE signal, and this is retained for backwards
compatibility. This signal also enables you to modify the address timing to achieve the
same results as APE, but in a dynamic manner. To obtain clean MCLK low timing of
the address bus by this mechanism, ALE must be driven HIGH with the falling edge of
MCLK, and LOW with the rising edge of MCLK. ALE can simply be the inverse of
MCLK but the delay from MCLK to ALE must be carefully controlled so that the Tald
timing constraint is achieved. Figure 3-10 on page 3-16 shows how you can use ALE
to achieve SRAM compatible address timing. Refer to Chapter 7 AC and DC
Parameters for details of the exact timing constraints.
MCLK
APE
ALE
nMREQ
SEQ
A[31:0]
D[31:0]
Note
If ALE is to be used to change address timing, then you must tie APE HIGH. Similarly,
if APE is to be used, ALE must be tied HIGH.
You can obtain better system performance when the address pipeline is enabled with
APE HIGH. This allows longer time for address decoding.
Buffer control
EmbeddICE
Logic
DIN[31:0]
ARM7TDMI D[31:0]
Latch DOUT[31:0]
G
Latch control
When the bidirectional data bus is being used then you must disable the unidirectional
buses by driving BUSEN LOW. The timing of the bus for three cycles, load-store-load,
is shown in Figure 3-12 on page 3-18.
D[31:0]
When BUSEN is HIGH, all instructions and input data are presented on the input data
bus, DIN[31:0]. The timing of this data is similar to that of the bidirectional bus when
in input mode. Data must be set up and held to the falling edge of MCLK. For the exact
timing requirements refer to Chapter 7 AC and DC Parameters.
In this configuration, all output data is presented on DOUT[31:0]. The value on this bus
only changes when the processor performs a store cycle. Again, the timing of the data
is similar to that of the bidirectional data bus. The value on DOUT[31:0] changes after
the falling edge of MCLK.
DIN[31:0] D1 D2
DOUT[31:0] Dout
D[31:0] D1 Dout D2
When the unidirectional data buses are being used, and BUSEN is HIGH, the
bidirectional bus, D[31:0], must be left unconnected.
The unidirectional buses are typically used internally in ASIC embedded applications.
Externally, most systems still require a bidirectional data bus to interface to external
memory. Figure 3-14 on page 3-19 shows how you can join the unidirectional buses up
at the pads of an ASIC to connect to an external bidirectional bus.
nENOUT
PAD
DOUT[31:0]
XDATA[31:0]
ARM7TDMI
DIN[31:0]
When BUSEN is LOW, the buffer between DIN[31:0] and D[31:0] is disabled. Any
data presented on DIN[31:0] is ignored. Also, when BUSEN is LOW, the value on
DOUT[31:0] is forced to 0x00000000.
memory cycle
MCLK
A[31:0]
nRW
nENOUT
D[31:0]
ARM7TDMI
scan
DBE
cell
scan
nENIN
cell
TBE
write data
D[31:0]
from core
read data to
core
The macrocell has an additional bus control signal, nENIN that allows the external
system to manually tristate the bus. In the simplest systems, nENIN can be tied LOW
and nENOUT can be ignored. In many applications, when the external data bus is a
shared resource, greater control might be required. In this situation, nENIN can be used
to delay when the external bus is driven.
Note
For backwards compatibility, DBE is also included. At the macrocell level, DBE and
nENIN have almost identical functionality and in most applications one can be tied to
keep the data bus enabled.
The processor has another output control signal called TBE. This signal is usually only
used during test and must be tied HIGH when not in use. When driven LOW, TBE
forces all tristateable outputs to high impedance, it is as though both DBE and ABE
have been driven LOW, causing the data bus, the address bus, and all other signals
normally controlled by ABE to become high impedance.
Note
There is no scan cell on TBE. Therefore, TBE is completely independent of scan data
and can be used to put the outputs into a high impedance state while scan testing takes
place.
Connecting the ARM7TDMI processor data bus, D[31:0] to an external shared bus
requires additional logic that varies between applications in the case of a test chip.
In this application, care must be taken to prevent bus clash on D[31:0] when the data
bus drive changes direction. The timing of nENIN, and the pad control signals must be
arranged so that when the core starts to drive out, the pad drive onto D[31:0] is disabled
before the core starts to drive. Similarly, when the bus switches back to input, the core
must stop driving before the pad is enabled.
The circuit implemented in the ARM7TDMI processor test chip is shown in Figure 3-17
on page 3-23.
Vdd
scan DBE nEDBE
cell EDBE
nEN2
scan nENOUT
cell
scan nENIN
nEN1
cell
Vdd Vss Pad
TBE
XD[31:0]
D[31:0]
Note
At the core level, TBE and DBE are inactive, tied HIGH, because in a packaged part
you do not have to manually force the internal buses into a high impedance state. At the
pad level, the test chip signal EDBE is used by the bus control logic to allow the external
memory controller to arbitrate the bus and asynchronously disable the ARM7TDMI
core test chip if necessary.
3.6.2 ABORT
If ABORT is asserted on a data access, it causes the processor to take the Data Abort
trap. If it is asserted on an opcode fetch, the abort is tracked down the pipeline, and the
Prefetch Abort trap is taken if the instruction is executed.
To ease the connection of the ARM7TDMI core to sub-word sized memory systems,
input data and instructions can be latched on a byte-by-byte basis. This is achieved by
the use of the BL[3:0] signal as follows:
• BL[3] controls the latching of the data present on D[31:24]
• BL[2] controls the latching of the data present on D[23:16]
• BL[1] controls the latching of the data present on D[15:8]
• BL[0] controls the latching of the data present on D[7:0].
Note
It is recommended that BL[3:0] is tied HIGH in new designs and word values from
narrow memory systems are latched onto latches that are external to the ARM7TDMI
core.
In a memory system that only contains word-wide memory, BL[3:0] can be tied HIGH.
For sub-word wide memory systems, the BL[3:0] signals are used to latch the data as it
is read out of memory. For example, a word access to halfword wide memory must take
place in two memory cycles:
• in the first cycle, the data for D[15:0] is obtained from the memory and latched
into the core on the falling edge of MCLK when BL[1:0] are both HIGH.
• in the second cycle, the data for D[31:16] is latched into the core on the falling
edge of MCLK when BL[3:2] are both HIGH and BL[1:0] are both LOW.
In Figure 3-18 on page 3-25, a word access is performed from halfword wide memory
in two cycles:
• in the first cycle, the read data is applied to the lower half of the bus
• in the second cycle, the read data is applied to the upper half of the bus.
Because two memory cycles are required, nWAIT is used to stretch the internal
processor clock. nWAIT does not affect the operation of the data latches. Using this
method, data can be taken from memory as word, halfword, or byte at a time and the
memory can have as many wait states as required. In multi-cycle memory accesses,
nWAIT must be held LOW until the final part is latched.
In the example shown in Figure 3-18, the BL[3:0] signals are driven to value 0x3 in the
first cycle so that only the latches on D[15:0] are open. BL[3:0] can be driven to value
0xF and all of the latches opened. This does not affect the operation of the core because
the latches on D[31:16] are written with the correct data during the second cycle.
Note
BL[3:0] must be held HIGH during store cycles.
MCLK
APE
nMREQ
SEQ
A[31:0]
nWAIT
D[15:0]
D[31:16]
Figure 3-19 on page 3-26 shows a halfword load from single-wait state byte wide
memory. In the figure, each memory access takes two cycles:
• in the first access:
— BL[3:0] are driven to 0xF
— the correct data is latched from D[7:0]
— unknown data is latched from D[31:8].
• in the second cycle, the byte for D[15:8] is latched so the halfword on D[15:0] is
correctly read from memory. It does not matter that D[31:16] are unknown
because the core only extracts the halfword that it is interested in.
MCLK
APE
nMREQ
SEQ
A[31:0]
nWAIT
D[7:0]
D[15:8]
The processor indicates the size of a transfer by use of the MAS[1:0] signal as described
in MAS[1:0] on page 3-11.
Reads
When a halfword or byte read is performed, a 32-bit memory system can return the
complete 32-bit word, and the processor extracts the valid halfword or byte field from
it. The fields extracted depend on the state of the BIGEND signal, which determines
the endian configuration of the system. See Memory formats on page 2-4.
A word read from 32-bit memory presents the word value on the whole data bus as listed
in Table 3-7.
When connecting 8-bit to 16-bit memory systems to the processor, ensure that the data
is presented to the correct byte lanes on the core as listed in Table 3-7 on page 3-27.
01 1X D[31:16] D[15:0]
00 01 D[15:8] D[23:16]
00 10 D[23:16] D[15:8]
00 11 D[31:24] D[7:0]
Note
For subword reads the value is placed in the ARM register in the least significant bits
regardless of the byte lane used to read the data. For example, a byte read on A[1:0] =
01 in a little-endian system means that the byte is read on bits D[15:8] but is placed in
the ARM register bits [7:0].
Writes
When the ARM7TDMI processor performs a byte or halfword write, the data being
written is replicated across the data bus, as shown in Figure 3-20 on page 3-28. The
memory system can use the most convenient copy of the data.
A writable memory system must be capable of performing a write to any single byte in
the memory system. This capability is required by the ARM C Compiler and the debug
tool chain.
Bits 31 24 23 16 15 8 7 0
A B C D ARM
register
D
Memory
interface
D D D D
D[31:24] D[23:16] D[15:8] D[7:0]
CD
Memory
CD CD interface
D[31:16] D[15:0]
ABCD
Memory
interface
ABCD
D[31:0]
Note
If you wish to use an Embedded Trace Macrocell (ETM) to obtain instruction and data
trace information on a trace port then you must use the nWAIT signal to stretch access
times.
All memory timing is defined by MCLK, and long access times can be accommodated
by stretching this clock. It is usual to stretch the LOW period of MCLK, as this allows
the memory manager to abort the operation if the access is eventually unsuccessful.
MCLK can be stretched before being applied to the processor, or the nWAIT input can
be used together with a free-running MCLK. Taking nWAIT LOW has the same effect
as stretching the LOW period of MCLK.
The pipelined nature of the processor bus interface means that there is a distinction
between clock cycles and bus cycles. nWAIT can be used to stretch a bus cycle, so that
it lasts for many clock cycles. The nWAIT input allows the timing of bus cycles to be
extended in increments of complete MCLK cycles:
• when nWAIT is HIGH on the falling edge of MCLK, a bus cycle completes
• when nWAIT is LOW, the bus cycle is extended by stretching the low phase of
the internal clock.
In the pipeline, the address class signals and the memory request signals are ahead of
the data transfer by one bus cycle. In a system using nWAIT this can be more than one
MCLK cycle. This is illustrated in Figure 3-21 on page 3-30, which shows nWAIT
being used to extend a nonsequential cycle. In the example, the first N-cycle is followed
a few cycles later by another N-cycle to an unrelated address, and the address for the
second access is broadcast before the first access completes.
S S N S S N S
MCLK
nWAIT
nMREQ
SEQ
nRW
D[31:0]
nRAS
nCAS
Note
When designing a memory controller, you are strongly advised to sample the values of
nMREQ, SEQ, and the address class signals only when nWAIT is HIGH. This ensures
that the state of the memory controller is not accidentally updated during an extended
bus cycle.
The BIGEND signal must not be changed by the system during debug. If BIGEND
changes, not only is there a synchronization problem but the programmer view of the
processor changes without the knowledge of the debugger. Signal nRESET must also
be held stable during debug. If nRESET is driven LOW then the state of the processor
changes without the knowledge of the debugger.
When instructions are executed in debug state, all bus interface outputs, except
nMREQ and SEQ, change asynchronously to the memory system. For example, every
time a new instruction is scanned into the pipeline, the address bus changes. Although
this is asynchronous it does not affect the system as nMREQ and SEQ are forced to
indicate internal cycles regardless of what the rest of the processor is doing. The
memory controller must be designed to ensure that this asynchronous behavior does not
affect the rest of the system.
The reason that this is recommended is that if the Operating System (OS) accesses
memory on behalf of the current application then it must perform these accesses in User
mode. This is achieved using the LDRT and STRT instructions that set nTRANS
appropriately.
This measure avoids the possibility of a hacker deliberately passing an invalid pointer
to an OS and getting the OS to access this memory with privileged access. This
technique could otherwise be used by a hacker to enable the user application to access
any memory locations such as I/O space.
The least significant five bits of the CPSR are also output from the core as inverted
signals, nM[4:0]. These indicate the current processor mode as listed in Table 3-8.
Note
The only time to use the nM[4:0] signals is for diagnostic and debug purposes.
During reset, the signals nMREQ and SEQ show internal cycles where the address bus
continues to increment by two or four bytes. The initial address and increment values
are determined by the state of the core when nRESET was asserted. They are undefined
after power up.
After nRESET has been taken HIGH, the ARM core does two further internal cycles
before the first instruction is fetched from the reset vector (address 0x00000000). It then
takes three MCLK cycles to advance this instruction through the
Fetch-Decode-Execute stages of the ARM instruction pipeline before this first
instruction is executed. This is shown in Figure 3-22.
Note
nRESET must be held asserted for a minimum of two MCLK cycles to fully reset the
core.
You must reset the EmbeddedICE Logic and the TAP controller as well, whether the
debug features are used or are not. This is done by taking nTRST LOW for at least Tbsr,
no later than nRESET.
nRESET
A[31:0] x y z 0 4 8
D[31:0]
nMREQ
SEQ
nEXEC
This chapter describes the ARM7TDMI core coprocessor interface. It contains the
following sections:
• About coprocessors on page 4-2
• Coprocessor interface signals on page 4-4
• Pipeline following signals on page 4-5
• Coprocessor interface handshaking on page 4-6
• Connecting coprocessors on page 4-12
• If you are not using an external coprocessor on page 4-15
• Undefined instructions on page 4-16
• Privileged instructions on page 4-17.
A coprocessor is connected to the same data bus as the ARM7TDMI processor in the
system, and tracks the pipeline in the ARM7TDMI processor. This means that the
coprocessor can decode the instructions in the instruction stream, and execute those that
it supports. Each instruction progresses down both the ARM7TDMI core pipeline and
the coprocessor pipeline at the same time.
The execution of instructions is shared between the ARM7TDMI core and the
coprocessor.
1. Evaluates the instruction type and the condition codes to determine whether the
instructions are executed by the coprocessor, and communicates this to any
coprocessors in the system, using nCPI.
The coprocessor:
2. Indicates whether it can accept the instruction by using CPA and CPB.
Other coprocessor numbers have also been reserved. Coprocessor availability is listed
in Table 4-1.
14 Debug controller
13:8 Reserved
3:0 Reserved
If you intend to design a coprocessor send an email with coprocessor in the subject line
to info@arm.com for up-to-date information on which coprocessor numbers have been
allocated.
It is essential that the two pipelines remain in step at all times. When designing a
pipeline follower for a coprocessor, the following rules must be observed:
• At reset, with nRESET LOW, the pipeline must either be marked as invalid, or
filled with instructions that do not decode to valid instructions for that
coprocessor.
• The coprocessor state must only change when nWAIT is HIGH, except during
reset.
• An instruction must be loaded into the pipeline on the falling edge of MCLK, and
only when nOPC, nMREQ, and TBIT were all LOW in the previous bus cycle.
These conditions indicate that this cycle is an ARM instruction fetch, so the new
opcode must be read into the pipeline.
• The pipeline must be advanced on the falling edge of MCLK when nOPC,
nMREQ and TBIT are all LOW in the current bus cycle.
These conditions indicate that the current instruction is about to complete
execution, because the first action of any instruction performing an instruction
fetch is to refill the pipeline.
Any instructions that are flushed from the ARM7TDMI processor pipeline:
There are no coprocessor instructions in the Thumb instruction set, and so coprocessors
must monitor the state of the TBIT signal to ensure that they do not decode pairs of
Thumb instructions as ARM instructions.
The ARM7TDMI core and any coprocessors in the system perform a handshake using
the signals shown in Table 4-2.
These signals are explained in more detail in Coprocessor signaling on page 4-7.
The coprocessor decodes the instruction currently in the Decode stage of its pipeline,
and checks whether that instruction is a coprocessor instruction. A coprocessor
instruction contains a coprocessor number that matches the coprocessor ID of the
coprocessor.
2. The coprocessor handshakes with the ARM7TDMI core using CPA and CPB.
Note
The coprocessor can drive CPA and CPB as soon as it decodes the instruction. It does
not have to wait for nCPI to be LOW but it must not commit to execute the instruction
until nCPI has gone LOW.
Coprocessor instructions progress down the ARM7TDMI core pipeline in step with the
coprocessor pipeline. A coprocessor instruction is executed if the following are true:
1. The coprocessor instruction has reached the Execute stage of the pipeline. It
might not if it is preceded by a branch.
If all these requirements are met, the ARM7TDMI core signals by taking nCPI LOW,
this commits the coprocessor to the execution of the coprocessor instruction.
0 0 Coprocessor present If a coprocessor can accept an instruction, and can start that instruction
immediately, it must signal this by driving both CPA and CPB LOW. The
ARM7TDMI processor then ignores the coprocessor instruction and
executes the next instruction as normal.
0 1 Coprocessor busy If a coprocessor can accept an instruction, but is currently unable to process
that request, it can stall the ARM7TDMI processor by asserting busy-wait.
This is signaled by driving CPA LOW, but leaving CPB HIGH. When the
coprocessor is ready to start executing the instruction it signals this by
driving CPB LOW. This is shown in Figure 4-1 on page 4-8.
1 0 Invalid response -
1 1 Coprocessor absent If a coprocessor cannot accept the instruction currently in Decode it must
leave CPA and CPB both HIGH. The ARM7TDMI processor takes the
undefined instruction trap.
MCLK
Execute
ADD SUB CDP TST SUB
stage
nCPI
CPA
CPB
Instr fetch Instr fetch Instr fetch Instr fetch Instr fetch
D[31:0] (ADD) (SUB) (CDP) (TST) (SUB)
Instr fetch Instr fetch
Coprocessor
busy waiting
CPA and CPB are ignored by the ARM7TDMI processor when it does not have a
undefined or coprocessor instruction in the Execute stage of the pipeline.
Caution
It is essential that any action taken by the coprocessor while it is busy-waiting is
idempotent. This means that the actions taken by the coprocessor must not corrupt the
state of the coprocessor, and must be repeatable with identical results. The coprocessor
can only change its own state once the instruction has been executed.
The ARM7TDMI processor usually returns from processing the interrupt to retry the
coprocessor instruction. Other coprocessor instructions can be executed before the
interrupted instruction is executed again.
The coprocessor register transfer instructions, MCR and MRC, are used to transfer data
between a register in the ARM7TDMI processor register bank and a register in the
coprocessor register bank. An example sequence for a coprocessor register transfer is
shown in Figure 4-2.
MCLK
nCPI
CPA
CPB
MCLK
nCPI
(from ARM)
CPA (from
coprocessor)
CPB (from
coprocessor)
Instr fetch Instr fetch Instr fetch Instr fetch Instr fetch
D[31:0] (ADD) (SUB) (MCR) (TST) (SUB)
Instr fetch
The coprocessor load and store instructions are used to transfer data between a
coprocessor and memory. They can be used to transfer either a single word of data, or
a number of the coprocessor registers. There is no limit to the number of words of data
that can be transferred by a single LDC or STC instruction, but by convention no more
than 16 words should be transferred in a single instruction. An example sequence is
shown in Figure 4-4 on page 4-11.
Note
If you transfer more than 16 words of data in a single instruction, the worst case
interrupt latency of the ARM7TDMI processor increases.
MCLK
Decode
ADD SUB LDC TST SUB
stage
Execute
ADD SUB LDC TST SUB
stage
nCPI
CPA
CPB
Instr fetch Instr fetch Instr fetch Instr fetch Instr fetch
D[31:0] (ADD) (SUB) (LDC) (TST) (SUB)
CP Data CP Data CP Data CP Data Instr fetch
D[31:0] Memory
ARM core
system
CPDRIVE
Coprocessor
ASEL
0
DIN
0 1
Coprocessor
If you have multiple coprocessors in your system, connect the handshake signals as
follows:
CPA CPAn
nCPI
ARM core
CPB CPBn
CPB2
The coprocessor outputs from the ARM7TDMI processor are usually left unconnected
but these outputs can be used in other parts of a system as follows:.
• nCPI
• nOPC
• TBIT.
The coprocessor must check bit 27 of the instruction to differentiate between the
following instruction types:
• undefined instructions have 0 in bit 27
• coprocessor instructions have 1 in bit 27.
Coprocessor instructions are not supported in the Thumb instruction set but undefined
instructions are. All coprocessors must monitor the state of the TBIT output from
ARM7TDMI core. When the ARM7TDMI core is in Thumb state, coprocessors must
drive CPA and CPB HIGH, and the instructions seen on the data bus must be ignored.
In this way, coprocessors do not execute Thumb instructions in error, and all undefined
instructions are handled correctly.
nTRANS Meaning
If used, the nTRANS signal must be sampled at the same time as the coprocessor
instruction is fetched and is used in the coprocessor pipeline Decode stage.
Note
If a User mode process, with nTRANS LOW, tries to access a coprocessor instruction
that can only be executed in a privileged mode, the coprocessor responds with CPA and
CPB HIGH. This causes the ARM7TDMI processor to take the undefined instruction
trap.
This chapter describes the ARM7TDMI processor debug interface. It contains the
following sections:
• About the debug interface on page 5-2
• Debug systems on page 5-4
• Debug interface signals on page 5-6
• ARM7TDMI core clock domains on page 5-10
• Determining the core and system state on page 5-12.
This chapter also describes the ARM7TDMI processor EmbeddedICE Logic module in
the following sections:
• About EmbeddedICE Logic on page 5-13
• Disabling EmbeddedICE on page 5-15
• Debug Communications Channel on page 5-16.
The debug extensions enable you to force the core into debug state. In debug state, the
core is stopped and isolated from the rest of the system. This allows the internal state of
the core and the external state of the system, to be examined while all other system
activity continues as normal. When debug has completed, the debug host restores the
core and system state, program execution resumes.
A request on one of the external debug interface signals, or on an internal functional unit
known as the EmbeddedICE Logic, forces the ARM7TDMI processor into debug state.
The events that activate debug are:
• a breakpoint, an instruction fetch
• a watchpoint, a data access
• an external debug request.
The internal state of the ARM7TDMI processor is then examined using a JTAG-style
serial interface. This allows instructions to be inserted serially into the core pipeline
without using the external data bus. So, for example, when in debug state, a Store
Multiple (STM) can be inserted into the instruction pipeline and this exports the
contents of the ARM7TDMI core registers. This data can be serially shifted out without
affecting the rest of the system.
5.1.2 Clocks
During normal operation, the core is clocked by MCLK and internal logic holds DCLK
LOW.
When the ARM7TDMI processor is in the debug state, the core is clocked by DCLK
under control of the TAP state machine and MCLK can free run. The selected clock is
output on the signal ECLK for use by the external system.
Note
nWAIT has no effect if the CPU core is being debugged and is running from DCLK.
Protocol
For example Multi-ICE
converter
Development system
Debug target containing an
ARM7TDMI processor
The debug host is a computer that is running a software debugger such as the ARM
Debugger for Windows (ADW). The debug host allows you to issue high-level
commands such as setting breakpoints or examining the contents of memory.
The protocol converter communicates with the high-level commands issued by the
debug host and the low-level commands of the ARM7TDMI processor JTAG interface.
Typically it interfaces to the host through an interface such as an enhanced parallel port.
The ARM7TDMI processor has hardware extensions that ease debugging at the lowest
level. The debug extensions:
• allow you to halt program execution
• examine and modify the core internal state of the core
• view and modify the state of the memory system
• resume program execution.
The major blocks of the debug target are shown in Figure 5-2.
Scan chain 0
EmbeddedICE
Logic Main processor
Scan chain 1 logic
Scan chain 2
TAP controller
• BREAKPT and DBGRQ are system requests for the processor to enter debug
state
You can use the EmbeddedICE Logic to program the conditions under which a
breakpoint or watchpoint can occur. Alternatively, you can use the BREAKPT signal
to allow external logic to flag breakpoints or watchpoints and monitor the following:
• address bus
• data bus
• control signals.
The timing is the same for externally-generated breakpoints and watchpoints. Data must
always be valid on the falling edge of MCLK. When this is an instruction to be
breakpointed, the BREAKPT signal must be HIGH on the next rising edge of MCLK.
Similarly, when the data is for a load or store, asserting BREAKPT on the rising edge
of MCLK marks the data as watchpointed.
When the processor enters debug state, the DBGACK signal is asserted. The timing for
an externally-generated breakpoint is shown in Figure 5-3 on page 5-7.
MCLK
A[31:0]
D[31:0]
BREAKPT
DBGACK
nMREQ
Memory cycles Internal cycles
SEQ
The ARM7TDMI core marks instructions as being breakpointed as they enter the
instruction pipeline, but the core does not enter debug state until the instruction reaches
the Execute stage.
Breakpointed instructions are not executed. Instead, the processor enters debug state.
When you examine the internal state, you see the state before the breakpointed
instruction. When your examination is complete, remove the breakpoint. This is usually
handled automatically by the debugger which also restarts program execution from the
previously-breakpointed instruction.
When a breakpointed conditional instruction reaches the Execute stage of the pipeline,
the breakpoint is always taken.
Note
The processor enters debug state regardless of whether the condition is met.
A breakpointed instruction does not cause the ARM7TDMI core to enter debug state
when:
• An exception occurs, causing the processor to flush the instruction pipeline and
cancel the breakpoint. In normal circumstances, on exiting from an exception, the
ARM7TDMI core branches back to the next instruction to be executed before the
exception occurred. In this case, the pipeline is refilled and the breakpoint is
reflagged.
Watchpoints occur on data accesses. A watchpoint is always taken, but the core might
not enter debug state immediately. In all cases, the current instruction completes. If the
current instruction is a multi-word load or store, with an LDM or STM, many cycles can
elapse before the watchpoint is taken.
When a watchpoint occurs, the current instruction completes, and all changes to the core
state are made, load data is written into the destination registers and base write-back
occurs.
Note
Watchpoints are similar to Data Aborts. The difference is that when a Data Abort
occurs, although the instruction completes, the processor prevents all subsequent
changes to the ARM7TDMI processor state. This action allows the abort handler to cure
the cause of the abort and the instruction to be re-executed.
If a watchpoint occurs when an exception is pending, the core enters debug state in the
same mode as the exception.
The ARM7TDMI processor can be forced into debug state on debug request in either of
the following ways:
The DBGRQ pin is an asynchronous input and is therefore synchronized by logic inside
the ARM7TDMI processor before it takes effect. Following synchronization, the core
normally enters debug state at the end of the current instruction. However, if the current
instruction is a busy-waiting access to a coprocessor, the instruction terminates and
ARM7TDMI processor enters debug state immediately. This is similar to the action of
nIRQ and nFIQ.
When the ARM7TDMI core enters debug state, the core forces nMREQ and SEQ to
indicate internal cycles. This action allows the rest of the memory system to ignore the
core and to function as normal. Because the rest of the system continues to operate, the
ARM7TDMI is forced to ignore aborts and interrupts.
The system must not change the BIGEND signal during debug because the debugger is
unaware that the core has been reconfigured.
nRESET must be held stable during debug because resetting the core while debugging
causes the debugger to lose track of the core.
When the system applies reset to the ARM7TDMI processor, with nRESET driven
LOW, the processor state changes with the debugger unaware that the core has reset.
When instructions are executed in debug state, all memory interface outputs, except
nMREQ and SEQ, change asynchronously to the memory system. For example, every
time a new instruction is scanned into the pipeline, the address bus changes. Although
this is asynchronous it does not affect the system, as nMREQ and SEQ are forced to
indicate internal cycles regardless of what the rest of the core is doing. The memory
controller must be designed to ensure that this asynchronous behavior does not affect
the rest of the system.
When the ARM7TDMI processor enters debug state, it switches automatically from
MCLK to DCLK, it then asserts DBGACK in the HIGH phase of MCLK. The switch
between the two clocks occurs on the next falling edge of MCLK. This is shown in
Figure 5-4.
The core is forced to use DCLK as the primary clock until debugging is complete. On
exit from debug, the core must be allowed to synchronize back to MCLK. This must be
done by the debugger in the following sequence:
1. The final instruction of the debug sequence is shifted into the data bus scan chain
and clocked in by asserting DCLK.
The core now automatically resynchronizes back to MCLK and starts fetching
instructions from memory at MCLK speed.
MCLK
DBGACK
DCLK
ECLK
Multiplexer
switching point
When serial test patterns are being applied to the ARM7TDMI core through the JTAG
interface, the processor must be clocked using DCLK, MCLK must be held LOW.
Entry into test is less automatic than debug and you must take care to prevent spurious
clocking on the way into test.
The TAP controller can now be used to serially test the processor. If scan chain 0 and
INTEST are selected, DCLK is generated while the state machine is in the
RUN-TEST/IDLE state. During EXTEST, DCLK is not generated.
On exit from test, RESTART must be selected as the TAP controller instruction. When
this is done, MCLK can be resumed. After INTEST testing, you must take care to
ensure that the core is in a sensible state before reverting to normal operation. The safest
ways to do this is are by using one of the following:
• select RESTART, then cause a system reset
• insert MOV PC, #0 into the instruction pipeline before reverting.
Before you can examine the core and system state, the debugger must determine
whether the processor entered debug from Thumb state or ARM state, by examining
bit 4 of the EmbeddedICE Logic debug status register. When bit 4 is HIGH, the core has
entered debug from Thumb state.
For more details about determining the core state, see Determining the core and system
state on page B-24.
DBGRQI
DBGRQI
A[31:0]
D[31:0]
nOPC EXTERN1
nRW EXTERN0
TBIT RANGEOUT0
EmbeddedICE
ARM7TDM MAS[1:0] RANGEOUT1
Logic
nTRANS DBGACK
DBGACKI BREAKPT
BREAKPTI DBGRQ
IFEN DBGEN
ECLK
nMREQ
TCK
TMS
nTRST TAP
TDI
TDO
The debug control register and the debug status register provide overall control of
EmbeddedICE operation.
You can program one or both watchpoint units to halt the execution of instructions by
the core. Execution halts when the values programmed into EmbeddedICE match the
values currently appearing on the address bus, data bus, and various control signals.
Note
You can mask any bit so that its value does not affect the comparison.
You can configure each watchpoint unit for either a watchpoint or a breakpoint.
Watchpoints and breakpoints can be data-dependent.
Caution
Hard-wiring the DBGEN input LOW permanently disables the EmbeddedICE Logic.
However, you must not rely upon this for system security.
These registers are located in fixed locations in the EmbeddedICE Logic register map,
as shown in Figure B-7 on page B-41, and are accessed from the processor using MCR
and MRC instructions to coprocessor 14.
EmbeddedICE Control
version Reserved bits
31 30 29 28 27 2 1 0
0 0 0 1 • • W R
DCC data read register
Bits 31:28 Contain a fixed pattern that denotes the EmbeddedICE version
number, in this case 0001.
Bit 1 If W is clear, the DCC data write register is ready to accept data
from the processor.
If W is set, there is data in the DCC data write register and the
debugger can scan it out.
Bit 0 If R is clear, the DCC data read register is free and data can be
placed there from the debugger.
If R is set, DCC data read register has data that has not been read
by the processor and the debugger must wait.
From the point of view of the debugger, the registers are accessed through scan chain 2
in the usual way. From the point of view of the processor, these registers are accessed
through coprocessor register transfer instructions.
Use the instructions listed in Table 5-1 to access the DCC registers.
Instructions Explanation
MRC CP14, 0, Rd, C0, C0, 0 Places the value from the DCC control register into the destination register (Rd)
MCR CP14, 0, Rn, C1, C0, 0 Writes the value in the source register (Rn) to the DCC data write register
MRC CP14, 0, Rd, C1, C0, 0 Returns the value in the DCC data read register into Rd
Because the Thumb instruction set does not contain coprocessor instructions, you are
advised to access this data through SWI instructions when in Thumb state.
You can send and receive messages through the DCC. The following sections describe:
• Sending a message to the debugger on page 5-18
• Receiving a message from the debugger on page 5-18
• Interrupt driven use of the DCC on page 5-18.
When the processor has to send a message to the debugger, it must check that the
communications data write register is free for use by finding out if the W bit of the
debug communications control register is clear.
The processor reads the DCC control register to check status of the bit 1:
If the W bit is clear then the communications data write register is clear.
• If the W bit is set, previously written data has not been read by the debugger. The
processor must continue to poll the control register until the W bit is clear.
As the data transfer occurs from the processor to the DCC data write register, the W bit
is set in the DCC control register. When the debugger polls this register it sees a
synchronized version of both the R and W bit. When the debugger sees that the W bit
is set, it can read the DCC data write register and scan the data out. The action of reading
this data register clears the W bit of the DCC control register. At this point, the
communications process can begin again.
• if the R bit is clear, the DCC data read register is free and data can be placed there
for the processor to read
• if the R bit is set, previously deposited data has not yet been collected, so the
debugger must wait.
When the DCC data read register is free, data is written there using the JTAG interface.
The action of this write sets the R bit in the DCC control register.
The processor polls the DCC control register. If the R bit is set, there is data that can be
read using an MRC instruction to coprocessor 14. The action of this load clears the R
bit in the DCC control register. When the debugger polls this register and sees that the
R bit is clear, the data has been taken and the process can now be repeated.
• the DCC data write register is empty and available for use.
These outputs are usually connected to the system interrupt controller, that drives the
nIRQ and nFIQ ARM7TDMI processor inputs.
• nMREQ and SEQ, are pipelined up to one cycle ahead of the cycle to which they
apply. They are shown in the cycle in which they appear and indicate the next
cycle type.
• The address, MAS[1:0], nRW, nOPC, nTRANS, and TBIT signals, that appear
up to half a cycle ahead, are shown in the cycle to which they apply. The address
is incremented to prefetch instructions in most cases. Because the instruction
width is four bytes in ARM state and two bytes in Thumb state, the increment
varies accordingly.
• The letter i is used to indicate the width of the instruction fetch output by
MAS[1:0]:
— i=2 in ARM state represents word accesses
— i=1 in Thumb state represents halfword accesses.
During the second cycle a fetch is performed from the branch destination, and the return
address is stored in register 14 if the link bit is set.
The third cycle performs a fetch from the destination +L, refilling the instruction
pipeline. If the instruction is a branch with link (R14 is modified) four is subtracted from
R14 to simplify the return instruction from SUB PC,R14,#4 to MOV PC,R14. This allows
subroutines to push R14 onto the stack and pop directly into PC upon completion.
1 pc+2L i 0 (pc+2L) 0 0 0
2 alu i 0 (alu) 0 1 0
3 alu+L i 0 (alu+L) 0 1 0
alu+2L
Note
Branch with link is not available in Thumb state.
The first instruction acts like a simple data operation to add the PC to the upper part of
the offset, storing the result in Register 14, LR.
The second instruction which takes a single cycle acts in a similar fashion to the ARM
state branch with link instruction. The first cycle therefore calculates the final branch
destination whilst performing a prefetch from the current PC.
The second cycle of the second instruction performs a fetch from the branch destination
and the return address is stored in R14.
The third cycle of the second instruction performs a fetch from the destination +2,
refilling the instruction pipeline and R14 is modified, with 2 subtracted from it, to
simplify the return to MOV PC, R14. This makes the PUSH {..,LR} ; POP {..,PC} type of
subroutine work correctly.
The cycle timings of the complete operation are listed in Table 6-2 where:
• pc is the address of the first instruction of the operation.
1 pc+4 1 0 (pc+4) 0 1 0
2 pc+6 1 0 (pc+6) 0 0 0
3 alu 1 0 (alu) 0 1 0
4 alu+2 1 0 (alu+2) 0 1 0
alu+4
During the second cycle, a fetch is performed from the branch destination address using
the new instruction width, dependent on the state that has been selected.
The third cycle performs a fetch from the destination address +2 or +4 (dependent on
the new specified state), refilling the instruction pipeline.
• W and w represent the instruction width before and after the BX respectively. The
width equals four bytes in ARM state and two bytes in Thumb state. For example,
when changing from ARM to Thumb state, W equals four and w equals two
• I and i represent the memory access size before and after the BX respectively.
MAS[1:0] equals two in ARM state and one in Thumb state. When changing
from Thumb to ARM state, I equals one and i equals two.
• T and t represent the state of the TBIT before and after the BX respectively. TBIT
equals 0 in ARM state and 1 in Thumb state. When changing from ARM to
Thumb state, T equals 0 and t equals 1.
1 pc + 2W I 0 (pc+2W) 0 0 0 T
2 alu i 0 (alu) 0 1 0 t
3 alu+w i 0 (alu+w) 0 1 0 t
alu + 2w
Note
Compare and test operations do not produce results. Only the ALU status flags are
affected.
An instruction prefetch occurs at the same time as the data operation, and the program
counter is incremented.
When the shift length is specified by a register, an additional datapath cycle occurs
during this cycle. The data operation occurs on the next cycle which is an internal cycle
that does not access memory. This internal cycle can be merged with the following
sequential access by the memory manager as the address remains stable through both
cycles.
The PC can be one or more of the register operands. When it is the destination, external
bus activity can be affected. If the result is written to the PC, the contents of the
instruction pipeline are invalidated, and the address for the next instruction prefetch is
taken from the ALU rather than the address incrementer. The instruction pipeline is
refilled before any further execution takes place, and during this time exceptions are
ignored.
PSR transfer operations (MSR and MRS) exhibit the same timing characteristics as the
data operations except that the PC is never used as a source or destination register.
The cycle timings are listed in Table 6-4 on page 6-8 where:
• pc is the address of the branch instruction
• alu is the destination address calculated by the ARM7TDMI core
• (alu) is the contents of that address.
Operation type Cycle Address MAS[1:0] nRW Data nMREQ SEQ nOPC
pc+3L
2 alu i 0 (alu) 0 1 0
3 alu+L i 0 (alu+L) 0 1 0
alu+2L
2 pc+3L i 0 - 0 1 1
pc+3L
dest=pc 2 pc+12 2 0 - 0 0 1
3 alu 2 0 (alu) 0 1 0
4 alu+4 2 0 (alu+4) 0 1 0
alu+8
Note
The shifted register operations where the destination is the PC are not available in
Thumb state.
• multiply long instruction cycle operations are listed in Table 6-7 on page 6-10
• multiply accumulate long instruction cycle operations are listed in Table 6-8 on
page 6-10.
1 pc+2L 0 i (pc+2L) 1 0 0
2 pc+3L 0 i - 1 0 1
• pc+3L 0 i - 1 0 1
m pc+3L 0 i - 1 0 1
m+1 pc+3L 0 i - 0 1 1
pc+3L
1 pc+8 0 2 (pc+8) 1 0 0
2 pc+8 0 2 - 1 0 1
• pc+12 0 2 - 1 0 1
m pc+12 0 2 - 1 0 1
m+1 pc+12 0 2 - 1 0 1
m+2 pc+12 0 2 - 0 1 1
pc+12
1 pc+8 0 i (pc+8) 1 0 0
2 pc+12 0 i - 1 0 1
• pc+12 0 i - 1 0 1
m pc+12 0 i - 1 0 1
m+1 pc+12 0 i - 1 0 1
m+2 pc+12 0 i - 0 1 1
pc+12
1 pc+8 0 2 (pc+8) 1 0 0
2 pc+8 0 2 - 1 0 1
• pc+12 0 2 - 1 0 1
m pc+12 0 2 - 1 0 1
m+1 pc+12 0 2 - 1 0 1
m+2 pc+12 0 2 - 1 0 1
m+3 pc+12 0 2 - 0 1 1
pc+12
Note
The multiply accumulate, multiply long, and multiply accumulate long operations are
not available in Thumb state.
Either the base, or destination, or both, can be the PC, and the prefetch sequence is
changed if the PC is affected by the instruction.
The data fetch can abort, and in this case the destination modification is prevented. In
addition, if the processor is configured for early abort, the base register write-back is
also prevented.
• d=0 if the T bit has been specified in the instruction (such as LDRT) and d=c at
all other times
• s represents the size of the data transfer shown by MAS[1:0] (see Table 6-10 on
page 6-13).
Operation type Cycle Address MAS[1:0] nRW Data nMREQ SEQ nOPC nTRANS
2 alu s 0 (alu) 1 0 1 d
3 pc+3L i 0 - 0 1 1 c
pc+3L
2 alu 0 pc’ 1 0 1 d
3 pc+12 2 0 - 0 0 1 c
4 pc’ 2 0 (pc’) 0 1 0 c
5 pc’+4 2 0 (pc’+4) 0 1 0 c
pc’+8
Note
Operations where the destination is the PC are not available in Thumb state.
0 0 byte
0 1 halfword
1 0 word
1 1 reserved
• d=0 if the T bit has been specified in the instruction (such as LDRT) and d=c at
all other times.
• s represents the size of the data transfer shown by MAS[1:0] (see Table 6-10 on
page 6-13).
1 pc+2L i 0 (pc+2L) 0 0 0 c
2 alu s 1 Rd 0 0 1 d
pc+3L
The last cycle can be merged with the next instruction prefetch to form a single memory
N-cycle. If an abort occurs, the instruction continues to completion, but all register
modification after the abort is prevented. The final cycle is altered to restore the
modified base register (that could have been overwritten by the load activity before the
abort occurred).
When the PC is in the list of registers to be loaded the current instruction pipeline must
be invalidated.
Note
The PC is always the last register to be loaded, so an abort at any point prevents the PC
from being overwritten.
Destination registers Cycle Address MAS[1:0] nRW Data nMREQ SEQ nOPC
2 alu 2 0 (alu) 1 0 1
3 pc+3L i 0 - 0 1 1
pc+3L
Destination registers Cycle Address MAS[1:0] nRW Data nMREQ SEQ nOPC
2 alu 2 0 pc’ 1 0 1
3 pc+3L i 0 - 0 0 1
4 pc’ i 0 (pc’) 0 1 0
5 pc’+L i 0 (pc’+L) 0 1 0
pc’+2L
2 alu 2 0 (alu) 0 1 1
• alu+• 2 0 (alu+•) 0 1 1
n alu+• 2 0 (alu+•) 0 1 1
n+2 pc+3L i 0 - 0 1 1
pc+3L
2 alu 2 0 (alu) 0 1 1
• alu+• 2 0 (alu+•) 0 1 1
n alu+• 2 0 (alu+•) 0 1 1
n+2 pc+3L i 0 - 0 0 1
pc’+2L
2 alu 2 1 Ra 0 0 1
pc+3L
2 alu 2 1 Ra 0 1 1
• alu+• 2 1 R• 0 1 1
n alu+• 2 1 R• 0 1 1
n+1 alu+• 2 1 R• 0 0 1
pc+12
LOCK is driven HIGH during the second and third cycles to indicate that both cycles
must be allowed to complete without interruption.
The data swapped can be a byte or word quantity. Halfword quantities cannot be
specified.
The swap operation can be aborted in either the read or write cycle, and in both cases
the destination register is not affected.
• s represents the size of the data transfer shown by MAS[1:0] (see Table 6-10 on
page 6-13), s can only represent byte and word transfers. Halfword transfers are
not available.
Cycle Address MAS [1:0] nRW Data nMREQ SEQ nOPC LOCK
1 pc+8 2 0 (pc+8) 0 0 0 0
2 Rn b/w 0 (Rn) 0 0 1 1
3 Rn b/w 1 Rm 1 0 1 1
4 pc+12 2 0 - 0 1 1 0
pc+12
Note
The data swap operation is not available in Thumb state.
During the second cycle the return address is modified to facilitate return, though this
modification is less useful than in the case of the branch with link instruction.
The third cycle is required only to complete the refilling of the instruction pipeline.
MAS
Cycle Address nRW Data nMREQ SEQ nOPC nTRANS Mode TBIT
[1:0]
2 Xn 2 0 (Xn) 0 1 0 1 exception 0
Xn+8
If the coprocessor is not capable of performing the requested task, it must leave CPA
and CPB HIGH. If it can do the task, but cannot commit right now, it must drive CPA
LOW but leave CPB HIGH until it can commit. The core busy-waits until CPB goes
LOW.
CP MAS
Cycle Address nRW Data nMREQ SEQ nOPC nCPI CPA CPB
status [1:0]
pc+12
2 pc+8 0 2 - 1 0 1 0 0 1
• pc+8 0 2 - 1 0 1 0 0 1
b pc+8 0 2 - 0 0 1 0 0 0
pc+12
Note
Coprocessor data operations are not available in Thumb state.
The ARM7TDMI processor spends the first cycle (and any busy-wait cycles) generating
the transfer address, and updates the base address during the transfer cycles.
CP
MAS
register Cycles Address nRW Data nMREQ SEQ nOPC nCPI CPA CPB
[1:0]
status
ready pc+12
register 2 pc+8 2 0 - 1 0 1 0 0 1
b pc+8 2 0 - 0 0 1 0 0 0
pc+12
n alu+• 2 0 (alu+•) 0 1 1 1 0 0
pc+12
CP
MAS
register Cycles Address nRW Data nMREQ SEQ nOPC nCPI CPA CPB
[1:0]
status
(n>1) 2 pc+8 2 0 - 1 0 1 0 0 1
b pc+8 2 0 - 0 0 1 0 0 0
• alu+• 0 (alu+•) 0 1 1 1 0 0
pc+12
Note
Coprocessor data transfer operations are not available in Thumb state.
CP
MAS
register Cycle Address nRW Data nMREQ SEQ nOPC nCPI CPA CPB
[1:0]
status
ready - pc+12 - - - - - - - - -
register 2 pc+8 2 0 - 1 0 1 0 0 1
b pc+8 2 0 - 0 0 1 0 0 0
pc+12
n alu+• 2 1 CPdata 0 1 1 1 0 0
pc+12
CP
MAS
register Cycle Address nRW Data nMREQ SEQ nOPC nCPI CPA CPB
[1:0]
status
(n>1) 2 pc+8 2 0 - 1 0 1 0 0 1
b pc+8 2 0 - 0 0 1 0 0 0
• alu+• 2 1 CPdata 0 1 1 1 0 0
pc+12
Note
Coprocessor data transfer operations are not available in Thumb state.
MAS
Cycle Address nRW Data nMREQ SEQ nOPC nCPI CPA CPB
[1:0]
2 pc+12 2 0 CPdata 1 0 1 1 1 1
3 pc+12 2 0 - 0 1 1 1 - -
- pc+12
2 pc+8 2 0 - 1 0 1 0 0 1
• pc+8 2 0 - 1 0 1 0 0 1
b pc+8 2 0 - 1 1 1 0 0 0
b+2 pc+12 2 0 - 0 1 1 1 - -
pc+12
Note
Coprocessor register transfer operations are not available in Thumb state.
MAS
Cycle Address nRW Data nMREQ SEQ nOPC nCPI CPA CPB
[1:0]
2 pc+12 2 1 Rd 0 0 1 1 1 1
pc+12
2 pc+8 2 0 - 1 0 1 0 0 1
• pc+8 2 0 - 1 0 1 0 0 1
b pc+8 2 0 - 1 1 1 0 0 0
b+1 pc+12 2 1 Rd 0 0 1 1 1 1
pc+12
Note
Coprocessor register transfer operations are not available in Thumb state.
MAS
Cycle Address nRW Data nMREQ SEQ nOPC nCPI nTRANS Mode TBIT
[1:0]
2 pc+2L i 0 - 0 0 0 1 C Old T
3 Xn 2 0 (Xn) 0 1 0 1 1 00100 0
Xn+8
Note
• Coprocessor instructions are not available in Thumb state.
• CPA and CPB are HIGH during the undefined instruction trap.
1 pc+2L i 0 (pc+2L) 0 1 0
pc+3L
If the condition is not met then all instructions take one S-cycle. The cycle types N, S,
I, and C are described in Bus cycle types on page 3-4.
In Table 6-23:
• b is the number of cycles spent in the coprocessor busy-wait loop
• m is:
— 1 if bits [32:8] of the multiplier operand are all zero or one
— 2 if bits [32:16] of the multiplier operand are all zero or one
— 3 if bits [31:24] of the multiplier operand are all zero or all one
• n is the number of words transferred.
MSR, MRS S -
STR 2N -
STM (n-1)S+2N -
SWP S+2N+I -
B,BL 2S+N -
MUL S+mI -
MLA S+(m+1)I -
MULL S+(m+1)I -
MLAL S+(m+2)I -
CDP S+bI -
MCR N+bI+C -
MRC S+(b+1)I+C -
This chapter gives the AC timing parameters of the ARM7TDMI core. It contains the
following sections:
• Timing diagram information on page 7-3
• General timing on page 7-4
• Address bus enable control on page 7-6
• Bidirectional data write cycle on page 7-7
• Bidirectional data read cycle on page 7-8
• Data bus control on page 7-9
• Output 3-state timing on page 7-10
• Unidirectional data write cycle timing on page 7-11
• Unidirectional data read cycle timing on page 7-12
• Configuration pin timing on page 7-13
• Coprocessor timing on page 7-14
• Exception timing on page 7-15
• Synchronous interrupt timing on page 7-16
• Debug timing on page 7-17
• Debug communications channel output timing on page 7-19
• Breakpoint timing on page 7-20
MCLK
ECLK
Tcdel
Tcdel
nMREQ
SEQ
Tmsh
Tmsd
nEXEC
Texh
Texd
A[31:0]
Tah
Taddr
nRW
Trwh
Trwd
MAS[1:0]
LOCK
Tblh
Tbld
nM[4:0]
nTRANS
TBIT Tmdh
Tmdd
nOPC
Topch
Topcd
Note
In Figure 7-1 on page 7-4, nWAIT, APE, ALE, and ABE are all HIGH during the cycle
shown. Tcdel is the delay, on either edge (whichever is greater), from the edge of MCLK
to ECLK.
MCLK
ABE
A[31:0]
nRW
LOCK
nOPC
nTRANS Tabz
MAS[1:0] Tabe
MCLK
nENOUT
Tnen Tnenh
D[31:0]
Tdout Tdoh
Note
In Figure 7-3 DBE is HIGH and nENIN is LOW during the cycle shown.
MCLK
nENOUT
Tnen Tdih
D[31:0]
Tdis
BL[3:0]
Tbylh
Tbyls
Note
In Figure 7-4, DBE is HIGH and nENIN is LOW during the cycle shown.
MCLK
Tdbnen
nENOUT
Tdbnen
DBE
Tdbz
Tdbe Tdoh
D[31:0]
Tdout
nENIN
Tdbz
Tdbe
Note
The cycle shown in Figure 7-5 is a data write cycle because nENOUT was driven LOW
during phase one. Here, DBE has first been used to modify the behavior of the data bus,
and then nENIN.
MCLK
TBE
A[31:0]
D[31:0]
nRW
LOCK
nOPC
nTRANS Ttbz
MAS[1:0] Ttbe
Ttbe Address and Data bus enable time from TBEr Maximum
Ttbz Address and Data bus disable time from TBEf Maximum
MCLK
Tnen
nENOUT
Tdohu
DOUT[31:0]
Tdoutu
MCLK
nENOUT
Tnen Tdisu
DIN[31:0]
Tdihu
BL[3:0]
Tbylh
Tbyls
MCLK
Tcth
BIGEND
Tcts
ISYNC
Tcts
Tcth
Phase 1 Phase 2
MCLK
Tcpi Tcpih
nCPI
Tcps
CPA
CPB
Tcph
nMREQ
SEQ
Tcpms
Note
In Figure 7-10, usually nMREQ and SEQ become valid Tmsd after the falling edge of
MCLK. In this cycle the core has been busy-waiting for a coprocessor to complete the
instruction. If CPA and CPB change during phase 1, the timing of nMREQ and SEQ
depends on Tcpms. Most systems can generate CPA and CPB during the previous phase
2, and so the timing of nMREQ and SEQ is always Tmsd.
MCLK
Tabts Tabth
ABORT
Tis Tim
nFIQ
nIRQ
Trs Trm
nRESET
Note
In Figure 7-11, to guarantee recognition of the asynchronous interrupt (ISYNC=0) or
reset source, the appropriate signals must be setup or held as follows:
• setup Tis and Trs respectively before the corresponding clock edge
• hold Tim and Tis respectively after the corresponding clock edge.
These inputs can be applied fully asynchronously where the exact cycle of recognition
is unimportant.
Parameter
Symbol Parameter
type
Tis Asynchronous interrupt set up time to MCLKf for guaranteed recognition, with ISYNC=0 Minimum
MCLK
Tsis
nFIQ
nIRQ
Tsih
Tsih Synchronous nFIQ, nIRQ hold from MCLKf with ISYNC=1 Minimum
MCLK
Tdbgh
DBGACK
Tdbgd
BREAKPT
Tbrks Tbrkh
DBGRQ
Trqs Trqh
EXTERN[1]
Texts Texth
DBGRQI
Tdbgrq
RANGEOUT0
RANGEOUT1
Trgh
Trg
MCLK
COMMTX
COMMRX
Tcommd
Parameter
Symbol Parameter
type
MCLK
BREAKPT
nCPI
nEXEC
nMREQ
SEQ Tbcems
Note
In Figure 7-15, BREAKPT changing in the LOW phase of MCLK (to signal a
watchpointed store) affects nCPI, nEXEC, nMREQ, and SEQ in the same phase.
Parameter
Symbol Parameter
type
TCK
Tctdel
ECLK
Tctdel
Note
In Figure 7-16, Tctdel is the delay, on either edge (whichever is greater), from the edge
of TCK to ECLK.
MCLK
Tmckl Tmckh
nWAIT
Tws Twh
ECLK
nMREQ
SEQ
Tmsd
A[31:0]
Taddr
Note
In Figure 7-17, the core is not clocked by the HIGH phase of MCLK when nWAIT is
LOW. During the cycles shown, nMREQ and SEQ change once, during the first LOW
phase of MCLK, and A[31:0] change once, during the second HIGH phase of MCLK.
Phase 2 is shown for reference. This is the internal clock from which the core times all
its activity. This signal is included to show how the HIGH phase of the external MCLK
has been removed from the internal core clock.
TCK
Tbscl Tbsch
TMS
TDI
Tbsoh Tbsis Tbsih
TDO
Tbsod
Data in
Tbsss Tbssh
Data out
Tbsdh Tbsdh
Tbsdd Tbsdd
nRESET
Trstl
nTRST
Tbsr
D[31:0]
DBGACK
nCPI
nENOUT
nEXEC Trstd
nMREQ
SEQ
Trstd nRESETf to D[31:0], DBGACK, nCPI, nENOUT, nEXEC, nMREQ, SEQ valid Maximum
TCK
Tbsz Tbse
A[ ]
D[ ]
Figure 7-20 Output enable and disable times due to HIGHZ TAP instruction
Note
Figure 7-20 shows the Tbse, output enable time, parameter and Tbsz, output disable time,
when the HIGHZ TAP instruction is loaded into the instruction register.
TCK
Tbsz Tbse
A[ ]
D[ ]
Figure 7-21 Output enable and disable times due to data scanning
Note
Figure 7-21 shows the Tbse, output enable time, parameter and Tbsz, output disable time
when data scanning, due to different logic levels being scanned through the scan cells
for ABE and DBE.
Phase 1 Phase 2
MCLK
ALE
Tald
A[31:0]
nRW Taleh
LOCK
nOPC
nTRANS Tale
MAS[1:0]
Note
In Figure 7-22, Tald is the time by which ALE must be driven LOW to latch the current
address in phase 2. If ALE is driven LOW after Tald, then a new address is latched. This
is known as address breakthrough.
Parameter
Symbol Parameter
type
MCLK
APE
Taph Taps
A[31:0]
nRW Tapeh
LOCK
nOPC
nTRANS Tape
MAS[1:0]
Parameter
Symbol Parameter
type
In Table 7-23:
• the letter f at the end of a signal name indicates the falling edge
• the letter r at the end of a signal name indicates the rising edge.
Figure
Parameter
Symbol Parameter cross
Type
reference
Tale Address group latch open output delay Maximum Figure 7-22
Taleh Address group latch output hold time Minimum Figure 7-22
Tapeh Address group output hold time from MCLKf Minimum Figure 7-23
Tbcems BREAKPT to nCPI, nEXEC, nMREQ, SEQ delay Maximum Figure 7-13
Tblh MAS[1:0] and LOCK hold from MCLKr Minimum Figure 7-1
Figure
Parameter
Symbol Parameter cross
Type
reference
Tbsdh Data output hold time from TCK Minimum Figure 7-18
Figure
Parameter
Symbol Parameter cross
Type
reference
Tdbe Data bus enable time from DBEr Maximum Figure 7-5
Tdbz Data bus disable time from DBEf Maximum Figure 7-5
Figure
Parameter
Symbol Parameter cross
Type
reference
Tim Asynchronous interrupt guaranteed nonrecognition time, with ISYNC=0 Maximum Figure 7-11
Tis Asynchronous interrupt set up time to MCLKf for guaranteed recognition, Minimum Figure 7-11
with ISYNC=0
Tmdd MCLKr to nTRANS, nM[4:0], and TBIT valid Maximum Figure 7-1
Tmdh nTRANS and nM[4:0] hold time from MCLKr Minimum Figure 7-1
Tmsh nMREQ and SEQ hold time from MCLKf Minimum Figure 7-1
Figure
Parameter
Symbol Parameter cross
Type
reference
Trgh RANGEOUT0, RANGEOUT1 hold time from MCLKf Minimum Figure 7-13
Trqs DBGRQ set up time to MCLKr for guaranteed recognition Minimum Figure 7-13
Trs Reset setup time to MCLKr for guaranteed recognition Minimum Figure 7-11
Trstd nRESETf to D[31:0], DBGACK, nCPI, nENOUT, nEXEC, nMREQ, Maximum Figure 7-19
SEQ valid
Tsih Synchronous nFIQ, nIRQ hold from MCLKf with ISYNC=1 Minimum Figure 7-12
Tsis Synchronous nFIQ, nIRQ setup to MCLKf, with ISYNC=1 Minimum Figure 7-12
Ttbe Address and Data bus enable time from TBEr Maximum Figure 7-6
Ttbz Address and Data bus disable time from TBEf Maximum Figure 7-6
Figure
Parameter
Symbol Parameter cross
Type
reference
7.25 DC parameters
Contact your supplier for information on:
• operating conditions
• maximum ratings.
This appendix lists and describes the signals for the ARM7TDMI processor. It contains
the following section:
Table A-1 on page A-2 lists the transistor sizes for a 0.18 µm ARM7TDMI processor.
N N = 4.2µm 0.18µm
N N = 8.1µm 0.18µm
Table A-2 on page A-2 lists the signal types used in this appendix.
Type Description
P Power
A.1.3 Signals
Table A-3 lists and describes all of the signals used for the ARM7TDMI processor.
A[31:0] O8 This is the 32-bit address bus. ALE, ABE, and APE are used to control
Addresses when the address bus is valid.
ABE IC The address bus drivers are disabled when this is LOW, putting the
Address bus enable address bus into a high impedance state. This also controls the LOCK,
MAS[1:0], nRW, nOPC, and nTRANS signals in the same way. ABE
must be tied HIGH if there is no system requirement to disable the
address drivers.
ABORT IC The memory system uses this signal to tell the processor that a requested
Memory abort access is not allowed.
ALE IC This signal is provided for backwards compatibility with older ARM
Address latch enable processors. For new designs, if address retiming is required, ARM
Limited recommends the use of APE, and for ALE to be connected
HIGH.
The address bus, LOCK, MAS[1:0], nRW, nOPC, and nTRANS
signals are latched when this is held LOW. This allows these address
signals to be held valid for the complete duration of a memory access
cycle. For example, when interfacing to ROM, the address must be valid
until after the data has been read.
APE IC Selects whether the address bus, LOCK, MAS[1:0], nRW, nTRANS,
Address pipeline enable and nOPC signals operate in pipelined (APE is HIGH) or depipelined
mode (APE is LOW).
Pipelined mode is particularly useful for DRAM systems, where it is
desirable to provide the address to the memory as early as possible, to
allow longer periods for address decoding and the generation of DRAM
control signals. In this mode, the address bus does not remain valid to the
end of the memory cycle.
Depipelined mode can be useful for SRAM and ROM access. Here the
address bus, LOCK, MAS[1:0], nRW, nTRANS, and nOPC signals
must be kept stable throughout the complete memory cycle. However,
this does not provide optimum performance.
See Address timing on page 3-14 for details of this timing.
BL[3:0] IC The values on the data bus are latched on the falling edge of MCLK
Byte latch control when these signals are HIGH. For most designs these signals must be tied
HIGH.
BREAKPT IC A conditional request for the processor to enter debug state is made by
Breakpoint placing this signal HIGH.
If the memory access at that time is an instruction fetch, the processor
enters debug state only if the instruction reaches the execution stage of
the pipeline.
If the memory access is for data, the processor enters debug state after the
current instruction completes execution. This allows extension of the
internal breakpoints provided by the EmbeddedICE Logic.
See Behavior of the program counter during debug on page B-29 for
details on the use of this signal.
BUSEN IC A static configuration signal that selects whether the bidirectional data
Data bus configuration bus (D[31:0]) or the unidirectional data busses (DIN[31:0] and
DOUT[31:0]) are used for transfer of data between the processor and
memory.
When BUSEN is LOW, D[31:0] is used; DOUT[31:0] is driven to a
value of zero, and DIN[31:0] is ignored, and must be tied LOW.
When BUSEN is HIGH, DIN[31:0] and DOUT[31:0] are used; D[31:0]
is ignored and must be left unconnected.
See Chapter 3 Memory Interface for details on the use of this signal.
COMMRX O4 When the communications channel receive buffer is full this is HIGH.
Communications channel receive This signal changes after the rising edge of MCLK.
See Debug Communications Channel on page 5-16 for more
information.
CPB IC Placed LOW by the coprocessor when it is ready to start the operation
Coprocessor busy requested by the processor.
It is sampled by the processor when MCLK goes HIGH in each cycle in
which nCPI is LOW.
D[31:0] IC Used for data transfers between the processor and external memory.
Data bus O8 During read cycles input data must be valid on the falling edge of
MCLK.
During write cycles output data remains valid until after the falling edge
of MCLK.
This bus is always driven except during read cycles, irrespective of the
value of BUSEN. Consequently it must be left unconnected if using the
unidirectional data buses.
See Chapter 3 Memory Interface.
DBGEN IC A static configuration signal that disables the debug features of the
Debug enable processor when held LOW.
This signal must be HIGH to allow the EmbeddedICE Logic to function.
DBGRQ IC This is a level-sensitive input, that when HIGH causes ARM7TDMI core
Debug request to enter debug state after executing the current instruction. This allows
external hardware to force the ARM7TDMI core into debug state, in
addition to the debugging features provided by the EmbeddedICE Logic.
See Appendix B Debug in Depth.
DBGRQI O4 This is the logical OR of DBGRQ and bit 1 of the debug control register.
Internal debug request
DIN[31:0] IC Unidirectional bus used to transfer instructions and data from the
Data input bus memory to the processor.
This bus is only used when BUSEN is HIGH. If unused then it must be
tied LOW.
This bus is sampled during read cycles on the falling edge of MCLK.
DOUT[31:0] O8 Unidirectional bus used to transfer data from the processor to the
Data output bus memory system.
This bus is only used when BUSEN is HIGH. Otherwise it is driven to a
value of zero.
During write cycles the output data becomes valid while MCLK is LOW,
and remains valid until after the falling edge of MCLK.
ECAPCLK O4 Only used on the ARM7TDMI test chip, and must otherwise be left
EXTEST capture clock unconnected.
EXTERN0 IC This is connected to the EmbeddedICE Logic and allows breakpoints and
External input 0 watchpoints to be dependent on an external condition.
EXTERN1 IC This is connected to the EmbeddedICE Logic and allows breakpoints and
External input 1 watchpoints to be dependent on an external condition.
HIGHZ O4 When the HIGHZ instruction has been loaded into the TAP controller
High impedance this signal is HIGH.
See Appendix B Debug in Depth for details.
IR[3:0] O4 Reflects the current instruction loaded into the TAP controller instruction
TAP controller instruction register register. These bits change on the falling edge of TCK when the state
machine is in the UPDATE-IR state.
The instruction encoding is described in Public instructions on page B-9.
ISYNC IC Set this HIGH if nIRQ and nFIQ are synchronous to the processor
Synchronous interrupts clock; LOW for asynchronous interrupts.
LOCK O8 When the processor is performing a locked memory access this is HIGH.
Locked operation This is used to prevent the memory controller allowing another device to
access the memory.
It is active only during the data swap (SWP) instruction.
This is one of the signals controlled by APE, ALE and ABE.
MAS[1:0] O8 Used to indicate to the memory system the size of data transfer (byte,
Memory access size halfword or word) required for both read and write cycles, become valid
before the falling edge of MCLK and remain valid until the rising edge
of MCLK during the memory cycle.
The binary values 00, 01, and 10 represent byte, halfword and word
respectively (11 is reserved).
This is one of the signals controlled by APE, ALE, and ABE.
MCLK IC This is the main clock for all memory accesses and processor operations.
Memory clock input The clock speed can be reduced to allow access to slow peripherals or
memory.
Alternatively, the nWAIT can be used with a free-running MCLK to
achieve the same effect.
nENIN IC This must be LOW for the data bus to be driven during write cycles.
NOT enable input Can be used in conjunction with nENOUT to control the data bus during
write cycles.
See Chapter 3 Memory Interface.
nENOUT O4 During a write cycle, this signal is driven LOW before the rising edge of
Not enable output MCLK, and remains LOW for the entire cycle. This can be used to aid
arbitration in shared bus applications.
See Chapter 3 Memory Interface.
nEXEC O4 This is HIGH when the instruction in the execution unit is not being
Not executed executed because, for example, it has failed its condition code check.
nFIQ IC Taking this LOW causes the processor to be interrupted if the appropriate
Not fast interrupt request enable in the processor is active. The signal is level-sensitive and must be
held LOW until a suitable response is received from the processor. nFIQ
can be synchronous or asynchronous to MCLK, depending on the state
of ISYNC.
nHIGHZ O4 When the current instruction is HIGHZ this signal is LOW. This is used
Not HIGHZ to place the scan cells of that scan chain in the high impedance state.
This must be left unconnected, if an external boundary-scan chain is not
connected.
nIRQ IC As nFIQ, but with lower priority. Can be taken LOW to interrupt the
Not interrupt request processor when the appropriate enable is active. nIRQ can be
synchronous or asynchronous, depending on the state of ISYNC.
nM[4:0] O4 These are the inverse of the internal status bits indicating the current
Not processor mode processor mode.
nMREQ O4 When the processor requires memory access during the following cycle
Not memory request this is LOW.
nOPC O8 When the processor is fetching an instruction from memory this is LOW.
Not op-code fetch This is one of the signals controlled by APE, ALE, and ABE.
nTDOEN O4 When serial data is being driven out on TDO this is LOW.
Not TDO enable Usually used as an output enable for a TDO pin in a packaged part.
nTRST IC Reset signal for the boundary-scan logic. This pin must be pulsed or
Not test reset driven LOW to achieve normal device operation, in addition to the
normal device reset, nRESET.
See Chapter 5 Debug Interface.
nWAIT IC When LOW the processor extends an access over a number of cycles of
Not wait MCLK, which is useful for accessing slow memory or peripherals.
Internally, nWAIT is logically ANDed with MCLK and must only
change when MCLK is LOW.
If nWAIT is not used it must be tied HIGH.
RANGEOUT0 O4 When the EmbeddedICE watchpoint unit 0 has matched the conditions
EmbeddedICE RANGEOUT0 currently present on the address, data, and control busses, then this is
HIGH.
This signal is independent of the state of the watchpoint enable control
bit.
RANGEOUT0 changes when ECLK is LOW.
RSTCLKBS O4 When either the TAP controller state machine is in the RESET state or
Boundary scan Reset Clock when nTRST is LOW, then this is HIGH. This can be used to reset
external boundary-scan cells.
SCREG[3:0] O4 These reflect the ID number of the scan chain currently selected by the
Scan chain register TAP controller. These change on the falling edge of TCK when the TAP
state machine is in the UPDATE-DR state.
SDINBS O4 This provides the serial data for an external boundary-scan chain input.
Boundary scan serial input data It changes from the rising edge of TCK and is valid at the falling edge of
TCK.
SEQ O4 When the address of the next memory cycle is closely related to that of
Sequential address the last memory access, this is HIGH.
In ARM state the new address can be for the same word or the next. In
THUMB state, the same halfword or the next.
It can be used, in combination with the low-order address lines, to
indicate that the next cycle can use a fast memory mode (for example
DRAM page mode) or to bypass the address translation system.
SHCLKBS O4 Used to clock the master half of the external scan cells and follows
Boundary scan shift clock, phase TCK1 when in the SHIFT-DR state of the state machine and scan chain
one 3 is selected. When not in the SHIFT-DR state or when scan chain 3 is
not selected, this clock is LOW.
TAPSM[3:0] O4 These reflect the current state of the TAP controller state machine. These
TAP controller bits change on the rising edge of TCK.
state machine See Figure B-2 on page B-5.
TBIT O4 When the processor is executing the THUMB instruction set, this is
HIGH. It is LOW when executing the ARM instruction set.
This signal changes in phase two in the first execute cycle of a BX
instruction.
TCK IC Clock signal for all test circuitry. When in debug state, this is used to
generate DCLK, TCK1, and TCK2.
TCK1 O4 HIGH when TCK is HIGH (slight phase lag due to the internal clock
TCK, phase one non-overlap).
TCK2 O4 HIGH when TCK is LOW (slight phase lag due to the internal clock
TCK, phase two non-overlap).
It is the non-overlapping complement of TCK1.
VSS P These connections are the ground reference for all signals.
Ground
This appendix describes the debug features of the ARM7TDMI core in further detail
and includes additional information about the EmbeddedICE Logic. It contains the
following sections:
• Scan chains and JTAG interface on page B-3
• Resetting the TAP controller on page B-6
• Instruction register on page B-8
• Public instructions on page B-9
• Test data registers on page B-14
• The ARM7TDMI core clocks on page B-22
• Determining the core and system state on page B-24
• Behavior of the program counter during debug on page B-29
• Priorities and exceptions on page B-32
• Scan chain cell data on page B-33
• The watchpoint registers on page B-40
• Programming breakpoints on page B-45
• Programming watchpoints on page B-47
• The debug control register on page B-48
• The debug status register on page B-50
A JTAG style Test Access Port (TAP) controller controls the scan chains. For further
details of the JTAG specification, refer to IEEE Standard 1149.1 - 1990 Standard Test
Access Port and Boundary-Scan Architecture.
In addition, support is provided for an optional fourth scan chain. This is intended to be
used for an external boundary-scan chain around the pads of a packaged device. The
control signals provided for this scan chain are described in Scan chain 3 on page B-20.
Note
The scan cells are not fully JTAG compliant.
Scan chain 0
Embedded-ICE ARM7TDM
Logic Scan chain 1 (CPU core)
Scan chain 2
TAP controller
Scan chain 0
Scan chain 0 enables access to the entire periphery of the ARM7TDMI core, including
the data bus. The scan chain functions enable inter-device testing (EXTEST) and serial
testing of the core (INTEST). The order of the scan chain, from search data in to out, is:
1. Data bus bits 0 to 31.
2. The control signals.
3. Address bus bits 31 to 0.
A[0] is scanned out first.
Scan chain 1
Scan chain 1 is a subset of scan chain 0. It provides serial access to the core data bus
D[31:0] and the BREAKPT signal.
There are 33 bits in this scan chain, the order from serial data in to serial data out, is:
1. Data bus bits 0 to 31.
2. The BREAKPT bit, the first to be shifted out.
Scan chain 2
Scan chain 2 enables access to the EmbeddedICE Logic registers. Refer to Test data
registers on page B-14 for details.
The process of serial test and debug is best explained in conjunction with the JTAG state
machine. Figure B-2 on page B-5 shows the state transitions that occur in the TAP
controller.
Test-Logic Reset
0xF
tms=1
tms=0
tms=0 tms=0
Shift-DR Shift-IR
0x2 0xA
tms=0 tms=0
tms=1 tms=1
Exit1-DR Exit1-IR
0x1 0x9
tms=1 tms=1
tms=0 tms=0
Pause-DR Pause-IR
0x3 0xB
tms=0 tms=0
tms=1 tms=1
Update-DR Update-IR
0x5 0xD
tms=1 tms=0
tms=1
tms=0
From IEEE Std 1149.1-1990. Copyright 1994-2001 IEEE. All rights reserved.
Note
A clock on TCK is not necessary to reset the device.
1. Selects system mode. This means that the boundary-scan cells do not intercept
any of the signals passing between the external system and the core.
3. Sets the TAP controller state machine to the TEST-LOGIC RESET state.
4. Sets the scan chain select register to 0x3, which selects the external boundary-scan
chain, if present.
Note
You must use nTRST to reset the boundary-scan interface at least once after power up.
After this the TAP controller state machine can be put into the TEST-LOGIC RESET
state to subsequently reset the boundary-scan interface.
The fixed value 0001 is loaded into the instruction register during the CAPTURE-IR
controller state.
The least significant bit of the instruction register is scanned in and scanned out first.
In the following instruction descriptions, TDI and TMS are sampled on the rising edge
of TCK and all output transitions on TDO occur as a result of the falling edge of TCK.
The following sections describe:
• EXTEST (0000) on page B-9
• SCAN_N (0010) on page B-10
• SAMPLE/PRELOAD (0011) on page B-10
• RESTART (0100) on page B-10
• CLAMP (0101) on page B-11
• HIGHZ (0111) on page B-11
• CLAMPZ (1001) on page B-11
• INTEST (1100) on page B-12
• IDCODE (1110) on page B-12
• BYPASS (1111) on page B-12.
The selected scan chain is placed in test mode by the EXTEST instruction.
The EXTEST instruction connects the selected scan chain between TDI and TDO.
When the instruction register is loaded with the EXTEST instruction, all of the scan
cells are placed in their test mode of operation:
• In the CAPTURE-DR state, inputs from the system logic and outputs from the
output scan cells to the system are captured by the scan cells.
• In the SHIFT-DR state, the previously captured test data is shifted out of the scan
chain using TDO, while new test data is shifted in using the TDI input. This data
is applied immediately to the system logic and system pins.
The SCAN_N instruction connects the scan path select register between TDI and TDO:
• In the CAPTURE-DR state, the fixed value 1000 is loaded into the register.
• In the SHIFT-DR state, the ID number of the desired scan path is shifted into the
scan path select register.
• In the UPDATE-DR state, the scan register of the selected scan chain is connected
between TDI and TDO and remains connected until a subsequent SCAN_N
instruction is issued.
The scan path select register is 4 bits long in this implementation, although no finite
length is specified. The least significant bit of the scan path select register is shifted
in/out first.
This instruction is included for production test only and must never be used on the scan
chains provided by the ARM7TDMI core. It can be used on user-added scan chains such
as boundary-scan chains.
The RESTART instruction restarts the processor on exit from debug state. The
RESTART instruction connects the bypass register between TDI and TDO. The TAP
controller behaves as if the BYPASS instruction had been loaded.
The processor exits debug state when the RUN-TEST-IDLE state is entered.
This instruction connects a 1 bit shift register, the BYPASS register, between TDI and
TDO. When the CLAMP instruction is loaded into the instruction register, the state of
all the scan cell output signals is defined by the values previously loaded into the
currently loaded scan chain. This instruction must only be used when scan chain 0 is the
currently selected scan chain:
• In the SHIFT-DR state, test data is shifted into the bypass register using TDI and
out using TDO after a delay of one TCK cycle. The first bit shifted out is a zero.
This instruction connects a 1 bit shift register, the BYPASS register, between TDI and
TDO. When the HIGHZ instruction is loaded into the instruction register, the Address
bus, A[31:0], the data bus, D[31:0], nRW, nOPC, LOCK, MAS[1:0], and nTRANS
are all driven to the high impedance state and the external HIGHZ signal is driven
HIGH. This is as if the signal TBE had been driven LOW:
• In the SHIFT-DR state, test data is shifted into the bypass register using TDI and
out using TDO after a delay of one TCK cycle. The first bit shifted out is a zero.
This instruction connects a 1 bit shift register, the BYPASS register, between TDI and
TDO.
When the CLAMPZ instruction is loaded into the instruction register, all the 3-state
outputs are placed in their inactive state, but the data supplied to the scan cell outputs is
derived from the scan cells. The purpose of this instruction is to ensure that, during
production test, each output can be disabled when its data value is either a logic 0 or a
logic 1:
• In the SHIFT-DR state, test data is shifted into the bypass register using TDI and
out using TDO after a delay of one TCK cycle. The first bit shifted out is a zero.
The INTEST instruction places the selected scan chain in test mode:
• The INTEST instruction connects the selected scan chain between TDI and TDO.
• When the INTEST instruction is loaded into the instruction register, all the scan
cells are placed in their test mode of operation.
• In the CAPTURE-DR state, the value of the data applied from the core logic to
the output scan cells and the value of the data applied from the system logic to the
input scan cells is captured.
• In the SHIFT-DR state, the previously-captured test data is shifted out of the scan
chain through the TDO pin, while new test data is shifted in through the TDI pin.
The IDCODE instruction connects the device identification code register or ID register
between TDI and TDO. The register is a 32-bit register that enables the manufacturer,
part number, and version of a component to be read through the TAP. See ARM7TDMI
core device IDentification (ID) code register on page B-14 for details of the ID register
format.
When the IDCODE instruction is loaded into the instruction register, all the scan cells
are placed in their normal system mode of operation:
The BYPASS instruction connects a 1-bit shift register, the bypass register, between
TDI and TDO.
When the BYPASS instruction is loaded into the instruction register, all the scan cells
assume their normal system mode of operation. The BYPASS instruction has no effect
on the system pins:
• In the SHIFT-DR state, test data is shifted into the bypass register through TDI
and shifted out through TDO after a delay of one TCK cycle. The first bit to shift
out is a zero.
Note
BYPASS does not enable the processor to exit debug state or synchronize to MCLK for
a system speed access while in debug state. You must use RESTART to achieve this.
In the following test data register descriptions, data is shifted during every TCK cycle.
Length 1 bit.
Operating mode When the BYPASS instruction is the current instruction in the
instruction register, serial data is transferred from TDI to TDO in
the SHIFT-DR state with a delay of one TCK cycle. There is no
parallel output from the bypass register.
A logic 0 is loaded from the parallel input of the bypass register in
the CAPTURE-DR state.
31 28 27 12 11 1 0
Length 4 bits.
Operating mode In the SHIFT-IR state, the instruction register is selected as the
serial path between TDI and TDO.
During the UPDATE-IR state, the value in the instruction register
becomes the current instruction.
During the CAPTURE-IR state, the binary value 0001 is loaded
into this register. This value is shifted out during SHIFT-IR. On
reset, IDCODE becomes the current instruction.
The least significant bit of the register is scanned in or out first.
Length 4 bits.
Operating mode SCAN_N as the current instruction in the SHIFT-DR state selects
the scan path select register as the serial path between TDI and
TDO.
During the CAPTURE-DR state, the value 1000 binary is loaded
into this register. This value is loaded out during SHIFT-DR, while
a new value is loaded in.
During the UPDATE-DR state, the value in the register selects a
scan chain to become the currently active scan chain. All further
instructions, such as INTEST, then apply to that scan chain. The
currently selected scan chain changes only when a SCAN_N
instruction is executed, or when a reset occurs. On reset, scan
chain 0 is selected as the active scan chain.
The least significant bit of the register is scanned in or out first.
The number of the currently selected scan chain is reflected on the SCREG[3:0]
outputs. The TAP controller can be used to drive external scan chains in addition to
those within the ARM7TDMI macrocell. The external scan chain must be assigned a
number and control signals for it can be derived from SCREG[3:0], IR[3:0],
TAPSM[3:0], TCK1, and TCK2.The list of scan chain numbers allocated by ARM are
shown in Table B-2 on page B-16. An external scan chain can take any other
number.The serial data stream to be applied to the external scan chain is made present
on SDINBS, the serial data back from the scan chain must be presented to the TAP
controller on the SDOUTBS input. The scan chain present between SDINBS and
SDOUTBS is connected between TDI and TDO whenever scan chain 3 is selected, or
when any of the unassigned scan chain numbers is selected. If there is more than one
external scan chain, a multiplexor must be built externally to apply the desired scan
chain output to SDOUTBS. The multiplexor can be controlled by decoding
SCREG[3:0].
Scan chain
Function
number
1 Debug
2 EmbeddedICE Logic
programming
3a External boundary-scan
4 Reserved
8 Reserved
a. To be implemented by ASIC designer.
These enable serial access to the core logic and to EmbeddedICE Logic for
programming purposes. They are described in detail below.
Purpose Enables access to the processor core for test and debug.
Each scan chain cell is fairly simple and consists of a serial register and a multiplexor
as shown in Figure B-4 on page B-17. The scan cells perform two basic functions:
• CAPTURE
• SHIFT.
For input cells, the capture stage involves copying the value of the system input to the
core into the serial register. During shift, this value is output serially. The value applied
to the core from an input cell is either the system input or the contents of the serial
register and this is controlled by the multiplexor.
System data in
Data to core
Shift
CAPTURE clock
register
SHIFT clock latch
Serial data in
For output cells, capture involves placing the output value of a core into the serial
register. During shift, this value is serially output as before. The value applied to the
system from an output cell is either the core output, or the contents of the serial register.
All of the control signals for the scan cells are generated internally by the TAP
controller. The action of the TAP controller is determined by the current instruction and
the state of the TAP state machine.
There are three basic modes of operation of the scan chains, INTEST, EXTEST, and
SYSTEM that are selected by the various TAP controller instructions:
• In INTEST mode, the core is internally tested. The data serially scanned in is
applied to the core and the resulting outputs are captured in the output cells and
scanned out.
• In EXTEST mode, data is scanned onto the outputs of the core and applied to the
external system. System input data is captured in the input cells and then shifted
out.
• In SYSTEM mode, the scan cells are idle. System data is applied to inputs and
core outputs are applied to the system.
Note
The scan cells are not fully JTAG-compliant in that they do not have an update stage.
Therefore, while data is being moved around the scan chain, the contents of the scan cell
are not isolated from the output. From these operations, the output from the scan cell to
the core or to the external system can change on every scan clock. This does not affect
the ARM7TDMI core because its internal state does not change until it is clocked.
However, the rest of the system must be aware that every output can change
asynchronously as data is moved around the scan chain. External logic must ensure that
this does not harm the rest of the system.
Scan chain 0
Scan chain 0 is intended primarily for inter-device testing, EXTEST, and testing the
core, INTEST. Scan chain 0 is selected using the SCAN_N instruction as described at
SCAN_N (0010) on page B-10.
INTEST enables serial testing of the core. The TAP controller must be placed in
INTEST mode after scan chain 0 has been selected:
• During CAPTURE-DR, the current outputs from the core logic are captured in the
output cells.
• During SHIFT-DR, this captured data is shifted out while a new serial test pattern
is scanned in, therefore applying known stimuli to the inputs.
• During RUN-TEST-IDLE, the core is clocked. Usually, the TAP controller only
spends one cycle in RUN-TEST-IDLE. The whole operation can then be repeated.
For a description of the core clocks during test and debug, see The ARM7TDMI core
clocks on page B-22.
EXTEST enables inter-device testing, useful for verifying the connections between
devices on a circuit board. The TAP controller must be placed in EXTEST mode after
scan chain 0 has been selected:
• During CAPTURE-DR, the current inputs to the core logic from the system are
captured in the input cells.
• During SHIFT-DR, this captured data is shifted out while a new serial test pattern
is scanned in, thus applying known values on the outputs of the core.
• During UPDATE-DR, the value shifted into the data bus D[31:0] scan cells
appears on the outputs. For all other outputs, the value appears as the data is
shifted round.
Note
During RUN-TEST-IDLE, the core is not clocked.
Scan chain 1
The primary use for scan chain 1 is for debugging, although it can be used for EXTEST
on the data bus. Scan chain 1 is selected using the SCAN_N TAP controller instruction.
Debugging is similar to INTEST and the procedure described above for scan chain 0
must be followed.
Scan chain 1 is 33 bits long, 32 bits for the data value, plus the scan cell on the
BREAKPT core input. This 33rd bit serves four purposes:
2. During EXTEST test conditions, the value applied to the BREAKPT input from
the system can be captured.
3. While debugging, the value placed in the 33rd bit determines if the ARM7TDMI
core synchronizes back to system speed before executing the instruction. See
System speed access on page B-31 for further details.
4. After the ARM7TDMI core has entered debug state, the first time this bit is
captured and scanned out, its value tells the debugger if the core entered debug
state due to a breakpoint, bit 33 clear, or a watchpoint, bit 33 set.
Scan chain 2
Length 38 bits.
To access this serial register, scan chain 2 must first be selected using the SCAN_N TAP
controller instruction. The TAP controller must then be placed in INTEST mode.
• During SHIFT-DR, a data value is shifted into the serial register. Bits 32 to 36
specify the address of the EmbeddedICE Logic register to be accessed.
• During UPDATE-DR, this register is either read or written depending on the value
of bit 37, with 0=read).
Scan chain 3
Scan chain 3 control signals are provided so that an optional external boundary-scan
chain can be controlled through the ARM7TDMI core. Typically, this is used for a scan
chain around the pad ring of a packaged device.
The following control signals are provided which are generated only when scan chain
3 has been selected. These outputs are inactive at all other times:
DRIVEBS This is used to switch the scan cells from system mode to test mode. This
signal is asserted whenever either the INTEST, EXTEST, CLAMP, or
CLAMPZ instruction is selected.
ICAPCLKBS, ECAPCLKBS
These are capture clocks used to sample data into the scan cells during
INTEST and EXTEST respectively. These clocks are generated in the
CAPTURE-DR state.
SHCLKBS, SHCLK2BS
These are non-overlapping clocks generated in the SHIFT-DR state used
to clock the master and slave element of the scan cells respectively. When
the state machine is not in the SHIFT-DR state, both these clocks are
LOW.
The following scan chain control signals can also be used for scan chain 3:
nHIGHZ This signal can be used to drive the outputs of the scan cells to the HIGH
impedance state. This signal is driven LOW when the HIGHZ instruction
is loaded into the instruction register and HIGH at all other times.
RSTCLKBS This signal is active when the TAP controller state machine is in the
RESET-TEST LOGIC state. It can be used to reset any additional scan
cells.
In addition to these control outputs, SDINBS output and SDOUTBS input are also
provided. When an external scan chain is in use, SDOUTBS must be connected to the
serial data output of the external scan chain and SDINBS must be connected to the serial
data input of the scan chain.
During normal operation, the core is clocked by MCLK and internal logic holds DCLK
LOW. When the ARM7TDMI core is in the debug state, the core is clocked by DCLK
under control of the TAP state machine and MCLK can free-run. The selected clock is
output on the signal ECLK for use by the external system.
Note
When the CPU core is being debugged and is running from DCLK, nWAIT has no
effect.
When the ARM7TDMI core enters debug state, it must switch from MCLK to DCLK.
This is handled automatically by logic in the ARM7TDMI core. On entry to debug state,
the core asserts DBGACK in the HIGH phase of MCLK. The switch between the two
clocks occurs on the next falling edge of MCLK. This is shown in Figure B-5.
MCLK
DBGACK
DCLK
ECLK
Multiplexer
switching point
The ARM7TDMI core is forced to use DCLK as the primary clock until debugging is
complete. On exit from debug, the core must be enabled to synchronize back to MCLK.
This must be done in the following sequence:
1. The final instruction of the debug sequence must be shifted into the data bus scan
chain and clocked in by asserting DCLK.
2. At this point, RESTART must be clocked into the TAP instruction register.
When under serial test conditions, that is when test patterns are being applied to the
ARM7TM core through the JTAG interface, the ARM7TDMI core must be clocked
using DCLK. Entry into test is less automatic than debug and some care must be taken.
On the way into test, MCLK must be held LOW. The TAP controller can now be used
to serially test the ARM7TDMI core. If scan chain 0 and INTEST are selected, DCLK
is generated while the state machine is in the RUN-TEST-IDLE state. During EXTEST,
DCLK is not generated.
On exit from test, RESTART must be selected as the TAP controller instruction. When
this is done, MCLK can be enabled to resume.
Note
After INTEST testing, care must be taken to ensure that the core is in a sensible state
before switching back. The safest way to do this is to either select RESTART and then
cause a system reset, or to insert MOV PC, #0 into the instruction pipeline before
switching back.
Before you can examine the core and system state, the debugger must determine if the
processor entered debug from Thumb state or ARM state, by examining bit 4 of the
EmbeddedICE debug status register. When bit 4 is HIGH, the core has entered debug
from Thumb state, when bit 4 is LOW, the core has entered debug entered from ARM
state.
When the processor has entered debug state from Thumb state, the simplest course of
action is for the debugger to force the core back into ARM state. The debugger can then
execute the same sequence of instructions to determine the processor state.
To force the processor into ARM state while in debug, execute the following sequence
of Thumb instructions on the core:
STR R0, [R0]; Save R0 before use
MOV R0, PC ; Copy PC into R0
STR R0, [R0]; Now save the PC in R0
BX PC ; Jump into ARM state
MOV R8, R8 ; NOP
MOV R8, R8 ; NOP
Note
Because all Thumb instructions are only 16 bits long, the simplest course of action,
when shifting scan chain 1, is to repeat the instruction. For example, the encoding for
BX R0 is 0x4700, so when 0x47004700 shifts into scan chain 1, the debugger does not have
to keep track of the half of the bus on which the processor expects to read the data.
You can use the sequences of ARM instructions in Example B-1 and Example B-2 on
page B-25 to determine the state of the processor.
With the processor in the ARM state, the instruction to execute is shown in
Example B-1.
The instruction in Example B-1 on page B-24 causes the contents of the registers to
appear on the data bus. You can then sample and shift out these values.
Note
The use of r0 as the base register for the STM is only for illustration and you can use
any register.
After you have determined the values in the current bank of registers, you might want
to access the banked registers. To do this, you must change mode. Typically, a mode
change can occur only if the core is already in a privileged mode. However, while in
debug state, a mode change from one mode into any other mode can occur. The
debugger must restore the original mode before exiting debug state.
For example, if the debugger has been requested to return the state of the User mode
registers and FIQ mode registers and debug state was entered in Supervisor mode, the
instruction sequence can be as listed in Example B-2.
All these instructions execute at debug speed. Debug speed is much slower than system
speed. This is because between each core clock, 33 clocks occur in order to shift in an
instruction, or shift out data. Executing instructions this slowly is acceptable for
accessing the core state because the ARM7TDMI core is fully static. However, you
cannot use this method for determining the state of the rest of the system.
While in debug state, only the following instructions can be scanned into the instruction
pipeline for execution:
• all data processing operations
• all load, store, load multiple, and store multiple instructions
• MSR and MRS.
To meet the dynamic timing requirements of the memory system, any attempt to access
system state must occur synchronously to it. The ARM7TDMI core must be forced to
synchronize back to system speed. This is controlled by the 33rd bit of scan chain 1.
Any instruction can be placed in scan chain 1 with bit 33, the BREAKPT bit, clear. This
instruction is then executed at debug speed. To execute an instruction at system speed,
the instruction prior to it must be scanned into scan chain 1 with bit 33 set.
After the system speed instruction has been scanned into the data bus and clocked into
the pipeline, the RESTART instruction must be loaded into the TAP controller. This
causes the ARM7TDMI core to automatically synchronize back to MCLK, the system
clock, execute the instruction at system speed, and then re-enter debug state and switch
itself back to the internally generated DCLK. When the instruction has completed,
DBGACK is HIGH and the core is switched back to DCLK. At this point, INTEST can
be selected in the TAP controller and debugging can resume.
To determine that a system speed instruction has completed, the debugger must look at
both DBGACK and nMREQ. To access memory, the ARM7TDMI core drives
nMREQ LOW, after it has synchronized back to system speed. This transition is used
by the memory controller to arbitrate if the ARM7TDMI core can have the bus in the
next cycle. If the bus is not available, the core can have its clock stalled indefinitely.
Therefore, the only way to tell that the memory access has completed, is to examine the
state of both nMREQ and DBGACK. When both are HIGH, the access has completed.
Usually, the debugger uses the EmbeddedICE macrocell to control debugging and by
reading the EmbeddedICE macrocell status register, the state of nMREQ and
DBGACK can be determined.
By using system speed load multiples and debug speed store multiples, the system
memory state can be fed back to the debug host.
There are restrictions on which instructions can have the 33rd bit set. The only valid
instructions on which to set this bit are loads, stores, load multiple, and store multiple.
See also Exit from debug state on page B-26. When the core returns to debug state after
a system speed access, bit 33 of scan chain 1 is set HIGH. This gives the debugger
information about why the core entered debug state the first time this scan chain is read.
Leaving debug state involves restoring the internal state of the ARM7TDMI core,
causing a branch to the next instruction to be executed and synchronizing back to
MCLK. After restoring internal state, a branch instruction must be loaded into the
pipeline. See Behavior of the program counter during debug on page B-29 for a
description of how to calculate the branch.
Bit 33 of scan chain 1 is used to force the ARM7TDMI core to resynchronize back to
MCLK. The penultimate instruction of the debug sequence is scanned in with bit 33 set
HIGH. The final instruction of the debug sequence is the branch and this is scanned in
with bit 33 LOW. The core is then clocked to load the branch into the pipeline. Now, the
RESTART instruction is selected in the TAP controller. When the state machine enters
the RUN-TEST-IDLE state, the scan chain reverts back to system mode and clock
resynchronization to MCLK occurs in the core. The ARM7TDMI core then resumes
normal operation, fetching instructions from memory. The delay, until the state machine
is in the RUN-TEST-IDLE state, enables conditions to be set up in other devices in a
multiprocessor system without taking immediate effect. Then, when the
RUN-TEST-IDLE state is entered, all processors resume operation simultaneously.
The function of DBGACK is to tell the rest of the system when the core is in debug
state. This can be used to inhibit peripherals such as watchdog timers that have real time
characteristics. Also, DBGACK can be used to mask out memory accesses which are
caused by the debugging process. For example, when the core enters debug state after a
breakpoint, the instruction pipeline contains the breakpointed instruction plus two other
instructions that have been prefetched. On entry to debug state, the pipeline is flushed.
Therefore, on exit from debug state, the pipeline must be refilled to its previous state.
Because of the debugging process, more memory accesses occur than is normally
expected. Any system peripheral that is sensitive to the number of memory accesses can
be inhibited by using DBGACK.
For example, imagine a fictitious peripheral that simply counts the number of memory
cycles. This device must return the same answer after a program has been run both with
and without debugging. Figure B-6 on page B-28 shows the behavior of the core on exit
from the debug state.
CLK
D[31:0]
DBGACK
You can see from Figure 5-3 on page 5-7 that the final memory access occurs in the
cycle after DBGACK goes HIGH, this is the point at which the cycle counter must be
disabled. Figure B-6 shows that the first memory access that the cycle counter has not
seen before occurs in the cycle after DBGACK goes LOW and so this is when the
counter must be re-enabled.
Note
When a system speed access from debug state occurs, the core temporarily drops out of
debug state and so DBGACK can go LOW. If there are peripherals that are sensitive to
the number of memory accesses, they must be led to believe that the core is still in debug
state. By programming the EmbeddedICE macrocell control register, the value on
DBGACK can be forced to be HIGH.
B.9.1 Breakpoints
Entry into debug state from a breakpoint advances the PC by four addresses or 16 bytes.
Each instruction executed in debug state advances the PC by one address or four bytes.
The usual way to exit from debug state after a breakpoint is to remove the breakpoint
and branch back to the previously-breakpointed address.
For example, if the ARM7TDMI core entered debug state from a breakpoint set on a
given address and two debug speed instructions were executed, a branch of minus seven
addresses must occur:
• four for debug entry
• two for the instructions
• one for the final branch.
The following sequence shows the data scanned into scan chain 1, most significant bit
first. The value of the first digit goes to the BREAKPT bit and then the instruction data
into the remainder of scan chain 1:
0 E0802000; ADD R2, R0, R0
1 E1826001; ORR R6, R2, R1
0 EAFFFFF9; B-7, two’s complement, seven instructions backwards
After the ARM7TDMI core enters debug state, it must execute a minimum of two
instructions before the branch, although these can both be NOPs (MOV R0, R0). For small
branches, you can replace the final branch with a subtract, with the PC as the
destination, SUB PC, PC, #28 in the above example.
B.9.2 Watchpoints
The return to program execution after entry to debug state from a watchpoint is done in
the same way as the procedure described in Breakpoints on page B-29.
Debug entry adds four addresses to the PC and every instruction adds one address. The
difference from breakpoint is that the instruction that caused the watchpoint has
executed and the program must return to the next instruction.
A similar sequence follows when an interrupt, or any other exception, occurs during a
watchpointed memory access. The ARM7TDMI core enters debug state in the mode of
the exception. The debugger must check to see if an exception has occurred by
examining the current and previous mode, in the CPSR and SPSR, and the value of the
PC. When an exception has taken place, you must give the user the choice of servicing
the exception before debugging.
Entry to debug state when an exception has occurred causes the PC to be incremented
by three instructions rather than four and this must be considered in return branch
calculation when exiting debug state. For example, suppose that an abort occurs on a
watchpointed access and ten instructions have been executed to determine this
eventuality. You can use the following sequence to return to program execution:
0 E1A00000; MOV R0, R0
1 E1A00000; MOV R0, R0
0 EAFFFFF0; B -16
This code forces a branch back to the abort vector, causing the instruction at that
location to be refetched and executed.
Note
After the abort service routine, the instruction that caused the abort and watchpoint is
refetched and executed. This triggers the watchpoint again and the ARM7TDMI core
re-enters debug state.
Entry into debug state through a debug request is similar to a breakpoint. However,
unlike a breakpoint, the last instruction has completed execution and so must not be
refetched on exit from debug state. You can assume that entry to debug state adds three
addresses to the PC and every instruction executed in debug state adds one address.
For example, suppose that you have invoked a debug request and decided to return to
program execution straight away. You can use the following sequence:
This code restores the PC and restarts the program from the next instruction.
When a system speed access is performed during debug state, the value of the PC
increases by three addresses. System speed instructions access the memory system and
so it is possible for aborts to take place. If an abort occurs during a system speed
memory access, the ARM7TDMI core enters abort mode before returning to debug
state.
This is similar to an aborted watchpoint, but the problem is much harder to fix because
the abort was not caused by an instruction in the main program and so the PC does not
point to the instruction that caused the abort. An abort handler usually looks at the PC
to determine the instruction that caused the abort and also the abort address. In this case,
the value of the PC is invalid, but because the debugger can determine which location
was being accessed, the debugger can be written to help the abort handler fix the
memory system.
• for entry through debug request, DBGRQ, or watchpoint with exception, the
branch is:
- (3+N+3S)
where N is the number of debug speed instructions executed, including the final branch,
and S is the number of system speed instructions executed.
When a breakpointed instruction fetch causes a Prefetch Abort, the abort is taken and
the breakpoint is disregarded. Usually, Prefetch Aborts occur when, for example, an
access is made to a virtual address that does not physically exist and the returned data
is therefore invalid. In such a case, the normal action of the operating system is to swap
in the page of memory and to return to the previously-invalid address. This time, when
the instruction is fetched and providing the breakpoint is activated, it can be
data-dependent, the ARM7TDMI core enters debug state.
The Prefetch Abort, therefore, takes higher priority than the breakpoint.
B.10.2 Interrupts
When the ARM7TDMI core enters debug state, interrupts are automatically disabled.
If an interrupt is pending during the instruction prior to entering debug state, the
ARM7TDMI core enters debug state in the mode of the interrupt. On entry to debug
state, the debugger cannot assume that the ARM7TDMI core is in the mode expected
by the user program. The ARM7TDMI core must check the PC, the CPSR, and the
SPSR to accurately determine the reason for the exception.
Debug, therefore, takes higher priority than the interrupt, but the ARM7TDMI core
does remember that an interrupt has occurred.
When a Data Abort occurs on a watchpointed access, the ARM7TDMI core enters
debug state in abort mode. The watchpoint, therefore, has higher priority than the abort,
but the ARM7TDMI core remembers that the abort happened.
The ARM7TDMI core provides data for scan chain 0 cells as listed in Table B-3.
1 D[0] Input/output
2 D[1] Input/output
3 D[2] Input/output
4 D[3] Input/output
5 D[4] Input/output
6 D[5] Input/output
7 D[6] Input/output
8 D[7] Input/output
9 D[8] Input/output
10 D[9] Input/output
11 D[10] Input/output
12 D[11] Input/output
13 D[12] Input/output
14 D[13] Input/output
15 D[14] Input/output
16 D[15] Input/output
17 D[16] Input/output
18 D[17] Input/output
19 D[18] Input/output
20 D[19] Input/output
21 D[20] Input/output
22 D[21] Input/output
23 D[22] Input/output
24 D[23] Input/output
25 D[24] Input/output
26 D[25] Input/output
27 D[26] Input/output
28 D[27] Input/output
29 D[28] Input/output
30 D[29] Input/output
31 D[30] Input/output
32 D[31] Input/output
33 BREAKPT Input
34 NENIN Input
35 NENOUT Output
36 LOCK Output
37 BIGEND Input
38 DBE Input
39 MAS[0] Output
40 MAS[1] Output
41 BL[0] Input
42 BL[1] Input
43 BL[2] Input
44 BL[3] Input
45 DCTLa Output
46 nRW Output
47 DBGACK Output
48 CGENDBGACK Output
49 nFIQ Input
50 nIRQ Input
51 nRESET Input
52 ISYNC Input
53 DBGRQ Input
54 ABORT Input
55 CPA Input
56 nOPC Output
57 IFEN Input
58 nCPI Output
59 nMREQ Output
60 SEQ Output
61 nTRANS Output
62 CPB Input
63 nM[4] Output
64 nM[3] Output
65 nM[2] Output
66 nM[1] Output
67 nM[0] Output
68 nEXEC Output
69 ALE Input
70 ABE Input
71 APE Input
72 TBIT Output
73 nWAIT Input
74 A[31] Output
75 A[30] Output
76 A[29] Output
77 A[28] Output
78 A[27] Output
79 A[26] Output
80 A[25] Output
81 A[24] Output
82 A[23] Output
83 A[22] Output
84 A[21] Output
85 A[20] Output
86 A[19] Output
87 A[18] Output
88 A[17] Output
89 A[16] Output
90 A[15] Output
91 A[14] Output
92 A[13] Output
93 A[12] Output
94 A[11] Output
95 A[10] Output
96 A[9] Output
97 A[8] Output
98 A[7] Output
99 A[6] Output
The ARM7TDMI core provides data for scan chain 1 cells as listed in Table B-4.
1 D[0] Input/output
2 D[1] Input/output
3 D[2] Input/output
4 D[3] Input/output
5 D[4] Input/output
6 D[5] Input/output
7 D[6] Input/output
8 D[7] Input/output
9 D[8] Input/output
10 D[9] Input/output
11 D[10] Input/output
12 D[11] Input/output
13 D[12] Input/output
14 D[13] Input/output
15 D[14] Input/output
16 D[15] Input/output
17 D[16] Input/output
18 D[17] Input/output
19 D[18] Input/output
20 D[19] Input/output
21 D[20] Input/output
22 D[21] Input/output
23 D[22] Input/output
24 D[23] Input/output
25 D[24] Input/output
26 D[25] Input/output
27 D[26] Input/output
28 D[27] Input/output
29 D[28] Input/output
30 D[29] Input/output
31 D[30] Input/output
32 D[31] Input/output
33 BREAKPT Input
Each register is independently programmable and has a unique address. The function
and mapping of the resisters is shown in Table B-5.
Scan chain
register
Update
Read/write
4
Address Address
decoder
0
31
Breakpoint
Value Mask Comparator + condition
Data
A[31:0]
D[31:0]
Control
0
Watchpoint registers and comparators
TDI TDO
The data to be written is shifted into the 32-bit data field. The address of the register is
shifted into the 5-bit address field. A 1 is shifted into the read/write bit.
A register is read by shifting its address into the address field and by shifting a 0 into
the read/write bit. The 32-bit data field is ignored.
Note
A read or write actually takes place when the TAP controller enters the UPDATE-DR
state.
For each value register in a register pair, there is a mask register of the same format.
Setting a bit to 1 in the mask register has the effect of making the corresponding bit in
the value register disregarded in the comparison.
For example, when a watchpoint is required on a particular memory location, but the
data value is irrelevant, the data mask register can be programmed to 0xFFFFFFFF, all bits
set to 1, to ignore the entire data bus field.
Note
The mask is an XNOR mask rather than a conventional AND mask. When a mask bit is
set to 1, the comparator for that bit position always matches, irrespective of the value
register or the input value.
Setting the mask bit to 0 means that the comparator matches only if the input value
matches the value programmed into the value register.
The control value and control mask registers are mapped identically in the lower eight
bits, as shown in Figure B-8 on page B-42.
8 7 6 5 4 3 2 1 0
ENABLE RANGE CHAIN EXTERN nTRANS nOPC MAS[1] MAS[0] nRW
Bit 8 of the control value register is the ENABLE bit and cannot be masked.
nRW Compares against the write signal from the core to detect the
direction of bus activity. nRW is 0 for a read cycle and 1 for a
write cycle.
MAS[1:0] Compares against the MAS[1:0] signal from the core to detect the
size of bus activity.
0 0 Byte
0 1 Halfword
1 0 Word
1 1 Reserved
nTRANS Compares against the not translate signal from the core to
distinguish between User Mode, with nTRANS=0, and non-user
mode, with nTRANS=1, accesses.
For each of the bits 7:0 in the control value register, there is a corresponding bit in the
control mask register. These bits remove the dependency on particular signals.
1. Program its address value register with the address of the instruction to be
breakpointed.
2. For an ARM-state breakpoint, program bits [1:0] of the address mask register to
11. For a breakpoint in Thumb state, program bits [1:0] of the address mask
register to 01.
3. Program the data value register only when you require a data-dependent
breakpoint, that is only when you need to match the actual instruction code
fetched as well as the address. If the data value is not required, program the data
mask register to 0xFFFFFFFF, all bits to 1. Otherwise program it to 0x00000000.
6. When you need to make the distinction between User and non-User mode
instruction fetches, program the nTRANS value and mask bits appropriately.
7. If required, program the EXTERN, RANGE, and CHAIN bits in the same way.
1. Program its address mask register to 0xFFFFFFFF, all bits set to 1, so that the
address is disregarded.
2. Program the data value register with the particular bit pattern that has been chosen
to represent a software breakpoint.
If you are programming a Thumb software breakpoint, repeat the 16-bit pattern
in both halves of the data value register. For example, if the bit pattern is 0xdeee,
program 0xDEEEDEEE. When a 16-bit instruction is fetched, EmbeddedICE
compares only the valid half of the data bus against the contents of the data value
register. In this way, you can use a single watchpoint register to catch software
breakpoints on both the upper and lower halves of the data bus.
5. Program the control mask register with nOPC = 0 and all other bits to 1.
6. If you wish to make the distinction between User and non-User mode instruction
fetches, 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.
Note
You do not have to program the address value register.
2. Write the special bit pattern representing a software breakpoint at the address.
1. Program its address value register with the address of the data access to be
watchpointed.
3. Program the data value register only if you require a data-dependent watchpoint,
that is, only if you need to match the actual data value read or written 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 the data mask register to
0x00000000.
4. Program the control value register with nOPC = 1, nRW = 0 for a read, or 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 and
all other bits to 1. You can set nRW, or MAS[1:0] to 1 when 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.
Note
The above are examples of how to program the watchpoint register to generate
breakpoints and watchpoints. Many other ways of programming the registers are
possible. For instance, you can provide simple range breakpoints by setting one or more
of the address mask bits.
Figure B-9 on page B-48 shows the function of each bit in this register.
2 1 0
INTDIS DBGRQ DBGACK
If Bit 2, INTDIS, is asserted, the interrupt enable signal, IFEN of the core is forced
LOW. Therefore. all interrupts, IRQ and FIQ, are disabled during debugging,
DBGACK is HIGH, or if the INTDIS bit is asserted. The IFEN signal is driven as listed
in Table B-7 on page B-48.
Figure B-11 on page B-51 shows that the value stored in bit 1 of the control register is
synchronized and then ORed with the external DBGRQ before being applied to the
processor. The output of this OR gate is the signal DBGRQI which is brought out
externally from the macrocell.
In the case of DBGACK, the value of DBGACK from the core is ORed with the value
held in bit 0 to generate the external value of DBGACK seen at the periphery of the
ARM7TDMI core. This enables the debug system to signal to the rest of the system that
the core is still being debugged even when system-speed accesses are being performed,
in which case the internal DBGACK signal from the core is LOW.
4 3 2 1 0
TBIT cgenL IFEN DBGRQ DBGACK
Bit 2 Enables the state of the core interrupt enable signal, IFEN, to be
read. Enables the state of the NMREQ signal from the core,
synchronized to TCK, to be read. This enables the debugger to
determine that a memory access from the debug state has
completed.
Bits 1:0 Enable the values on the synchronized versions of DBGRQ and
DBGACK to be read.
The structure of the debug control and status registers is shown in Figure B-11 on
page B-51.
Debug Debug
control status
register register
DBGACK IFEN
(from core)
(to core)
Bit 2
Bit 2
Bit 1 Synch
DBGRQI
(to core and
ARM7TDMI output)
Bit 0
DBGACK
(to ARM7TDMI
output)
DBGACKI Synch Bit 0
(from core)
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
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.
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.
For Watchpoint 1:
For Watchpoint 0:
If Watchpoint 0 matches but Watchpoint 1 does not, that is the RANGE input to
Watchpoint 0 is 0, the breakpoint is triggered.
Refer to Chapter 7 AC and DC Parameters for details of the required setup and hold
times for these signals.
The reason for this restriction is that if the core continues to run at ECLK rates when
EmbeddedICE Logic is being programmed at TCK rates, it is possible for the
BREAKPT signal to be asserted asynchronously to the core.
This restriction does not apply if MCLK and TCK are driven from the same clock, or
if it is known that the breakpoint or watchpoint condition can only occur some time after
EmbeddedICE Logic has been programmed.
Note
This restriction does not apply in any event to the debug control or status registers.
This glossary describes some of the terms used in this manual. Where terms can have
several meanings, the meaning presented here is intended.
Abort Is caused by an illegal memory access. Abort can be caused by the external memory
system, an external MMU or the EmbeddedICE Logic.
Addressing modes A procedure shared by many different instructions, for generating values used by the
instructions. For four of the ARM addressing modes, the values generated are memory
addresses (which is the traditional role of an addressing mode). A fifth addressing mode
generates values to be used as operands by data-processing instructions.
Arithmetic Logic Unit
The part of a computer that performs all arithmetic computations, such as addition and
multiplication, and all comparison operations.
ALU See Arithmetic Logic Unit.
ARM state A processor that is executing ARM (32-bit) instructions is operating in ARM state.
Big-endian Memory organization where the least significant byte of a word is at a higher address
than the most significant byte.
Banked registers Register numbers whose physical register is defined by the current processor mode. The
banked registers are registers R8 to R14.
Breakpoint A location in the image. If execution reaches this location, the debugger halts execution
of the image.
Also referred to as Current PSR (CPSR), to emphasize the distinction between it and
the Saved PSR (SPSR). The SPSR holds the value the PSR had when the current
function was called, and which will be restored when control is returned.
PSR See Program Status Register.
Reduced Instruction Set Computer
A type of microprocessor that recognizes a lower number of instructions in comparison
with a Complex Instruction Set Computer. The advantages of RISC architectures are:
• they can execute their instructions very fast because the instructions are so simple
• they require fewer transistors, this makes them cheaper to produce and more
power efficient.
The items in this index are listed in alphabetical order, with symbols and numerics appearing at the end. The
references given are to page numbers.
coprocessor register transfer 3-9 undefined instructions 4-16 entry into on breakpoint 5-7
internal 3-7 Core clocks B-22 entry into on debug request 5-8
merged I-S 3-8 Core scan chain arrangements B-4 entry into on watchpoint 5-8
nonsequential 3-5 CPA 4-7 exit B-26
sequential 3-6 CPB 4-7 exit sequence B-28
Bus cycles CPnCPI 4-7 function and mapping of
use of nWAIT 3-29 EmbeddedICE registers B-40
Bus interface host 5-4
cycle types 3-4 D ID code register B-14
signals 3-3 instruction register B-8, B-15
Bus interface signals 3-3 Data interface 5-2
Byte accesses 3-26, 3-27 multiplexing 4-13 interface signals 5-6
Data Aborts B-32 interrupt driven use of comms
Data bus control circuit 3-20 channel 5-18
C Data replication 3-28 mask registers B-42
Data timed signals 3-17 output enable and disable times due
Clock domains 5-10 Data types 2-6 to HIGHZ TAP instruction 7-25
Clocks 5-2 Data write bus cycle 3-20 priorities and exceptions B-32
Code density 1-6 Debug Data Aborts B-32
Condition code flags 2-13 action of core 5-9 interrupts B-32
Control bits 2-14 behavior of PC B-29 Prefetch Abort B-32
Coprocessor breakpoints B-29 programming restriction B-55
busy-wait sequence 4-8 hardware B-45 protocol converter 5-4
Coprocessor connections programming B-45 public instructions B-9
bidirectional bus 4-12 software B-46 BYPASS B-12
unidirectional bus 4-13 bypass register B-14 CLAMP B-11
Coprocessor interface clock switch during B-22 CLAMPZ B-11
handshaking 4-6 clock switch during test 5-11, B-23 EXTEST B-9
Coprocessor register cycles 3-9 clock switching 5-10 HIGHZ B-11
Coprocessors clocks 5-2 IDCODE B-12
about 4-2 communications channel 5-16 INTEST B-12
absence of external 4-15 communications channel registers RESTART B-10
availability 4-3 5-16 SAMPLE/PRELOAD B-10
connecting 4-12 communications through the comms SCAN_N B-10
connecting multiple 4-13 channel 5-17 receiving a message from debugger
connecting single 4-12 control and status register format 5-18
consequences of busy-waiting 4-8 B-51 request B-30
data operation sequence 4-10 control register B-48 reset period timing 7-24
data operations 4-10 control registers B-42 return address calculation B-31
external 4-15 core clocks B-22 scan chain 0 B-18
interface core state B-24 scan chain 0 cells B-33
signals 4-4 coupling breakpoints and scan chain 1 B-19
load and store operations 4-10 watchpoints B-52 scan chain 1 cells B-37
load sequence 4-11 determining core state 5-12, B-24 scan chain 2 B-19
privileged instructions 4-17 determining system state 5-12, B-26 scan chain 3 B-20
register transfer instructions 4-9 EmbeddedICE scan chains B-16
register transfer sequence 4-9 block diagram B-41 scan path select register B-15
signaling 4-7 timing B-54 sending a message to debugger 5-18
timing 7-14 entry into 5-6 stages 5-2
T
R
T bit 2-14
Register organization in ARM-state TAP
2-9 controller
Register organization in Thumb-state resetting B-6
2-10 state machine B-5
Registers 2-8 Testchip data bus circuit 3-23
mapping of Thumb-state onto Testchip example system 3-22
ARM-state 2-11 Thumb
program status 2-13 code 1-6
relationship between ARM-state and Thumb-state
Thumb-state 2-11 register organization 2-10
Reserved bits 2-15 Transistor sizes A-2
Reset 2-24 Tristate control of processor outputs
Reset sequence after power up 3-33 3-21
S U
Scan chain 0 B-4, B-18 Undefined instruction trap 1-12
cells B-33 undefined instructions 6-27
Scan chain 1 B-4, B-19 Undefined Mode 2-7
cells B-37 Unidirectional bus timing 3-18
Scan chain 2 B-4, B-19 Unidirectional data bus 3-18
Scan chain 3 B-20 User Mode 2-7
Scan chains
implementation B-3
JTAG interface B-3 W
Sequential access cycle 3-7
Sequential cycles 3-6 Watchpoint registers B-40
Signal descriptions A-3 programming and reading B-41
Signal types 3-3, 4-4, A-2 Watchpoints
address class 3-11 coupling B-52
Signals programming B-47
bus interface 3-3 Word accesses 3-27
clock and clock control 4-4
coprocessor interface 4-4
Significant address bits 3-12
Simple memory cycle 3-4
SRAM compatible address timing 3-16
STC 4-10
Supervisor Mode 2-7