arm9ejs
arm9ejs
Revision: r1p2
Change history
Proprietary Notice
Words and logos marked with ® or ™ are registered trademarks or trademarks owned by ARM Limited, except
as otherwise stated below in this proprietary notice. 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-4 reprinted with permission IEEE Std. 1149.1-1990, IEEE Standard Test Access Port
and Boundary-Scan Architecture Copyright 2001, by IEEE. The IEEE disclaims any responsibility or liability
resulting from the placement and use in the described manner.
Confidentiality Status
This document is Non-Confidential. The right to use, copy and disclose this document may be subject to
license restrictions in accordance with the terms of the agreement entered into by ARM and the party that
ARM delivered this document to.
Product Status
Web Address
http://www.arm.com
ii Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Contents
ARM9EJ-S Technical Reference Manual
Preface
About this document .................................................................................... xvi
Feedback ...................................................................................................... xx
Chapter 1 Introduction
1.1 About the ARM9EJ-S with Jazelle technology ............................................ 1-2
1.2 ARM9EJ-S architecture with Jazelle technology ......................................... 1-6
1.3 ARM9EJ-S block, core, and interface diagrams ......................................... 1-8
1.4 ARM9EJ-S instruction set summary ......................................................... 1-12
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. iii
Contents
Chapter 4 Interrupts
4.1 About interrupts .......................................................................................... 4-2
4.2 Hardware interface ..................................................................................... 4-3
4.3 Maximum interrupt latency ......................................................................... 4-6
4.4 Minimum interrupt latency .......................................................................... 4-7
iv Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Contents
Chapter 9 AC Parameters
9.1 Timing diagrams ......................................................................................... 9-2
9.2 AC timing parameter definitions .................................................................. 9-9
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. v
Contents
Glossary
vi Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
List of Tables
ARM9EJ-S Technical Reference Manual
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. vii
List of Tables
viii Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
List of Tables
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. ix
List of Tables
x Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
List of Figures
ARM9EJ-S Technical Reference Manual
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. xi
List of Figures
xii Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
List of Figures
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. xiii
List of Figures
xiv Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Preface
This preface introduces the ARM9EJ-S r1p2 reference documentation. It contains the
following sections:
• About this document on page xvi
• Feedback on page xx.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. xv
Preface
Intended audience
This document has been written for experienced hardware and software engineers who
want to design or develop products based on the ARM9EJ-S family of processors. It
assumes no prior knowledge of ARM products.
Chapter 1 Introduction
Read this chapter for an introduction to the ARM9EJ-S processor, and for
a summary of the ARM9EJ-S instruction set.
Chapter 4 Interrupts
Read this chapter for a description of interrupt operation. The chapter
includes interrupt latency details.
xvi Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Preface
Chapter 9 AC Parameters
Read this chapter for a description of the AC timing parameters of the
ARM9EJ-S core.
The rnpn identifier indicates the revision status of the product described in this
document, where:
Typographical conventions
monospace bold Denotes language keywords when used outside example code.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. xvii
Preface
This manual contains some timing diagrams. The figure below explains the components
used in these diagrams. Any variations are clearly labeled when they occur. Therefore,
you must not attach any additional meaning unless specifically stated.
Clock
HIGH to LOW
Transient
HIGH/LOW to HIGH
Bus stable
Bus change
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.
Further reading
If you would like more information on ARM products, or if you have questions not
answered by this document, contact [email protected] or visit our web site at
http://www.arm.com.
ARM publications
This document contains information that is specific to the ARM9EJ-S core. See the
following documents for other relevant information:
• ARM Architecture Reference Manual (ARM DDI 0100)
xviii Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Preface
Other publications
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. xix
Preface
Feedback
ARM Limited welcomes feedback both on the ARM9EJ-S 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 [email protected]
giving:
• the document title
• the document number
• the page number(s) that your comments refer to
• a concise explanation of your comments.
xx Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 1
Introduction
This chapter introduces the ARM9EJ-S core with Jazelle extensions. It contains the
following sections:
• About the ARM9EJ-S with Jazelle technology on page 1-2
• ARM9EJ-S architecture with Jazelle technology on page 1-6
• ARM9EJ-S block, core, and interface diagrams on page 1-8
• ARM9EJ-S instruction set summary on page 1-12.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-1
Introduction
The ARM9EJ-S core uses a pipeline to increase the speed of the flow of instructions to
the processor. This enables several operations to take place simultaneously, and the
processing and memory systems to operate continuously.
A five-stage (five clock cycle) ARM state pipeline is used, consisting of Fetch, Decode,
Execute, Memory, and Writeback stages. This is shown in Figure 1-1 on page 1-3.
A six-stage (six clock cycle) pipeline is used in Jazelle state, consisting of Fetch,
Jazelle/Decode (two clock cycles), Execute, Memory, and Writeback stages. This is
shown in Figure 1-2 on page 1-4.
1-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
ARM Thumb
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-3
Introduction
2 clock cycles Jazelle / Decode Java bytecode, operands and registers are decoded
1-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
F D E M W
Instruction RegisterRegister Data Register
memory access decode read Shift ALU memory access
write
First Second
multiply cycle multiply cycle
CLK
IA[31:1], InMREQ,
ISEQ
INSTR[31:0]
DA[31:0], DnMREQ,
DSEQ, DMORE
WDATA[31:0]
RDATA[31:0]
The ARM9EJ-S core has a Harvard architecture. This features separate address and data
buses for both the 32-bit instruction interface and the 32-bit data interface. This
achieves a significant decrease in Cycles Per Instruction (CPI) by enabling instruction
and data accesses to run concurrently.
Only load, store, coprocessor load, coprocessor store, and swap instructions can access
data from memory. Data can be 8-bit bytes, 16-bit halfwords or 32-bit words. Words
must be aligned to 4-byte boundaries. Halfwords must be aligned to 2-byte boundaries.
Because of the nature of the five-stage pipeline, it is possible for a value to be required
for use before it has been placed in the register bank by the actions of an earlier
instruction. The ARM9EJ-S control logic automatically detects these cases and stalls
the core or forwards data as applicable to overcome these hazards. No intervention is
required by software in these cases, although you can improve software performance by
re-ordering instructions in certain situations.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-5
Introduction
The ARM9EJ-S core is an implementation of the ARM architecture v5TE. For details
of both the ARM and Thumb instruction sets, see the ARM Architecture Reference
Manual. For full details of the ARM9EJ-S Jazelle instruction set, contact ARM at
www.arm.com.
A typical 32-bit architecture can manipulate 32-bit integers with single instructions, and
address a large address space much more efficiently than a 16-bit architecture. When
processing 32-bit data, a 16-bit architecture takes at least two instructions to perform
the same task as a single 32-bit instruction.
When a 16-bit architecture has only 16-bit instructions, and a 32-bit architecture has
only 32-bit instructions, overall the 16-bit architecture has higher code density, and
greater than half the performance of the 32-bit architecture.
The ARM9EJ-S core gives you the choice of running in ARM state, or Thumb state, or
a mix of the two. This enables you to optimize both code density and performance to
best suit your application requirements.
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, enabling excellent
interoperability between ARM and Thumb states.
1-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
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 on a processor connected to a 16-bit memory
system. Thumb, therefore, makes the ARM9EJ-S ideally suited to embedded
applications with restricted memory bandwidth, where code density 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, and linked with Thumb code.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-7
Introduction
1-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
INSTR[31:0]
IA[31:1]
Java
accelerator
Incrementer
IAreg IDScan
DIN[31:0]
Exception Instruction
ResultMe[31:0]
vectors pipeline
Bmux Cmux
Amux
AData[..] Multiplier BData[..]
Shift
ACC
Byte/
word
repl.
MulResultMe[31:0]
CLZ
ALU
ALUOutEx[31:0]
DINC
DAreg DDScan
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-9
Introduction
TAPID[31:0]
CLK
CLKEN DBGTAPSM[3:0]
Clock
CORECLKENOUT DBGSDOUT
DBGSDIN
FIQDIS DBGSCREG[4:0]
IRQDIS DBGnTDOEN
Interrupts EmbeddedICE
nIRQ DBGIR[3:0] and scan
nFIQ interface
DBGTCKEN
nRESET DBGTMS
CFGHIVECS DBGTDI
Miscellaneous CFGDISLTBIT DBGnTRST
configuration
CFGBIGEND DBGTDO
CFGTHUMB32
ETMZIFIRST
ETMZILAST
PADV ETM
interface
ETMIAFE [31:0]
IA[31:1]
ARM9EJ-S
INSTR[31:0]
DA[31:0]
IABORT
InMREQ WDATA[31:0]
Instruction
memory ISEQ
RDATA[31:0]
interface IJBIT
ITBIT DBURST[3:0]
IKILL DABORT
InTRANS DnRW Data
InM[4:0] DMAS[1:0] memory
interface
DnTRANS
DBGIEBKPT DnM[4:0]
DBGDEWPT DnMREQ
EDBGRQ DSEQ
DBGACK DMORE
DBGEXT[1:0] DKILL
DBGEN DLOCK
Debug DBGRNG[1:0] DnSPEC
DBGCOMMRX
DBGCOMMTX
PASS
DBGRQI
LATECANCEL Coprocessor
DBGINSTREXEC interface
CHSD[1:0]
DBGINSTRVALID
CHSE[1:0]
THUMBHW
1-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
Scan chain 2
DBGRNG[1:0] EmbeddedICE-RT
DBGEXT[1:0] logic
Data bus
WDATA[31:0]
Coprocessor
RDATA[31:0] CPU interface
signals
IKILL, IJBIT, InMREQ,
ISEQ, ITBIT, InTRANS
IA[31:0]
INSTR[31:0]
Scan chain 1
EmbeddedICE-RT
TAP controller
DBGTCKEN
DBGTMS
DBGnTRST
DBGTDI
DBGTDO
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-11
Introduction
A key to the ARM and Thumb instruction set tables is given in Table 1-1.
The ARM9EJ-S core is an implementation of the ARM architecture v5TE with ARM
Jazelle technology. For a description of the ARM and Thumb instruction sets see the
ARM Architecture Reference Manual. Contact ARM Limited for complete descriptions
of all instruction sets.
Symbol Description
1-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
Symbol Description
x Selects HIGH or LOW 16 bits of register Rm. T selects the HIGH 16 bits. (T
= top) B selects the LOW 16 bits. (B = bottom).
y Selects HIGH or LOW 16 bits of register Rs. T selects the HIGH 16 bits. (T
= top) B selects the LOW 16 bits. (B = bottom).
Operation Assembler
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-13
Introduction
Operation Assembler
1-14 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
Operation Assembler
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-15
Introduction
Operation Assembler
Coprocessors Data operations CDP{cond} p<cpnum>, <op1>, CRd, CRn, CRm, <op2>
Move to ARM reg from coproc MRC{cond} p<cpnum>, <op1>, Rd, CRn, CRm, <op2>
Move to coproc from ARM reg MCR{cond} p<cpnum>, <op1>, Rd, CRn, CRm, <op2>
Move double to ARM reg from MRRC{cond} p<cpnum>, <op1>, Rd, Rn, CRm
coproc
Move double to coproc from ARM MCRR{cond} p<cpnum>, <op1>, Rd, Rn, CRm
reg
Software BKPT<immediate>
breakpoint
1-16 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
Pre-indexed offset -
Post-indexed offset -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-17
Introduction
Post-indexed offset -
1-18 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
Operation Assembler
Register Rm
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-19
Introduction
Suffix Sets
Suffix Description
EQ Equal
NE Not equal
MI Negative
PL Positive or zero
VS Overflow
VC No overflow
HI Unsigned higher
GE Greater or equal
LT Less than
GT Greater than
AL Always
1-20 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
Operation Assembler
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-21
Introduction
Operation Assembler
OR ORR Rd, Rs
Shift/Rotate Logical shift left LSL Rd, Rs, #5bit_shift_imm LSL Rd, Rs
Branch Conditional -
1-22 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Introduction
Operation Assembler
Unconditional B label
Address -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 1-23
Introduction
Operation Assembler
1-24 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 2
Programmer’s Model
This chapter describes the ARM9EJ-S programmer’s model. It contains the following:
• About the programmer’s model on page 2-2
• Processor operating states on page 2-3
• Memory formats on page 2-4
• Instruction length on page 2-6
• Data types on page 2-7
• Operating modes on page 2-8
• Registers on page 2-9
• The program status registers on page 2-15
• Exceptions on page 2-20.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-1
Programmer’s Model
2-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
ARM state 32-bit, word-aligned ARM instructions are executed in this state.
In Thumb state, the Program Counter (PC) uses bit 1 to select between alternate
halfwords.
Note
Transition between ARM, Thumb, and Jazelle states does not affect the processor mode
or the register contents.
You can switch the operating state of the ARM9EJ-S core between:
• ARM state and Thumb state using the BX and BLX instructions, and loads to the
PC. Switching state is described in the ARM Architecture Reference Manual.
• ARM state and Jazelle state using the BXJ instruction.
All exceptions are entered, handled, and exited in ARM state. If an exception
occurs in Thumb state or Jazelle state, the processor reverts to ARM state. The
transition back to Thumb or Jazelle states occurs automatically on return from the
exception handler.
For full details of the ARM9EJ-S instruction set, contact ARM Limited.
The ARM9EJ-S core enables you to mix ARM and Thumb code. For details see the
Interworking ARM and Thumb chapter in the ARM Software Development Kit User
Guide.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-3
Programmer’s Model
The ARM9EJ-S core can treat words in memory as being stored in either:
• Big-endian format
• Little-endian format.
In big-endian format, the ARM9EJ-S core stores the most significant byte of a word at
the lowest-numbered byte, and the least significant byte at the highest-numbered byte.
Therefore, byte 0 of the memory system connects to data lines 31 to 24. This is shown
in Figure 2-1.
4 5 6 7 4
0 1 2 3 0
Lower address
In little-endian format, the lowest-numbered byte in a word is the least significant byte
of the word and the highest-numbered byte is the most significant. Therefore, byte 0 of
the memory system connects to data lines 7 to 0. This is shown in Figure 2-2 on
page 2-5.
2-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
7 6 5 4 4
3 2 1 0 0
Lower address
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-5
Programmer’s Model
2-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-7
Programmer’s Model
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.
2-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
2.7 Registers
The ARM9EJ-S core has a total of 37 registers:
• 31 general-purpose 32-bit registers
• 6 32-bit 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-11 shows which registers are available in each mode.
Link register Register r14 is used as the subroutine Link Register (LR).
Register r14 receives a copy of r15 when a Branch with Link (BL
or BLX) instruction is executed.
You can treat r14 as a general-purpose register at all other times.
The corresponding banked registers r14_svc, r14_irq, r14_fiq,
r14_abt and r14_und are similarly used to hold the return values
of r15 when interrupts and exceptions arise, or when BL or BLX
instructions are executed within interrupt or exception routines.
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 that caused entry to the current mode.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-9
Programmer’s Model
Banked registers have a mode identifier that indicates which mode they relate to. These
mode identifiers are shown in Table 2-1.
User usra
Interrupt irq
Supervisor svc
Abort abt
System usra
Undefined und
FIQ mode has seven banked registers mapped to r8–r14 (r8_fiq–r14_fiq). As a result
many FIQ handlers do not require to save any registers.
The Supervisor, Abort, IRQ, and Undefined modes each have alternative mode-specific
registers mapped to r13 and r14, enabling a private stack pointer and link register for
each mode.
2-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
Indicates that the normal register used by the User or System mode has been replaced
by an alternative register specific to the exception mode (banked register).
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-11
Programmer’s Model
The Thumb state register set is a subset of the ARM state set. The programmer has
direct access to:
• eight general registers, r0–r7 (for details of high register access in Thumb state
see Accessing high registers in Thumb state on page 2-14).
• the PC
• a stack pointer, SP (ARM r13)
• an LR (ARM r14)
• the CPSR.
There are banked SPs, LRs, and SPSRs for each privileged mode. This register set is
shown in Figure 2-4 on page 2-13.
2-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
Indicates that the normal register used by the User or System mode has been replaced
by an alternative register specific to the exception mode (banked register).
The relationship between the Thumb state and ARM state registers is shown in
Figure 2-5 on page 2-14.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-13
Programmer’s Model
r0 r0
r1 r1
r2 r2
r3 r3
r4 r4
r5 r5
r6 r6
r7 r7
r8
r9
r10
r11
r12
Stack pointer (SP) Stack pointer (r13)
Link register (LR) Link register (r14)
Program counter (PC) Program counter (r15)
CPSR CPSR
SPSR SPSR
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. With
assembly language programming you have 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 enables 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, see the ARM Architecture Reference Manual.
2-14 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
The arrangement of bits in the status registers is shown in Figure 2-6, and described in
The condition code flags on page 2-16 to Reserved bits on page 2-19.
Condition
code flags Reserved Control bits
31 30 29 28 27 26 25 24 23 8 7 6 5 4 0
N Z C V Q J Reserved I F T Mode
Overflow
Carry/Borrow/Extend
Zero
Negative/Less than
Note
The unused bits of the status registers might be used in future ARM architectures, and
must not be modified by software. The unused bits of the status registers are readable,
to enable the processor state to be preserved (for example, during process context
switches) and writable, to enable the processor state to be restored. To maintain
compatibility with future ARM processors, and as good practice, you are strongly
advised to use a read-modify-write strategy when changing the CPSR.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-15
Programmer’s Model
The N, Z, C, and V bits are the condition code flags. They can be set by arithmetic and
logical operations, and also by MSR and LDM instructions. The ARM9EJ-S core tests
these flags to determine if to execute an instruction.
All instructions can execute conditionally on the state of the N, Z, C, and V bits in ARM
state. In Thumb state, only the Branch instruction can be executed conditionally. For
more information about conditional execution, see the ARM Architecture Reference
Manual.
The Sticky Overflow (Q) flag can be set by certain multiply and fractional arithmetic
instructions:
• QADD
• QDADD
• QSUB
• QDSUB
• SMLAxy
• SMLAWy.
The Q flag is sticky in that, when set by an instruction, it remains set until explicitly
cleared by an MSR instruction writing to the CPSR. Instructions cannot execute
conditionally on the status of the Q flag. To determine the status of the Q flag you must
read the PSR into a register and extract the Q flag from this. For details of how the Q
flag is set and cleared, see individual instruction definitions in the ARM Architectural
Reference Manual.
The J bit in the CPSR indicates when the ARM9EJ-S core is in Jazelle state.
When:
2-16 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
The bottom eight bits of a PSR are known collectively as the control bits. They are the:
• Interrupt disable bits
• T bit
• Mode bits on page 2-18.
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.
The operating state is reflected by the ITBIT and IJBIT external signals.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-17
Programmer’s Model
Mode bits
Caution
An illegal value programmed into M[4:0] causes the processor to enter an
unrecoverable state. If this occurs, apply reset. Not all combinations of the mode bits
define a valid processor mode, so take care to use only those bit combinations shown.
These bits determine the processor operating mode as shown in Table 2-2.
2-18 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
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. You must ensure that
your program does not rely on reserved bits containing specific values because future
processors might use some or all of the reserved bits.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-19
Programmer’s Model
2.9 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 ARM9EJ-S core 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 Exception priorities on page 2-27.
Table 2-3 summarizes the PC value preserved in the relevant r14 on exception entry,
and the recommended instruction for exiting the exception handler.
Previous state
Exception
Return instruction Notes
or entry
ARM r14_x Thumb r14_x Jazelle r14_x
PABT SUBS PC, R14_abt, #4 PC + 4 PC+4 PC+4 Where the PC is the address
of instruction that had the
Prefetch Abort.
FIQ SUBS PC, R14_fiq, #4 PC + 4 PC+4 PC+4 Where the PC is the address
of the instruction that was
IRQ SUBS PC, R14_irq, #4 PC + 4 PC+4 PC+4 not executed because the
FIQ or IRQ took priority.
2-20 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
Previous state
Exception
Return instruction Notes
or entry
ARM r14_x Thumb r14_x Jazelle r14_x
DABT SUBS PC, R14_abt, #8 PC + 8 PC+8 PC+8 Where the PC is the address
of the Load or Store
instruction that generated
the Data Abort.
1. Preserves the address of the next instruction in the appropriate LR. When the
exception entry is from:
• ARM and Jazelle states, the ARM9EJ-S copies the address of the next
instruction into the LR (current PC + 4 or PC + 8 depending on the
exception).
• Thumb state, the ARM9EJ-S writes the value of the PC into the LR, offset
by a value (current PC + 2, PC + 4 or PC + 8 depending on the exception)
that causes the program to resume from the correct place on return.
The exception handler does not have to determine the state when entering an
exception. For example, in the case of a SWI, MOVS PC, r14_svc always returns to
the next instruction regardless of the state in which the SWI was executed (in
ARM or Thumb state).
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 ARM9EJ-S can also set the interrupt disable flags to prevent otherwise
unmanageable nesting of exceptions.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-21
Programmer’s Model
Note
Exceptions are always entered, handled, and exited in ARM state. When the processor
is in Thumb state or Jazelle state and an exception occurs, the switch to ARM state takes
place automatically when the exception vector address is loaded into the PC.
When an exception has completed, the exception handler must 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-20.
If the S bit is set and rd = r15, the core copies the SPSR back to the CPSR and clears
the interrupt disable flags that were set on entry.
Note
The action of restoring the CPSR from the SPSR automatically resets the T bit and J bit
to the values held immediately prior to the exception. The I and F bits are automatically
restored to the value they held immediately prior to the exception.
2.9.4 Reset
When the nRESET signal is driven LOW a reset occurs, and the ARM9EJ-S core
abandons the executing instruction.
1. Forces CPSR[4:0] to b10011 (Supervisor mode), sets the I and F bits in the CPSR,
and clears the CPSR T bit and J bit. Other bits in the CPSR are indeterminate.
2. Forces the PC to fetch the next instruction from the reset vector address.
After reset, all register values except the PC and CPSR are indeterminate.
See Chapter 7 Device Reset for more details of the ARM9EJ-S reset behavior.
The Fast Interrupt Request (FIQ) exception supports fast interrupts. In ARM state, FIQ
mode has eight private registers to reduce, or even remove the requirement for register
saving (minimizing the overhead of context switching).
2-22 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
An FIQ is externally generated by taking the nFIQ signal input LOW. The nFIQ input
is registered internally to the ARM9EJ-S core. It is the output of this register that is used
by the ARM9EJ-S core control logic.
Irrespective of the state of exception entry, from ARM state, Thumb state, or Jazelle
state, an FIQ handler returns from the interrupt by executing:
SUBS PC,R14_fiq,#4
You can disable FIQ exceptions within a privileged mode by setting the CPSR F flag.
When the F flag is clear, the ARM9EJ-S checks for a LOW level on the output of the
nFIQ register at the end of each instruction.
FIQs and Interrupt Requests (IRQs) are disabled when an FIQ occurs. Nested interrupts
are allowed but it is up to the programmer to save any corruptible registers and to
re-enable FIQs and interrupts.
The Interrupt Requests (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. You can disable IRQ at any time, by setting the I bit in the CPSR from a
privileged mode.
Irrespective of the state of exception entry, from ARM state, Thumb state, or Jazelle
state, an IRQ handler returns from the interrupt by executing:
SUBS PC,R14_irq,#4
You can disable IRQ exceptions within a privileged mode by setting the CPSR I flag.
When the I flag is clear, the ARM9EJ-S core checks for a LOW level on the output of
the nIRQ register at the end of each instruction.
IRQs are disabled when an IRQ occurs. Nested interrupts are allowed but it is up to you
to save any corruptible registers and to re-enable IRQs.
2.9.7 Aborts
An abort indicates that the current memory access cannot be completed. An abort is
signaled by one of the two external abort input pins, IABORT and DABORT.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-23
Programmer’s Model
Prefetch Abort
This is signaled by an assertion on the IABORT input pin and checked at the end of
each instruction Fetch.
When a Prefetch Abort occurs, the ARM9EJ-S core 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 a branch occurs
while it is in the pipeline, the abort does not take place.
After dealing with the cause of 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
This is signaled by an assertion on the DABORT input pin and checked at the end of
each data access, both read and write.
The ARM9EJ-S core implements the base restored Data Abort model, that differs from
the base updated Data Abort model implemented by the ARM7TDMI-S.
The difference in the Data Abort model affects only a very small section of operating
system code, in the Data Abort handler. It does not affect user code.
With the base restored Data Abort model, when a Data Abort exception occurs during
the execution of a memory access instruction, the base register is always restored by the
processor hardware to the value it contained before the instruction was executed. This
removes the requirement for the Data Abort handler to unwind any base register update,
that might have been specified by the aborted instruction. This greatly simplifies the
software Data Abort handler.
After dealing with the cause of 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
2-24 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
This action restores both the PC and the CPSR, and retries the aborted instruction.
You can use the Software Interrupt Instruction (SWI) to enter Supervisor mode, usually
to request a particular supervisor function. A SWI handler returns by executing the
following instruction, irrespective of the processor operating state:
MOVS PC, R14_svc
This action restores the PC and CPSR, and returns to the instruction following the SWI.
The SWI handler reads the opcode to extract the SWI function number.
When an instruction is encountered that neither the ARM9EJ-S, nor any coprocessor in
the system can handle, the ARM9EJ-S 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
instruction, 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.
IRQs are disabled when an Undefined instruction trap occurs. For more information
about Undefined instructions, see the ARM Architecture Reference Manual.
A breakpoint instruction does not cause the ARM9EJ-S core to take the Prefetch Abort
exception until the instruction reaches the Execute stage of the pipeline. If the
instruction is not executed, for example because a branch occurs while it is in the
pipeline, the breakpoint does not take place.
After dealing with the breakpoint, the handler executes the following instruction
irrespective of the processor operating state:
SUBS PC,R14_abt,#4
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-25
Programmer’s Model
This action restores both the PC and the CPSR, and retries the breakpointed instruction.
Note
If the EmbeddedICE-RT logic is configured into Halt mode, a breakpoint instruction
causes the ARM9EJ-S core to enter debug state. See Debug control register on
page B-35.
You can configure the location of the exception vector addresses using the input
CFGHIVECS, as shown in Table 2-4.
0 0x0000 0000
1 0xFFFF 0000
Table 2-5 shows the exception vector addresses and entry conditions for the different
exception types.
2-26 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Programmer’s Model
When multiple exceptions arise at the same time, a fixed priority system determines the
order in which they are handled:
1. Reset (highest priority).
2. Data Abort.
3. FIQ.
4. IRQ.
5. Prefetch Abort.
6. BKPT, Undefined instruction, and SWI (lowest priority).
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 2-27
Programmer’s Model
2-28 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 3
Memory Interface
This chapter describes the ARM9EJ-S memory interface. It contains the following
sections:
• About the memory interface on page 3-2
• Instruction interface on page 3-3
• Instruction interface addressing signals on page 3-4
• Instruction interface data timed signals on page 3-6
• Endian effects for instruction Fetches on page 3-7
• Instruction interface cycle types on page 3-8
• Data interface on page 3-15
• Data interface addressing signals on page 3-17
• Data interface data timed signals on page 3-20
• Data interface cycle types on page 3-25
• Endian effects for data transfers on page 3-34
• Use of CLKEN to control bus cycles on page 3-35.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-1
Memory Interface
For both instruction and data interfaces, the ARM9EJ-S core uses pipelined addressing.
This means that the address and control signals are generated the cycle before the data
transfer takes place. All memory accesses are timed with the clock CLK.
The ARM9EJ-S core can operate in both big-endian and little-endian memory
configurations and this is selected by the CFGBIGEND input. The endian
configuration affects both interfaces, so you must take care when designing the memory
interface logic to enable correct operation of the processor core.
For system programming purposes, you must normally provide some mechanism for
the data interface to access instruction memory. There are two main reasons for this:
• The use of in-line data for literal pools is very common. This data is fetched using
the data interface but is normally contained in the instruction memory space.
• To enable debug using the JTAG interface it must be possible to download code
into the instruction memory. This code has to be written to memory through the
data interface, because the instruction interface is read-only. In this case it is
essential for the data interface to have access to the instruction memory.
It is not necessary for the instruction interface to have access to the data memory area
unless the processor has to execute code from data memory.
3-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
The signals in the ARM9EJ-S core instruction interface can be grouped into four
categories:
Each of these signal groups shares a common timing relationship to the bus interface
cycle. All signals in the ARM9EJ-S instruction interface are generated from, or sampled
by, the rising edge of CLK.
You can extend bus cycles using the CLKEN signal (see Use of CLKEN to control bus
cycles on page 3-35). Unless otherwise stated CLKEN is permanently HIGH.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-3
Memory Interface
3.3.1 IA[31:1]
IA[31:1] is the 31-bit address bus that specifies the address for the transfer. All
addresses are byte addresses, so a burst of 32-bit instruction Fetches results in the
address bus incrementing by four for each cycle.
Note
The ARM9EJ-S core does not produce IA[0] as all instruction accesses are
halfword-aligned (that is, IA[0] = 0).
The address bus provides 4GB of linear addressing space. When a word access is
signaled the memory system must ignore IA[1].
3.3.2 ITBIT
The ITBIT signal indicates when the ARM9EJ-S core is in a Thumb state. ITBIT is
asserted in the same cycle as the IA and InMREQ signals for an access in Thumb state.
When in Thumb state the ARM9EJ-S core performs aligned halfword Fetches or
aligned word Fetches depending on the state of CFGTHUMB32 as shown in Table 3-2
on page 3-7 and Table 3-3 on page 3-7.
3.3.3 IJBIT
This signal indicates when the ARM9EJ-S core is in Jazelle state. IJBIT is asserted in
the same cycle as the IA and InMREQ signals for an access made in Jazelle state.
When in Jazelle state, the ARM9EJ-S core only ever performs aligned, 32-bit word
Fetches.
3-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
3.3.4 InTRANS
The InTRANS signal encodes information about the transfer. A memory management
unit uses this signal to determine if an access is from a privileged mode. Therefore, you
can use this signal to implement an access permission scheme. The encoding of
InTRANS is shown in Table 3-1.
InTRANS Mode
0 User
1 Privileged
3.3.5 InM[4:0]
InM[4:0] indicates the operating mode of the ARM9EJ-S core. This bus corresponds
to the bottom 5 bits of the CPSR, the outputs are inverted with respect to the CPSR.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-5
Memory Interface
3.4.1 INSTR[31:0]
INSTR[31:0] is the read data bus, and is used by the ARM9EJ-S core to Fetch
instructions. The INSTR[31:0] signal is sampled on the rising edge of CLK at the end
of the bus cycle.
3.4.2 IABORT
If IABORT is asserted on an instruction Fetch, the abort is tracked down the pipeline,
and the Prefetch Abort trap is taken if the instruction is executed.
3-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
Significant
CFGTHUMB32 IJBIT ITBIT Width
address bits
0 0 1 Halfword IA[31:1]
X X 0 Word IA[31:2]
1 0 1 Word IA[31:2]
When a halfword instruction Fetch is performed, a 32-bit memory system can return the
complete 32-bit word, and the ARM9EJ-S core extracts the valid halfword field from
it. The field extracted depends on the state of the CFGBIGEND signal, that determines
the endianness of the system (see Memory formats on page 2-4).
When connecting 8-bit or 16-bit memory systems to the ARM9EJ-S core, ensure that
the data is presented to the correct byte lanes on the ARM9EJ-S core as shown in
Table 3-3.
0 0 1 0 INSTR[15:0] INSTR[31:16]
0 0 1 1 INSTR[31:16] INSTR[15:0]
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-7
Memory Interface
CLK
Address class
Address
signals
Bus cycle
Instruction
INSTR[31:0] data
The ARM9EJ-S core instruction interface can perform three different types of memory
cycle. These are indicated by the state of the InMREQ and ISEQ signals. Memory
cycle types are encoded on the InMREQ and ISEQ signals as shown in Table 3-4.
A memory controller for the ARM9EJ-S core must commit to an instruction memory
access only on an N cycle or an S cycle.
3-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
Nonsequential cycle
During this the ARM9EJ-S core requests a transfer to or from an
address that is unrelated to the address used in the preceding cycle.
See Instruction interface, Nonsequential cycles.
Sequential cycle During this the ARM9EJ-S core requests a transfer to or from an
address that is either one word, or one halfword greater than the
address used in the preceding Sequential or Nonsequential cycle.
See Instruction interface, Sequential cycles on page 3-10.
Internal cycle During this the ARM9EJ-S core does not require a transfer
because it is performing an internal function, and no useful
prefetching can be performed at the same time.
The address class signals and the InMREQ, ISEQ = N cycle signals are broadcast on
the instruction interface bus. At the end of the next bus cycle the instruction is
transferred to the CPU from memory. This is shown in Figure 3-2.
CLK
Address class
Address
signals
InMREQ, N cycle
ISEQ
IKILL
N cycle
Instruction
INSTR[31:0] data
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-9
Memory Interface
Sequential instruction Fetches 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 ARM9EJ-S core requests a memory location that is part
of a Sequential burst. If this is the first cycle in the burst, the address might be the same
as the previous internal cycle. Otherwise the address is incremented from the previous
instruction Fetch that was performed:
• for a burst of word accesses, the address is incremented by 4 bytes
• for a burst of halfword access, the address is incremented by 2 bytes.
Address
Burst type
increment
All accesses in a burst are of the same width. For more details, see Instruction interface
addressing signals on page 3-4.
Note
An MSR switching the processor into User mode causes a Sequential Fetch with a
different value of InTRANS to that in the previous Fetch cycle.
Bursts of byte accesses are not possible with the instruction memory interface.
A burst always starts with an N cycle and continues with S cycles. The S cycles can be
interspersed with I cycles and or canceled cycles.The IA address in an S cycle is always
Sequential to the address in the previous S cycle. A burst always starts with an N cycle,
and continues with S cycles. A burst comprises transfers of the same type or size. The
IA[31:1] signal increments during the burst. The other address class signals are
unaffected during a burst except for InTRANS.
3-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
CLK
Address class
Address Address + 4
signals
IKILL
N cycle S cycle
Instruction Instruction
INSTR[31:0] data 1 data 2
During an internal cycle, the ARM9EJ-S core does not require an instruction Fetch,
because an internal function is being performed, and no useful prefetching can be
performed at the same time.
If IKILL is asserted, then the instruction request made (with InMREQ and ISEQ) in
the previous cycle must be abandoned and must not make any programmer-visible
persistent changes of state to the system.
The signal IKILL is only ever asserted if an instruction request is made in the previous
clock cycle. It must be used to condition both InMREQ and ISEQ. IKILL only
changes after the rising edge of CLK when CLKEN was asserted.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-11
Memory Interface
CLK
IA A A+4 A+8
InMREQ
ISEQ
IKILL
CLK
IA A A+4
InMREQ
ISEQ
IKILL
A memory system controller must ensure that an instruction request that is revoked
using IKILL must not initiate a request on the AHB (or other system bus). A lookup
can be performed in a Level 1 cache or TLB, but no linefill or page table walk must
result from an access that has been canceled with IKILL.
The memory system controller is also responsible for ensuring that no programmer
visible state updates occur.
3-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
CLK
InMREQ
ISEQ
IKILL
Figure 3-9 on page 3-14 illustrates two Sequential Fetches to the same address that are
both canceled.
CLK
IA A A+4 A+8
InMREQ
ISEQ
IKILL
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-13
Memory Interface
CLK
IA A A+4 A+8 B
InMREQ
ISEQ
IKILL
CLK
InMREQ
ISEQ
IKILL
3-14 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
Data transfers take place in the Memory stage of the pipeline. The operation of the data
interface is very similar to the instruction interface.
The signals in the ARM9EJ-S core data bus interface can be grouped into four
categories:
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-15
Memory Interface
Note
All memory accesses are conditioned by the state of the memory request signals. You
must not initiate a memory access unless the memory request signals indicate that one
is required. See Data interface cycle types on page 3-25 for more details.
Each of these signal groups shares a common timing relationship to the bus interface
cycle. All signals in the ARM9EJ-S data interface are generated from, or sampled by
the rising edge of CLK.
You can extend bus cycles using the CLKEN signal (see Use of CLKEN to control bus
cycles on page 3-35). Unless otherwise stated CLKEN is permanently HIGH.
3-16 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
3.8.1 DA[31:0]
DA[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 4 for each cycle.
The address bus provides 4GB of linear addressing space. When a word access is
signaled the memory system must ignore the bottom two bits, DA[1:0], and when a
halfword access is signaled the memory system must ignore the bottom bit, DA[0].
3.8.2 DLOCK
DLOCK indicates to an arbiter that an atomic operation is being performed on the bus.
DLOCK is normally LOW, but is set HIGH to indicate that a SWP or SWPB
instruction is being performed. These instructions perform an atomic read/write
operation, and can be used to implement semaphores.
If DLOCK is asserted in a cycle, then this indicates that there is another access in the
next cycle that must be locked to the first. In the case of a multi-master system, the
ARM processor must not be degranted the bus when a locked transaction is being
performed.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-17
Memory Interface
3.8.3 DMAS[1:0]
The DMAS[1:0] bus encodes the size of the transfer. The ARM9EJ-S core can transfer
word, halfword, and byte quantities. This is encoded on DMAS[1:0] as shown in
Table 3-6.
00 Byte
01 Halfword
10 Word
11 Reserved
The size of transfer does not change during a burst of S cycles. Bursts of halfword or
byte accesses are not possible on the ARM9EJ-S core data interface.
Note
A writable memory system for the ARM9EJ-S core must have individual byte write
enables. Both the ARM C compiler and the 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 these tools.
3.8.4 DnM[4:0]
DnM[4:0] indicates the operating mode of the ARM9EJ-S core. This bus corresponds
to the bottom five bits of the CPSR, unless a forced User mode access is being
performed, in which case DnM[4:0] indicates User mode. These bits are inverted with
respect to the CPSR.
3.8.5 DnRW
DnRW specifies the direction of the transfer. DnRW indicates an ARM9EJ-S write
cycle when HIGH, and an ARM9EJ-S read cycle when LOW. A burst of S cycles is
always either a read burst, or a write burst, because the direction cannot be changed in
the middle of a burst.
3-18 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
Note
You must not initiate writes to memory purely on the basis of DnRW. You must use
the status of the data interface request signals to condition writes to memory. See Data
interface cycle types on page 3-25 for more details.
3.8.6 DnSPEC
DnSPEC is a speculative signal. If LOW at the end of the cycle, then the processor is
indicating to the memory system that the data stored at the memory location specified
by DA might be required in subsequent cycles. Because DnSPEC is a speculative
signal the memory system is not required to perform any action based on DnSPEC. The
memory system must not return an abort for a speculative access. DnSPEC is not
asserted in the same cycle as DnMREQ.
3.8.7 DnTRANS
The DnTRANS bus encodes information about the transfer. A memory management
unit uses this signal to determine if an access is from a privileged mode. Therefore, you
can use this signal to implement an access permission scheme. The encoding of
DnTRANS is shown in Table 3-7.
DnTRANS Mode
0 User
1 Privileged
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-19
Memory Interface
3.9.1 DABORT
If DABORT is asserted on a data access, it causes the ARM9EJ-S core to take the Data
Abort trap.
Figure 3-10 on page 3-21 shows the ARM9EJ-S core behavior for an aborted STR
instruction followed by an LDM instruction. While the STR instruction is canceled, a
memory request is made in the first cycle of the LDM before the Data Abort exception
is taken.
3-20 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
CLK
Address class
Write address Read address
signals
DnRW
DnMREQ
DSEQ
DKILL
DMORE
WDATA[31:0]
Write data
(Write)
DABORT
3.9.2 RDATA[31:0]
RDATA[31:0] is the read data bus, and is used by the ARM9EJ-S core to Fetch data.
It is sampled on the rising edge of CLK at the end of the bus cycle, and is also used
during C cycles to transfer data from a coprocessor to the ARM9EJ-S core.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-21
Memory Interface
3.9.3 WDATA[31:0]
WDATA[31:0] is the write data bus. All data written out from the ARM9EJ-S core is
broadcast on this bus. Data transfers from the ARM9EJ-S core to a coprocessor also use
this bus during C cycles. In normal circumstances, a memory system must sample the
WDATA[31:0] bus on the rising edge of CLK at the end of a write bus cycle. The value
on WDATA[31:0] is valid only during write cycles.
The ARM9EJ-S core indicates the size of a transfer using the DMAS[1:0] signals.
These are encoded as shown in Table 3-8.
All writable memory in an ARM9EJ-S core based system must support the writing of
individual bytes to enable the use of the ARM C compiler and the debug tool chain (for
example, Multi-ICE).
The address produced by the ARM9EJ-S core is always byte-aligned. However, the
memory system must ignore the insignificant bits of the address. The significant
address bits are listed in Table 3-8.
Significant
DMAS[1:0] Width
address bits
Reads
When a halfword or byte read is performed, a 32-bit memory system can return the
complete 32-bit word, and the ARM9EJ-S core extracts the valid halfword or byte field
from it. The fields extracted depend on the state of the CFGBIGEND signal, that
determines the endianness of the system (see Memory formats on page 2-4).
3-22 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
The fields extracted by the ARM9EJ-S core are shown in Table 3-9, Table 3-10, and
Table 3-11. Table 3-9 shows word accesses.
Little-endian Big-endian
DMAS[1:0] DA[1:0]
CFGBIGEND = 0 CFGBIGEND = 1
Little-endian Big-endian
DMAS[1:0] DA[1:0]
CFGBIGEND = 0 CFGBIGEND = 1
Little-endian Big-endian
DMAS[1:0] DA[1:0]
CFGBIGEND = 0 CFGBIGEND = 1
When connecting 8-bit to 16-bit memory systems to the ARM9EJ-S core you must
make sure that the data is presented to the correct byte lanes on the ARM9EJ-S core as
shown in Table 3-10 and Table 3-11.
When performing a word load, the ARM9EJ-S core can rotate the data returned
internally if the address used is unaligned. See the ARM Architectural Reference
Manual for more details.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-23
Memory Interface
Writes
When the ARM9EJ-S core performs a byte or halfword write, the data being written is
replicated across the bus, as illustrated in Figure 3-11. 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.
Byte writes
A WDATA[31:24]
B
A WDATA[23:16]
B
A WDATA[15:8]
B
Register[7:0] A A WDATA[7:0]
B B
Halfword writes
A A
Register[15:0] B B WDATA[15:0]
C C
D D
3-24 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
CLK
Address class
Address
signals
DnMREQ,
DSEQ, Cycle type
DMORE
WDATA[31:0]
Write data
(Write)
RDATA[31:0]
Read data
(Read)
Bus cycle
The ARM9EJ-S data interface can perform four different types of memory cycle:
Nonsequential cycle
During this cycle the ARM9EJ-S core requests a transfer to or from an
address that is unrelated to the address used in the preceding cycle.
Sequential cycle
During this cycle the ARM9EJ-S core requests a transfer to or from an
address that is one word greater than the address used in the preceding
cycle.
Internal cycle
During this cycle the ARM9EJ-S core does not require a transfer because
it is performing an internal function.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-25
Memory Interface
Memory cycle types are encoded on the DnMREQ and DSEQ signals as shown in
Table 3-12.
A memory controller for the ARM9EJ-S core must commit to a data memory access
only on an N cycle or an S cycle.
A Nonsequential cycle is the simplest form of an ARM9EJ-S data interface cycle, and
occurs when the ARM9EJ-S core 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 signals and the DnMREQ and DSEQ = N cycle are broadcast on the
data bus. At the end of the next bus cycle the data is transferred between the CPU and
the memory. This is shown in Figure 3-13 on page 3-27.
The ARM9EJ-S core can perform back-to-back, Nonsequential memory cycles. This
happens, for example, when an STR instruction and an LDR instruction are executed in
succession, as shown in Figure 3-14 on page 3-27.
If you are designing a memory controller for the ARM9EJ-S core, and your memory
system is unable to cope with this case, use the CLKEN signal to extend the bus cycle
to enable sufficient cycles for the memory system (see Use of CLKEN to control bus
cycles on page 3-35).
3-26 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
CLK
Address class
Address
signals
DnMREQ,
DSEQ, N cycle
DMORE
WDATA[31:0]
Write data
(Write)
RDATA[31:0]
Read data
(Read)
N cycle
CLK
Address class
Write address Read address
signals
DnRW
DnMREQ,
DSEQ, N cycle N cycle
DMORE
WDATA[31:0]
Write data
(Write)
RDATA[31:0]
Read data
(Read)
Write cycle Read cycle
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-27
Memory Interface
Sequential cycles perform burst transfers on the bus. You can use this information to
optimize the design of a memory controller interfacing to a burst memory device, such
as a DRAM.
During a Sequential cycle, the ARM9EJ-S core requests a memory location that is part
of a Sequential burst. If this is 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.
Bursts of halfword or byte accesses are not possible on the ARM9EJ-S data interface.
A burst always starts with an N cycle and continues with S cycles. A burst comprises
transfers of the same type. The DA[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 width, direction, and protection type. For more
details, see Instruction interface addressing signals on page 3-4.
3-28 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
CLK
Address class
Address Address + 4
signals
DnMREQ
DSEQ
DMORE
DBURST[3:0] 0001
WDATA[31:0]
Write data 1 Write data 2
(Write)
N cycle S cycle
The DMORE signal is active during load and store multiple instructions and only ever
goes HIGH when DnMREQ is LOW. This signal effectively gives the same
information as DSEQ, but a cycle ahead. This information is provided to give external
logic more time to decode Sequential cycles.
3.10.3 DBURST[3:0]
The DBURST[3:0] signal provides an indication of burst length to the memory system.
It is be presented to the memory system in the same time as the request and address class
signals during the first execute cycle of the load or store operation.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-29
Memory Interface
The DBURST[3:0] signal does not count down as the burst continues, and it is the
responsibility of the memory system to capture the status of DBURST[3:0] at the
beginning of the burst. The validity of DBURST[3:0] must be conditioned with
DKILL in the next cycle. DBURST[3:0] is encoded as the number of words to be
transferred minus 1 (N - 1). The b0000 encoding is used to represent a single word
transfer or a burst of unspecified length. The encoding of DBURST[3:0] is shown in
Table 3-14.
b0000 Unspecified or 1
b0001 2
b0010 3
b0011 4
b0100 5
b0101 6
b0110 7
b0111 8
b1000 9
b1001 10
b1010 11
b1011 12
b1100 13
b1101 14
b1110 15
b1111 16
For coprocessor operations (LDC, STC, MRC, MCR, MRRC, MCRR), the
DBURST[3:0] signal is set to b0000. For SWP operations, DBURST[3:0] is broadcast
as b0000 for both the read and the write part of the swap operation.
3-30 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
During an internal cycle, the ARM9EJ-S core does not require a memory access, as an
internal function is being performed.
During a coprocessor register transfer cycle, the ARM9EJ-S core uses the data interface
to transfer data to or from a coprocessor. A memory cycle is not required and the
memory controller does not initiate a transaction.
DKILL is only ever asserted if a data request was made in the previous clock cycle. It
must be used to condition DnMREQ, DSEQ and DMORE. DKILL only changes after
the rising edge of CLK when CLKEN was asserted.
Figure 3-16 on page 3-32 shows a data transfer that is not canceled by DKILL.
Figure 3-17 on page 3-32 shows a data transfer canceled by DKILL.
The memory system controller must ensure that writes that are revoked using DKILL
must not update memory. This is involves canceling writes to cache, tightly coupled
memory, write buffer, and external memory.
The memory system controller must ensure that a data request that is revoked using
DKILL must not initiate a request on the AHB (or other system bus). A lookup can be
performed in a Level 1 cache or TLB, but no linefill or page table walk must result from
an access that has been canceled with DKILL.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-31
Memory Interface
CLK
DA A
DnMREQ
DSEQ
DKILL
RDATA/ Mem[A]
WDATA
CLK
DA A
DnMREQ
DSEQ
DKILL
RDATA/ ignored
WDATA
With the addition of the DKILL signal, the ARM9EJ-S core cancels a data access
caused by a load or store operation present in the Execute stage, as a result of a Data
Abort being returned for a data access requested by the previous instruction.
Figure 3-18 on page 3-33 shows back-to-back memory transfers with DABORT.
3-32 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
CLK
DA A B
DnMREQ
DSEQ
DMORE
DKILL
RDATA/
Mem[A] ignored
WDATA
DABORT
You can use the DKILL signal to condition the pipelined versions of DnMREQ/DSEQ
that are exported to the ETM.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-33
Memory Interface
3.11.1 Writes
For data writes by the processor, the write data is duplicated on the data bus. So for a
16-bit data store, one copy of the data appears on the upper half of the write data bus,
WDATA[31:16], and the same data appears on the lower half, WDATA[15:0]. For
8-bit writes four copies are output, one on each byte lane:
• WDATA[31:24]
• WDATA[23:16]
• WDATA[15:8]
• WDATA[7:0].
This considerably eases the memory control logic design and helps overcome any
endian effects.
3.11.2 Reads
For data reads, the processor reads a specific part of the read data bus. This is
determined by:
• the endian configuration
• the size of the transfer
• bits 1 and 0 of the data address bus.
Table 3-10 on page 3-23 shows which bits of the data bus are read for 16-bit reads, and
Table 3-11 on page 3-23 shows which bits are read for 8-bit transfers.
For simplicity of design, 32-bits of data can be read from memory and the processor
ignores any unwanted bits.
3-34 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Memory Interface
The CLKEN input extends bus cycles on both the instruction and data interfaces when
asserted.
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 CLKEN this can be more than one
CLK cycle. This is illustrated in Figure 3-19, that shows CLKEN being used to extend
a Nonsequential cycle. In the example, the first N cycle is followed by another N cycle
to an unrelated address, and the address for the second access is broadcast before the
first access completes.
CLK
CLKEN
Address class
Address 1 Address 2 Next address
signals
DnMREQ,
DSEQ, N cycle N cycle Next cycle type
DMORE
Note
When designing a memory controller, you must sample the values of InMREQ, ISEQ,
DnMREQ, DSEQ, DMORE, and the address class signals only when CLKEN is
HIGH. This ensures that the state of the memory controller is not accidentally updated
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 3-35
Memory Interface
during a waited cycle. In addition, the ARM9EJ-S core can alter the request for a
subsequent memory cycle during a waited (CLKEN LOW) cycle. See Withdrawal of
memory requests in waited cycles.
The ARM9EJ-S core can alter the value of the memory request and address signals
during cycles in which CLKEN is LOW. This is done to improve the worst case
interrupt latency of ARM9EJ-S core systems. For example, a pending memory request
can be withdrawn if the core is about to take an interrupt and the access is unnecessary.
The ARM9EJ-S core does not alter or withdraw any access to which it is committed.
An access is said to be committed when the address and request signals are sampled on
the rising edge of CLK when CLKEN is HIGH.
The ARM9EJ-S core only attempts to alter or withdraw an uncommitted access during
the extended (or waited) bus cycle of a previous access. Alteration of the next memory
request during a waited bus cycle is shown in Figure 3-20.
CLK
CLKEN
Address class
Address 1 Ignored Ignored
signals
DnMREQ,
DSEQ, Request 1
Ignored Ignored Internal cycle
DMORE, N cycle
DnSPEC First bus cycle Second bus cycle
Figure 3-20 Alteration of next memory request during waited bus cycle
Note
This behavior affects the IA, InMREQ, ISEQ, DA, DnMREQ, DSEQ, DMORE,
DBURST[3:0], and DnSPEC outputs of the ARM9EJ-S core.
3-36 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 4
Interrupts
This chapter describes the ARM9EJ-S core interrupt behavior. It contains the following
sections:
• About interrupts on page 4-2
• Hardware interface on page 4-3
• Maximum interrupt latency on page 4-6
• Minimum interrupt latency on page 4-7.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 4-1
Interrupts
The Fast Interrupt Request (FIQ) exception provides support for fast interrupts. The
Interrupt Request (IRQ) exception provides support for normal priority interrupts. See
Exceptions on page 2-20 for more details about the programmer’s model for interrupts.
See Chapter 9 AC Parameters for details on interrupt signal timing.This chapter
discusses:
4-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Interrupts
You can make the ARM9EJ-S core take the FIQ or IRQ exceptions (if interrupts are
enabled within the core) by asserting (LOW) the nFIQ or nIRQ inputs, respectively.It
is essential that, when asserted, the interrupt input remains asserted until the ARM9EJ-S
core has completed its interrupt exception entry sequence, that is, until the ARM9EJ-S
core acknowledges to the source of the interrupt that the interrupt has been taken. This
acknowledgement normally occurs when the interrupt service routine accesses the
peripheral causing the interrupt, for example:
• by reading an interrupt status register in the systems interrupt controller
• by writing to a clear interrupt control bit
• by writing data to, or reading data from the interrupting peripheral.
4.2.2 Synchronization
The nFIQ and nIRQ inputs are synchronous inputs to the ARM9EJ-S core, and must
be setup and held about the rising edge of the ARM9EJ-S core clock, CLK. If interrupt
events that are asynchronous to CLK are present in a system, synchronization registers
that are external to the ARM9EJ-S core are required.
You must take care when re-enabling interrupts (for example at the end of an interrupt
routine or with a reentrant interrupt handler). You must ensure that the original source
of the interrupt has been removed before interrupts are enabled again on the ARM9EJ-S
core. If you cannot guarantee this, the ARM9EJ-S core might retake the interrupt
exception prematurely. When considering the timing relation of removing the source of
interrupt and re-enabling interrupts on the ARM9EJ-S core, you must take into account
the pipelined nature of the ARM9EJ-S core and the memory system to which it is
connected. For example, the instruction that causes the removal of the interrupt request
(that is, de-assertion of nFIQ or nIRQ) typically does not take effect until after the
Memory stage of that instruction. The instruction that re-enables interrupts on the
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 4-3
Interrupts
ARM9EJ-S core can cause the ARM9EJ-S core to be sensitive to interrupts as early as
the Execute stage of that instruction.For example, consider the following instruction
sequence:
STR r0, [r1] ;Write to interrupt controller, clearing interruptSUBS pc, r14, #4
;Return from interrupt routine
ARM processor pipeline SUBS pc, r14, #4 Decode Execute Memory Writeback
CLK
nFIQ
FIQDIS
In Figure 4-1, the STR to the interrupt controller does not cause the de-assertion of the
nFIQ input until cycle 4. The SUBS instruction causes the ARM9EJ-S core to be
sensitive to interrupts during cycle 3.
Because of this timing relationship, the ARM9EJ-S core retakes the FIQ exception in
this example.The FIQDIS (and similarly IRQDIS) output from the ARM9EJ-S core
indicates when the ARM9EJ-S core is sensitive to the state of the nFIQ (nIRQ) input
(0 for sensitive, 1 for insensitive). If nFIQ is asserted in the same cycle that FIQDIS is
LOW, the ARM9EJ-S core takes the FIQ exception in a later cycle, even if the nFIQ
input is subsequently deasserted.There are several approaches that you can adopt to
ensure that interrupts are not enabled too early on the ARM9EJ-S core. The best
approach is highly dependent on the overall system, and can be a combination of
hardware and software.
• Analyze the system and ensure enough instructions separate the instruction that
removes the interrupt and the instruction that re-enables interrupts on the
ARM9EJ-S core.
• Have a software polling mechanism that reads back a status bit from the system
interrupt controller until it indicates that the interrupt has been removed before
re-enabling interrupts.
4-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Interrupts
• Have a hardware system that stalls the ARM9EJ-S core until the interrupt has
been removed.
Before use, the nFIQ and nIRQ inputs are registered internally to the ARM9EJ-S core.
To improve interrupt latency, the registers are not conditioned by CLKEN, and run
freely, off the system clock, CLK. Internally, the ARM9EJ-S core can use the
registered nFIQ or nIRQ status to prepare for interrupt entry, even if the rest of the core
is being waited by CLKEN. The registered interrupt signals can only update if CLK is
running. Because of this, the best interrupt latency can only be achieved if CLK is not
stopped. This requirement is counteracted by power saving features of a system (for
instance, stopping CLK while waiting for a slow memory device, or a power-down
mode where CLK is stopped). In systems like this, you can still achieve the best
interrupt latency if you replace the final disabled CLK cycle with one waited (CLKEN
= 0) cycle.
Figure 4-2 shows a system where CLK is stopped by external clock-gating for a
number of cycles.
CLK
CLKEN
Figure 4-3 shows a system that achieves most of the power saving benefits of the system
shown in Figure 4-2, while at the same time achieving best interrupt latency.
CLK
CLKEN
Figure 4-3 Using CLK and CLKEN for best interrupt latency
The system shown in Figure 4-3 combines CLK stopping and CLKEN waiting for best
power and interrupt latency performance.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 4-5
Interrupts
• Whenever a new instruction is in the Execute stage for the first cycle of its
execution. Here cycle refers to CLK cycles with CLKEN HIGH.
• Whenever a new instruction that interlocked in the Execute stage has progressed
to its first active Execute cycle.
If the sampled signal is asserted at the same time as a multicycle instruction has started
its second or later cycle of execution, the interrupt exception entry does not start until
the instruction has completed. The worst-case interrupt latency occurs when the longest
possible LDM instruction incurs a Data Abort. The processor must enter the Data Abort
mode before taking the interrupt so that the interrupt exception exit can occur correctly.
This causes a worst-case latency of 24 cycles:
• The longest LDM instruction is one that loads all of the registers, including the
PC. Counting the first Execute cycle as 1, the LDM takes 16 cycles.
• The last word to be transferred by the LDM is transferred in cycle 17, and the
abort status for the transfer is returned in this cycle.
• If a Data Abort happens, the processor detects this in cycle 18 and prepares for
the Data Abort exception entry in cycle 19.
• Cycles 20 and 21 are the Fetch and Decode stages of the Data Abort entry
respectively.
• During cycle 22, the processor prepares for FIQ entry, issuing Fetch and Decode
cycles in cycles 23 and 24.
• Therefore, the first instruction in the FIQ routine enters the Execute stage of the
pipeline in stage 25, giving a worst-case latency of 24 cycles.
4-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Interrupts
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 4-7
Interrupts
4-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 5
Coprocessor Interface
This chapter describes the ARM9EJ-S coprocessor interface. It contains the following
sections:
• About the coprocessor interface on page 5-2
• LDC or STC on page 5-4
• MCR or MRC on page 5-8
• MCRR or MRRC on page 5-9
• Interlocked MCR on page 5-10
• Interlocked MCRR on page 5-11
• CDP on page 5-12
• Privileged instructions on page 5-14
• Busy-waiting and interrupts on page 5-15
• Coprocessor 15 MCRs on page 5-16
• Connecting coprocessors on page 5-17.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-1
Coprocessor Interface
You can run the coprocessor either in step with the ARM9EJ-S pipeline, or one cycle
behind, depending on the timing priorities. The implications of the two approaches are
discussed in:
• Coprocessor pipeline operates in step with the ARM9EJ-S core
• Coprocessor pipeline one cycle behind the ARM9EJ-S core.
In this case, the pipeline follower inside the coprocessor matches that of the ARM9EJ-S
core exactly. This complicates the timing of key signals such as the INSTR and
CLKEN inputs, because these now become more heavily loaded and therefore incur
more delay. For this reason, this method is only recommended for tightly integrated
coprocessors such as CP15, the system coprocessor.
Note
CHSD[1:0] can be held in Wait because it is ignored for CP14 (internal to the
ARM9EJ-S core instructions.
5-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
• MCR or MRC
• CDP.
Examples of how a coprocessor must execute these instruction classes are given in:
• LDC or STC on page 5-4
• MCR or MRC on page 5-8
• Interlocked MCR on page 5-10
• CDP on page 5-12.
Note
For the sake of clarity, all timing diagrams assume a system where the coprocessor
pipeline operates in step with the ARM9EJ-S core.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-3
Coprocessor Interface
CLK
PADV
IKILL
INSTR[31:0]
PASS
LATECANCEL
CHSD[1:0] GO
Coproc CPDOUT[31:0]
STC
Coproc CPDIN[31:0]
LDC
DnMREQ
DMORE
As with all other instructions, the ARM9EJ-S core performs the main decode using the
rising edge of the clock during the Decode stage. From this, the core commits to
executing the instruction, and so performs an instruction Fetch. The coprocessor
instruction pipeline keeps in step with the ARM9EJ-S core by monitoring PADV.
5-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
At the rising edge of CLK, if CLKEN is HIGH, and PADV is HIGH, an instruction
Fetch has been requested. INSTR[31:0] contains the fetched instruction on the next
rising edge of the clock, when CLKEN is HIGH. This means that:
• the fetched instruction must be sampled
• the last instruction fetched must enter the Decode stage of the coprocessor
pipeline
• the instruction in the Decode stage of the coprocessor pipeline must enter its
Execute stage.
In all other cases, the ARM9EJ-S pipeline is stalled, and the coprocessor pipeline must
not advance.
Figure 5-2 shows the ARM9EJ-S coprocessor clocking signals, indicating when the
coprocessor pipeline must advance its state. In this timing diagram, Coproc clock shows
the effective clock applied to the pipeline follower in the coprocessor. It is derived so
that the coprocessor state must only advance on rising CLK edges when CLKEN is
HIGH. The method of implementing this is dependent on the design style used, such as
clock gating or register recirculating.
For efficient coprocessor design, an unmodified version of CLK must be applied to the
Execution stage of the coprocessor. This enables the coprocessor to continue executing
an instruction even when the ARM9EJ-S pipeline is stalled.
CLK
CLKEN
Coproc
clock
During the Execute stage, the condition codes are compared with the flags to determine
if the instruction really executes or not. The output PASS is asserted (HIGH) if the
instruction in the Execute stage of the coprocessor pipeline:
• is a coprocessor instruction
• has passed its condition codes.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-5
Coprocessor Interface
On the rising edge of CLK, the ARM9EJ-S core examines the coprocessor handshake
signals CHSD[1:0] or CHSE[1:0]:
• If a new instruction is entering the Execute stage in the next cycle, the core
examines CHSD[1:0].
Wait If there is a coprocessor attached that can handle the instruction, but not
immediately, the coprocessor handshake signals are driven to indicate
that the ARM9EJ-S processor core must stall until the coprocessor can
catch up. This is known as the busy-wait condition. In this case, the
ARM9EJ-S core loops in an Idle state waiting for CHSE[1:0] to be
driven to another state, or for an interrupt to occur.
If CHSE[1:0] changes to Absent, the Undefined instruction trap is taken.
If CHSE[1:0] changes to Go or Last, the instruction proceeds.
If an interrupt occurs, the ARM9EJ-S core is forced out of the busy-wait
state. This is indicated to the coprocessor by the PASS signal going
LOW. The instruction is restarted later and so the coprocessor must not
commit to the instruction (it must not change any of the coprocessor
state) until it has seen PASS HIGH, when the handshake signals indicate
the Go or Last condition.
Go The Go state indicates that the coprocessor can execute the instruction
immediately, and that it requires another cycle of execution. Both the
ARM9EJ-S core and the coprocessor must also consider the state of the
PASS signal before actually committing to the instruction. For an LDC
or STC instruction, the coprocessor instruction drives the handshake
signals with Go when two or more words still have to be transferred.
When only one more word is to be transferred, the coprocessor drives the
5-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
handshake signals with Last. During the Execute stage, the ARM9EJ-S
core outputs the address for the LDC or STC. Also in this cycle,
DnMREQ is driven LOW, indicating to the memory system that a
memory access is required at the data end of the device. The timing for
the data on RDATA[31:0] for an LDC and WDATA[31:0] for an STC
is shown in Figure 4-1 on page 4-4.
Last An LDC or STC can be used for more than one item of data. If this is the
case, possibly after busy waiting, the coprocessor drives the coprocessor
handshake signals with a number of Go states, and in the penultimate
cycle drives Last (Last indicating that the next transfer is the final one).
If there is only one transfer, the sequence is [Wait,[Wait,...]],Last.
Table 5-1 shows how the handshake signals CHSD[1:0] and CHSE[1:0] are encoded.
Handshake CHSD[1:0],
signal CHSE[1:0]
Absent 10
Wait 00
Go 01
Last 11
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-7
Coprocessor Interface
CLK
INSTR[31:0]
MCR/MRC
PADV
PASS
CHSD[1:0] LAST
CHSE[1:0] Ignored
WDATA[31:0]
(MCR)
RDATA[31:0]
(MRC)
First PADV is driven HIGH to denote that the instruction on INSTR[31:0] is entering
the Decode stage of the pipeline. This causes the coprocessor to decode the new
instruction and drive CHSD[1:0] as required.
In the next cycle PADV is driven HIGH to denote that the instruction has now been
issued to the Execute stage. If the condition codes pass, and the instruction is to be
executed, the PASS signal is driven HIGH and the CHSD[1:0] handshake bus is
examined by the core (it is ignored in all other cases).
For any successive Execute cycles the CHSE[1:0] handshake bus is examined. When
the Last condition is observed, the instruction is committed. In the case of an MCR, the
WDATA[31:0] bus is driven with the register data. In the case of an MRC,
RDATA[31:0] is sampled at the end of the ARM9EJ-S Memory stage and written to
the destination register during the next cycle.
5-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
CLK
INSTR[31:0]
MCRR/MRRC
PADV
PASS
CHSD[1:0] GO
RDATA[31:0]
Data1 Data2
(MRRC)
First PADV is driven HIGH to denote that the instruction on INSTR[31:0] is entering
the Decode stage of the pipeline. This causes the coprocessor to decode the new
instruction and drive CHSD[1:0] as required.
In the next cycle PADV is driven HIGH to denote that the instruction has now been
issued to the Execute stage. If the condition codes pass, and the instruction is to be
executed, the PASS signal is driven HIGH and the CHSD[1:0] handshake bus is
examined by the core (it is ignored in all other cases).
For any successive Execute cycles the CHSE[1:0] handshake bus is examined. When
the Last condition is observed, the instruction proceeds to its final Execute cycle. In the
case of an MCRR, the WDATA[31:0] bus is driven with the first register data during
the second Execute cycle, and the second register data in the Memory cycle. In the case
of an MRRC, RDATA[31:0] is sampled at the end of the second Execute and first
Memory cycles and written to the destination registers during the next cycle.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-9
Coprocessor Interface
Note
The CHSD must return its value in the second cycle (not interlocked).
CLK
INSTR[31:0]
MCR
PADV
PASS
LATECANCEL
WDATA[31:0]
(MCR)
RDATA[31:0]
(MRC)
5-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
CLK
INSTR[31:0]
MCR
PADV
PASS
LATECANCEL
CHSD[1:0] GO (ignored) GO
RDATA[31:0]
Data1 Data2
(MRRC)
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-11
Coprocessor Interface
5.7 CDP
CDP instructions normally execute in a single cycle. Like all the previous cycles,
PADV is driven HIGH to signal when an instruction enters the Decode stage and again
when it reaches the Execute stage of the pipeline:
• if the coprocessor can accept the instruction for execution, the PASS signal is
driven HIGH during the Execute cycle
• if the coprocessor can execute the instruction immediately it drives CHSD[1:0]
with Last
• if the instruction requires a busy-wait cycle, the coprocessor drives CHSD[1:0]
with Wait and then CHSE[1:0] with Last.
Figure 5-7 shows a CDP that is canceled because of the previous instruction causing a
Data Abort.
CLK
INSTR[31:0] CPRT
PADV
PASS
LATECANCEL
CHSD[1:0] LAST
CHSE[1:0] Ignored
DABORT
5-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
The CDP instruction enters the Execute stage of the pipeline and is signaled to execute
by PASS. In the following cycle LATECANCEL is asserted. This causes the
coprocessor to terminate execution of the CDP instruction and prevents the CDP
instruction from causing state changes to the coprocessor.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-13
Coprocessor Interface
CLK
INSTR[31:0] CPRT
PADV
InTRANS
/InM[4:0] Old Mode New Mode
PASS
LATECANCEL
CHSE[1:0] Ignored
The first two CHSD responses are ignored by the ARM9EJ-S core because it is only
the final CHSD response, as the instruction moves from Decode into Execute, that
counts. This enables the coprocessor to change its response as InTRANS/InM changes.
5-14 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
For interrupt latency reasons, the coprocessor can be interrupted while busy-waiting,
causing the instruction to be abandoned. To abandon execution the coprocessor must
monitor the state of PASS during every busy-wait cycle. If it is HIGH, the instruction
must still be executed. If it is LOW, the instruction must be abandoned. Figure 5-9
shows a busy-waited coprocessor instruction being abandoned because of an interrupt.
CLK
INSTR[31:0] Instr
PADV
PASS
LATECANCEL
CHSD[1:0] WAIT
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-15
Coprocessor Interface
CLK
INSTR[31:0]
MCR
PADV
DnMREQ
DSEQ
PASS
LATECANCEL
CHSD[1:0] GO
WDATA[31:0]
Coproc Data
(MCR)
5-16 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
1
RDATA
0 Memory
ARM9EJ-S system
WDATA
1
csel 1 0
bsel
CPDOUT
CPDIN
Coprocessor
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-17
Coprocessor Interface
Note
The RDATA enable term (asel) is specially constructed to select the coprocessor output
data during MRC and STC operations. This is to enable the connection of the ETM
module to the ARM9EJ-S core RDATA and WDATA buses while still enabling
tracing of MRC and STC data.
If you have multiple coprocessors in your system, connect the handshake signals as
shown in Table 5-2.
Signal Connection
PASS, LATECANCEL Connect these signals to all coprocessors present in the system.
CHSD, CHSE Combine the individual bit 1 of CHSD, and CHSE by ANDing.
Combine the individual bit 0 of CHSD, and CHSE by ORing.
Connect the CHSD, and CHSE inputs to the ARM9EJ-S core.
You must also multiplex the output data from the coprocessors.
Figure 5-12 on page 5-19 shows an example where VFP9 and two other coprocessors
are connected to the ARM9EJ-S processor using the coprocessor interface logic block.
5-18 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
F D E M W
CLK
nRESET
InMREQ
ISEQ
INSTR[31:0]
DnMREQ
DSEQ
DMORE
DnRW
DA[31:0]
The handshaking signals from the coprocessors can be combined by ANDing bit 1, and
ORing bit 0.
Figure 5-13 on page 5-20 shows example components of the handshaking logic in the
coprocessor interface logic block.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-19
Coprocessor Interface
CHSDCP2[1]
CHSDCP1[1] 1
CHSDVFP9[1]
CHSD[1:0]
CHSDCP2[0]
CHSDCP1[0] 0
CHSDVFP9[0]
CHSECP2[1]
CHSECP1[1] 1
CHSEVFP9[1]
CHSE[1:0]
CHSECP2[0]
CHSECP1[0] 0
CHSEVFP9[0]
For connecting to the RDATA[31:0] signals, there are two options for interfacing the
coprocessor data buses to the ARM9EJ-S processor:
• The coprocessor drives its data bus to logic 0 when not selected. This enables a
simple OR connection scheme as shown in Figure 5-14. This is the recommended
method of coprocessor data bus interfacing.
WDATA[31:0]
INSTR[31:0]
VFP9
CPDVFP9[31:0]
Coprocessor
ARM9EJ-S
processor
CPDCP1[31:0] Coprocessor
RDATA[31:0]
1
Coprocessor
CPDCP2[31:0]
2
5-20 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Coprocessor Interface
• Multiplexing the coprocessor data bus. For coprocessors that do not drive data
buses to logic 0 a multiplexor circuit is required. Multiplexor control is
determined by the coprocessor decoding the coprocessor number field bits [11:7]
in the MRC or STC instruction in the correct pipeline stage.
WDATA[31:0]
INSTR[31:0]
VFP9
CPDVFP9[31:0] Coprocessor
ARM9EJ-S
processor
Coprocessor
RDATA[31:0] CPDCP1[31:0]
1
Coprocessor
CPDCP2[31:0] 2
If you are implementing a system that does not include any external coprocessors, you
must tie both CHSD and CHSE to 10 (Absent). This indicates that no external
coprocessors are present in the system. If any coprocessor instructions are received,
they cause the processor to take the Undefined instruction trap, enabling the
coprocessor instructions to be emulated in software if required.
The coprocessor-specific outputs from the ARM9EJ-S core must be left unconnected:
• PASS
• LATECANCEL.
The ARM9EJ-S core implements full ARMv5TE Undefined instruction handling. This
means that any instruction defined in the ARM Architecture Reference Manual as
UNDEFINED, automatically causes the ARM9EJ-S core to take the Undefined
instruction trap. Any coprocessor instruction that is not accepted by a coprocessor also
results in the ARM9EJ-S core taking the Undefined instruction trap.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 5-21
Coprocessor Interface
5-22 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 6
Debug Interface and EmbeddedICE-RT
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-1
Debug Interface and EmbeddedICE-RT
The ARM9EJ-S contains hardware extensions for advanced debugging features. These
make it easier to develop application software, operating systems, and the hardware
itself. ARM9EJ-S core supports two modes of debug operation:
• Halt mode
• Monitor mode.
In Halt mode debug, the debug extensions enable the core to be forced into debug state.
In debug state, the core is stopped and isolated from the rest of the system. This enables
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 been completed, you can
restore the core and system state, and program execution is resumed.
6-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
Debug
Development system containing ARM9EJ-S
target
The debug host is a computer running a software debugger, such as armsd. The debug
host enables you to issue high-level commands such as setting breakpoints or
examining the contents of memory.
An interface, such as an RS232 or parallel connection, connects the debug host to the
ARM9EJ-S development system. The messages broad cast over this connection must
be converted to the interface signals of the ARM9EJ-S core. The protocol converter
performs this conversion.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-3
Debug Interface and EmbeddedICE-RT
The ARM9EJ-S core has hardware extensions that ease debugging at the lowest level.
The debug extensions:
• enable you to stall program execution by the core
• examine the core internal state
• examine the state of the memory system
• resume program execution.
ARM9EJ-S core This is the CPU core, with hardware support for debug.
EmbeddedICE-RT logic
This is a set of registers and comparators used to generate debug
exceptions (such as breakpoints). This unit is described in About
EmbeddedICE-RT on page 6-6.
TAP controller This controls the action of the scan chains using a JTAG serial
interface.
6-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
ARM9EJ-S
EmbeddedICE-RT ETM
Scan chain 1
interface
Main processor
Scan chain 2 logic
TAP controller
In Halt mode debug a request on one of the external debug interface signals, or on an
internal functional unit known as the EmbeddedICE-RT logic, forces the ARM9EJ-S
core into debug state. The events that activate debug are:
• a breakpoint (a given instruction Fetch)
• a watchpoint (a data access)
• an external debug request
• scanned debug request (a debug request scanned into the EmbeddedICE-RT
delay control register).
The internal state of the ARM9EJ-S core is examined using the JTAG serial interface,
that enables instructions to be serially inserted 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 ARM9EJ-S
registers. This data can be serially shifted out without affecting the rest of the system.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-5
Debug Interface and EmbeddedICE-RT
DBGEXT[1:0]
DBGCOMMRX
DBGCOMMTX
DBGRNG[1:0]
DBGACK
Processor EmbeddedICE-RT
DBGIEBKPT
EDBGRQ
DBGDEWPT
DBGEN
DBGTCKEN
DBGTMS
TAP DBGTDI
DBGTDO
CLK
DBGnTRST
The Debug Control Register and the Debug Status Register provide overall control of
EmbeddedICE-RT operation.
6-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
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-RT 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 to be either a watchpoint (monitoring data
accesses) or a breakpoint (monitoring instruction Fetches). Watchpoints and
breakpoints can be data-dependent in Halt mode debug.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-7
Debug Interface and EmbeddedICE-RT
Caution
Hard wiring the DBGEN input LOW permanently disables all debug functionality.
6-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
• DBGACK is used by the ARM9EJ-S core to flag back to the system that it is in
debug state.
An instruction being fetched from memory is sampled at the end of a cycle. To apply a
breakpoint to that instruction, you must assert the breakpoint signal by the end of the
same cycle. This is shown in Figure 6-4.
F1 D1 E1 M1 W1
F2 D2 E2 M2 W2
Breakpointed instruction FB DB (EB) (MB) (WB)
F3 (D3) (E3) (M3)
(F4) (D4) (E4)
Ddebug Edebug1 Edebug2
CLK
IA[31:1]
INSTR[31:0] 1 2 B 3 4
DBGIEBKPT
DBGACK
T1 T2 T3 T4 T5 T6 T7
You can build external logic, such as additional breakpoint comparators, to extend the
breakpoint functionality of the EmbeddedICE-RT logic. You must apply their output to
the DBGIEBKPT input.
Note
The timing of the DBGIEBKPT input makes it unlikely that data-dependent external
breakpoints are possible. DBGIEBKPT is not supported in Jazelle state, and must not
be asserted while the core is in Jazelle state.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-9
Debug Interface and EmbeddedICE-RT
A breakpointed instruction is enabled to enter the Execute stage of the pipeline, but any
state change as a result of the instruction is prevented. All instructions prior to the
breakpointed instruction complete as normal.
Note
If a breakpointed instruction does not reach the Execute stage, for instance, if an earlier
instruction is a branch, then both the breakpointed instruction and breakpoint status are
discarded and the ARM does not enter debug state.
The Decode cycle of the debug entry sequence occurs during the Execute cycle of the
breakpointed instruction.
In Figure 6-4 on page 6-9 instruction B is breakpointed. The debug entry sequence is
initiated when instruction B enters the Execute stage. The ARM completes the debug
entry sequence and asserts DBGACK two cycles later.
Note
In Thumb state when CFGTHUMB32 is HIGH the ARM9EJ-S core fetches
instructions in 32-bit quantities. To apply breakpoints on specific Thumb instructions
the breakpoint unit must use a slightly modified interface. Use an inverted version of
PADV instead of InMREQ and use THUMBHW instead of IA[1].
This interface change is valid for ARM and Thumb states with CFGTHUMB32 LOW
or HIGH.
A breakpointed instruction can have a Prefetch Abort associated with it. If so, the
Prefetch Abort takes priority and the breakpoint is ignored. (If there is a Prefetch Abort,
instruction data might be invalid, the breakpoint might have been data-dependent, and
because the data might be incorrect, the breakpoint might have been triggered
incorrectly.)
SWI and Undefined instructions are treated in the same way as any other instruction that
can have a breakpoint set on it. Therefore, the breakpoint takes priority over the SWI or
Undefined instruction.
6-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
When the processor has entered debug state, it is important that additional interrupts do
not affect the instructions executed. For this reason, as soon as the processor enters
debug state, interrupts are disabled, although the state of the I and F bits in the Program
Status Register (PSR) are not affected.
6.5.3 Watchpoints
Entry into debug state following a watchpointed memory access is imprecise. This is
necessary because of the nature of the pipeline.
You can build external logic, such as external watchpoint comparators, to extend the
functionality of the EmbeddedICE-RT logic. You must apply their output to the
DBGDEWPT input.
Note
The timing of the DBGDEWPT input makes it unlikely that data-dependent external
watchpoints are possible.
After a watchpointed access, the next instruction in the processor pipeline is always
allowed to complete execution. Where this instruction is a single-cycle data processing
instruction, entry into debug state is delayed for one cycle while the instruction
completes. The timing of debug entry following a watchpointed load in this case is
shown in Figure 6-5 on page 6-12.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-11
Debug Interface and EmbeddedICE-RT
F1 D1 E1 M1 W1
F2 D2 E2 M2 W2
Fldr Dldr Eldr Mldr Wldr
FDp DDp EDp MDp WDp
F5 D5 E5 M5 W5
Ddebug Edebug1 Edebug2
CLK
InMREQ
INSTR[31:0] 1 2 LDR Dp 5 6 7 8
DA[31:0]
WDATA[31:0]
RDATA[31:0]
DBGDEWPT
DBGACK
Although instruction 5 enters the Execute stage, it is not executed, and there is no state
update as a result of this instruction.
The instruction following the instruction that generated the watchpoint might have
modified the Program Counter (PC). If this happens, it is not possible to determine the
instruction that caused the watchpoint. A timing diagram showing debug entry after a
watchpoint where the next instruction is a branch is shown in Figure 6-6 on page 6-13.
6-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
CLK
InMREQ
IA[31:1]
DA[31:0]
WDATA[31:0]
RDATA[31:0]
DBGDEWPT
DBGACK
If the second instruction after the watchpointed instruction Prefetch Aborts then the
exception entry sequence is performed before the processor enters debug state.
You can always restart the processor. When the processor has entered debug state, the
ARM9EJ-S core can be interrogated to determine its state. In the case of a watchpoint,
the PC contains a value that is five instructions on from the address of the next
instruction to be executed. Therefore, if on entry to debug state, in ARM state, the
instruction SUB PC, PC, #20 is scanned in and the processor restarted, execution flow
returns to the next instruction in the code sequence.
If there is an abort with the data access as well as a watchpoint, the watchpoint condition
is latched, the exception entry sequence is performed, and then the processor enters
debug state. If there is an interrupt pending, the ARM9EJ-S core enables the exception
entry sequence to occur and then enters debug state.
A debug request can take place through the EmbeddedICE-RT logic or by asserting the
EDBGRQ signal. The request is registered and passed to the processor. Debug request
takes priority over any pending interrupt. Following registering, the core enters debug
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-13
Debug Interface and EmbeddedICE-RT
state when the instruction at the Execute stage of the pipeline has completely finished
executing (once Memory and Write stages of the pipeline have completed). While
waiting for the instruction to finish executing, no more instructions are issued to the
Execute stage of the pipeline.
When a debug request occurs, the ARM9EJ-S core enters debug state even if the
EmbeddedICE-RT is configured for monitor mode debug.
When the ARM9EJ-S is in debug state, both memory interfaces indicate internal cycles.
This enables the rest of the memory system to ignore the ARM9EJ-S core and function
as normal. Because the rest of the system continues operation, the ARM9EJ-S core
ignores aborts and interrupts.
The system must not change the CFGBIGEND signal while in debug state. If it
changes, not only is there a synchronization problem, but the view of the ARM9EJ-S
core seen by the programmer changes without the knowledge of the debugger. The
nRESET signal must also be held stable during debug. If the system applies reset to the
ARM9EJ-S core (nRESET is driven LOW), the state of the ARM9EJ-S core changes
without the knowledge of the debugger.
6-14 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
During normal operation, CLKEN conditions CLK to clock the core. When the
ARM9EJ-S core is in debug state, DBGTCKEN conditions CLK to clock the core.
If the system and test clocks are asynchronous, they must be synchronized externally to
the ARM9EJ-S core. The ARM Multi-ICE debug agent directly supports one or more
cores within an ASIC design. To synchronize off-chip debug clocking with the
ARM9EJ-S core requires a three-stage synchronizer. The off-chip device (for example,
Multi-ICE) issues a TCK signal, and waits for the RTCK (Returned TCK) signal to
come back. Synchronization is maintained because the off-chip device does not
progress to the next TCK until after RTCK is received. Figure 6-7 shows this
synchronization.
TDO DBGTDO
DBGTCKEN
RTCK
TCK D Q D Q D Q
ARM9EJ-S
CLK
TCK synchronizer EN
TMS D Q
DBGTMS
CLK
TDI EN DBGTDI
D Q
CLK
Multi-ICE
interface Input sample and hold
pads CLK
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-15
Debug Interface and EmbeddedICE-RT
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-RT debug status register. If 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-19.
6-16 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
These registers are located in fixed locations in the EmbeddedICE-RT logic register
map (as shown in EmbeddedICE-RT logic on page B-29) and are accessed from the
processor using MCR and MRC instructions to coprocessor 14.
In addition to the communications channel registers, the processor can access a 1-bit
debug status register for use in the Monitor mode debug configuration.
Register
Register name Notes
number
a. You can clear bit 0 of the communications channel control register by writing to it from the
debugger (JTAG) side.
Seen from the debugger, the registers are accessed using the scan chain in the usual way.
Seen from the processor, these registers are accessed using coprocessor register transfer
instructions.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-17
Debug Interface and EmbeddedICE-RT
Note
The Control Register must be viewed as read-only. However, the debugger can clear the
R bit by performing a write to the Debug Communications Channel Control Register.
This feature must not be used under normal circumstances.
The register controls synchronized handshaking between the processor and the
debugger. The Debug Communications Channel Control Register is shown in
Figure 6-8.
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
0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 W R
Bits Description
[31:28] Contain a fixed pattern that denotes the EmbeddedICE version number (in this case
0110).
[1] Denotes if the communications data write register is available (from the viewpoint
of the processor). Seen from the processor, if the communications data write
register is free (W=0), new data can be written. If the register is not free (W=1), the
processor must poll until W=0. Seen from the debugger, when W=1, some new
data has been written that can then be scanned out.
[0] Denotes if there is new data in the communications data read register. Seen from
the processor, if R=1, there is some new data that can be read using an MRC
instruction. Seen from the debugger, if R=0, the communications data read register
is free, and new data might be placed there through the scan chain. If R=1, this
denotes that data previously placed there through the scan chain has not been
collected by the processor, and so the debugger must wait.
6-18 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
Note
The Thumb instruction set does not support coprocessor instructions. Therefore, the
processor must be in ARM state before you can access the debug communications
channel.
The coprocessor 14 Monitor Mode Debug Status Register is provided for use by a
debug monitor when the ARM9EJ-S core is configured into the Monitor mode debug
mode.
The coprocessor 14 Monitor Mode Debug Status Register is a 1-bit wide read/write
register having the format shown in Figure 6-9.
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
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
DbgAbt bit
Bit 0 of the register, the DbgAbt bit, indicates if the processor took a Prefetch or Data
Abort in the past because of a breakpoint or watchpoint. If the ARM9EJ-S core takes a
Prefetch Abort as a result of a breakpoint or watchpoint, then the bit is set. If on a
particular instruction or data Fetch, both the debug abort and external abort signals are
asserted, the external abort takes priority and the DbgAbt bit is not set. You can read or
write the DbgAbt bit using MRC or MCR instructions.
A typical use of this bit is by a Monitor mode debug aware abort handler. This examines
the DbgAbt bit to determine if the abort was externally or internally generated. If the
DbgAbt bit is set, the abort handler initiates communication with the debugger over the
communications channel.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-19
Debug Interface and EmbeddedICE-RT
You can send and receive messages using the debug communications channel. These
are described in:
• Sending a message to the debugger
• Receiving a message from the debugger on page 6-21.
Before the processor can 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 Debug Communications Control Register to check the status of
the W bit:
• 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.
When the W bit is clear, a message is written by a register transfer to coprocessor 14.
Because the data transfer occurs from the processor to the communications data write
register, the W bit is set in the debug communications control register.
The debugger has two options available for reading data from the Communications
Data Write Register:
• Poll the Debug Communications Channel Control Register before reading the
communications data written. If the W bit is set, there is valid data present in the
Debug Communications Data Write Register. The debugger can then read this
data and scan the data out. The action of reading the data clears the Debug
Communications Channel Control Register W bit. Then the communications
process can begin again.
• Poll the Communications Data Write Register, obtaining data and valid status.
The data scanned out consists of the contents of the Communications Data Write
Register (that might or might not be valid), and a flag that indicates if the data read
is valid or not. The status flag is present in the Addr[0] bit position of scan chain
2 when the data is scanned out. See Test data registers on page B-10 for details
of scan chain 2.
6-20 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
• If the R bit is LOW, the communications 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 communications data read register is free, data is written there using the
JTAG interface. The action of this write sets the R bit in the debug communications
control register.
The processor polls the debug communications 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 debug communications 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.
• On removal of reset on DBGnTRST (0 to 1), after the next rising edge of CLK:
— reading the debug communications channel control register returns 00 in
the bottom two bits of the register (write register empty, read register
empty)
— DBGCOMMTX is set to 1 (transmit buffer empty).
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-21
Debug Interface and EmbeddedICE-RT
• The vector catching hardware can be used but must not be configured to catch the
Prefetch or Data Abort exceptions.
• No support is provided to mix Halt mode debug and monitor mode debug
functionality.
The fact that an abort has been generated by the monitor mode is recorded in the
monitor mode debug status register in coprocessor 14 (see Communications Channel
Monitor Mode Debug Status Register on page 6-19).
Because the monitor mode debug bit does not put the ARM9EJ-S core into debug state,
it now becomes necessary to change the contents of the watchpoint registers while
external memory accesses are taking place, rather than being changed when in debug
state. In the event that the watchpoint registers are written to during an access, all
matches from the affected watchpoint unit using the register being updated are disabled
for the cycle of the update.
6-22 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
1. Disable the watchpoint unit using the control register for that watchpoint unit.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-23
Debug Interface and EmbeddedICE-RT
This section describes how to use watchpoints and breakpoints in Jazelle state.
Note
Breakpoints and watchpoints might have exceptions occurring at the same time. The
behavior of these are described in:
• Breakpoints and exceptions on page 6-10
• Watchpoints and exceptions on page 6-13.
6.10.1 Watchpoints
Watchpoint comparisons are on data addresses and data values, the comparison
mechanism is unaltered for Jazelle state. The watchpoint is taken in the same fashion as
in ARM state, this means that after the load or store causing the watchpoint has
executed another execute cycle is completed.
6.10.2 Breakpoints
Breakpoint comparisons are made on the instruction address. There is also a dedicated
breakpoint instruction available in Jazelle state.
Note
Instruction data comparisons are not supported in Jazelle state.
Watchpoints Execute the LDR or STR and then take a data abort. The link register is
the PC value of the last instruction not to execute + 4. This enables the
following return command to be used, as in ARM state:
SUBS pc, lr, #4
Breakpoints Cause Prefetch Aborts. The link register is calculated in the same way as
normal Prefetch Aborts. The return instruction remains:
6-24 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug Interface and EmbeddedICE-RT
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 6-25
Debug Interface and EmbeddedICE-RT
6-26 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 7
Device Reset
This chapter describes the ARM9EJ-S reset behavior. It contains the following sections:
• About device reset on page 7-2
• Reset modes on page 7-3
• ARM9EJ-S core behavior on exit from reset on page 7-5.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 7-1
Device Reset
nRESET The nRESET signal is the main CPU reset that initializes the majority of
the ARM9EJ-S logic.
DBGnTRST The DBGnTRST signal is the debug logic reset that you can use to reset
the ARM9EJ-S TAP controller and the EmbeddedICE-RT unit.
Both nRESET and DBGnTRST are active LOW signals that asynchronously reset
logic in the ARM9EJ-S core. You must take care when designing the logic to drive
these reset signals.
7-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Device Reset
DBGnTRS
Reset mode nRESET Application
T
You must apply full system reset to the ARM9EJ-S core when power is first applied to
the system. In this case, the leading (falling) edge of the reset signals (nRESET and
DBGnTRST) do not have to be synchronous to CLK. The trailing (rising) edge of the
reset signals must be set up and held about the rising edge of the clock. You must do
this to ensure that the entire system leaves reset in a predictable manner. This is
particularly important in multi-processor systems. Figure 7-1 shows the application of
system reset.
CLK
nRESET
DBGnTRST
It is recommended that you assert the reset signals for at least three CLK cycles to
ensure correct reset behavior. Adopting a three-cycle reset eases the integration of other
ARM parts into the system, for example, ARM9TDMI-based designs.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 7-3
Device Reset
Core reset initializes the majority of the ARM9EJ-S CPU, excluding the ARM9EJ-S
TAP controller and the EmbeddedICE-RT unit. Core reset is typically used for resetting
a system that has been operating for some time, for example, watchdog reset.
Sometimes you might not want to reset the EmbeddedICE-RT unit when resetting the
rest of the ARM9EJ-S core, for example, if EmbeddedICE-RT has been configured to
breakpoint (or capture) Fetches from the reset vector.
For core reset, both the leading and trailing edges of nRESET must be set up and held
about the rising edge of CLK. This ensures that there are no metastability issues
between the ARM9EJ-S core and the EmbeddedICE-RT unit.
EmbeddedICE-RT reset initializes the state of the ARM9EJ-S TAP controller and the
EmbeddedICE-RT unit. EmbeddedICE-RT reset is typically used by the Multi-ICE
module for hot connection of a debugger to a system.
For EmbeddedICE-RT reset, both the leading and trailing edges of DBGnTRST must
be set up and held about the rising edge of CLK. This ensures that there are no
metastability issues between the ARM9EJ-S core and the EmbeddedICE-RT unit.
See Clocks and synchronization on page 6-15 for more details of synchronization
between the Multi-ICE and ARM9EJ-S core.
During normal operation, neither CPU reset nor EmbeddedICE-RT reset is asserted.
7-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Device Reset
The behavior of the memory interface coming out of reset is shown in Figure 7-2.
F D E M W
CLK
nRESET
InMREQ
ISEQ
INSTR[31:0]
DnMREQ
DSEQ
DMORE
DnRW
DA[31:0]
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 7-5
Device Reset
7-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 8
Instruction Cycle Times
This chapter gives the instruction cycle timings and illustrates interlock conditions
present in the ARM9EJ-S core design. It contains the following sections:
• Instruction cycle count summary on page 8-3
• Introduction to detailed instruction cycle timings on page 8-7
• Branch and ARM branch with link on page 8-9
• Thumb branch with link on page 8-10
• Branch and exchange on page 8-11
• Thumb Branch, Link, and Exchange <immediate> on page 8-12
• Data operations on page 8-13
• MRS on page 8-15
• MSR operations on page 8-16
• Multiply and multiply accumulate on page 8-17
• QADD, QDADD, QSUB, and QDSUB on page 8-21
• Load register on page 8-22
• Store register on page 8-27
• Load multiple registers on page 8-28
• Store multiple registers on page 8-31
• Load double register on page 8-32
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-1
Instruction Cycle Times
8-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Symbol Meaning
Table 8-2 summarizes the ARM9EJ-S instruction cycle counts and bus activity when
executing the ARM instruction set.
Instruction Data
Instruction Cycles Comment
bus bus
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-3
Instruction Cycle Times
Instruction Data
Instruction Cycles Comment
bus bus
LDR 3 1S+2I 1N+2I Not loading PC and shifted offset and following
instruction uses loaded word (1 cycle load-use
interlock).
LDM n 1S+(n-1)I 1N+(n-1)S Loading n registers, n > 1, not loading the PC.
LDM n+1 1S+nI 1N+(n-1)S+1I Loading n registers, n > 1, not loading the PC,
last word loaded used by following instruction.
LDM n+4 2S+1N+(n+1)I 1N+(n-1)S+4I Loading n registers including the PC, n > 0.
8-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Instruction Data
Instruction Cycles Comment
bus bus
MRRC b+3 1S+(b+2)I (b+1)I+2C Following instruction uses last transferred data.
MSR 3 1S+2I 3I If any bits other than the flags are updated (all
masks other than mask_f).
MUL, MLA 3 1S+2I 3I Following instruction uses the result in its first
Execute cycle or its first Memory cycle. Does
not apply to a multiply accumulate using result
for accumulate operand.
QADD, QDADD, 2 1S+1I 2I Following instruction uses the result in its first
QSUB, QDSUB Execute cycle.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-5
Instruction Cycle Times
Instruction Data
Instruction Cycles Comment
bus bus
SMULxy, SMLAxy 2 1S+1I 2I Following instruction uses the result in its first
Execute or its first Memory cycle. Does not
apply to a multiply accumulate using result for
accumulate operand.
SMULWx, SMLAWx 2 1S+1I 2I Following instruction uses the result in its first
Execute or its first Memory cycle. Does not
apply to a multiply accumulate using result for
accumulate operand.
8-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
The request, address, and control signals on both the instruction and data interfaces are
pipelined so that they are generated in the cycle before the one to which they apply, and
are shown as such in the following tables.
Note
All cycle counts in this chapter assume zero-wait-state memory access. In a system
where CLKEN is used to add wait states, the cycle counts must be adjusted
accordingly.
Table 8-3 shows the key to the cycle timing tables, Table 8-4 on page 8-9 to Table 8-36
on page 8-49.
Symbol Meaning
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-7
Instruction Cycle Times
Symbol Meaning
- Indicates that the signal is not active, and therefore not valid in this cycle.
A blank entry in the table indicates that the status of the signal is not
determined by the instruction in that cycle. The status of the signal is
determined either by the preceding or succeeding instruction.
8-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
1. During the first cycle, a branch instruction calculates the branch destination while
performing a Prefetch from the current PC. This Prefetch is performed in all case,
because by the time the decision to take the branch has been reached, it is already
too late to prevent the Prefetch. If the previous instruction requested a data
memory access, the data is transferred in this cycle.
2. During the second cycle, the ARM9EJ-S core performs a Fetch from the branch
destination. If the link bit is set, the return address to be stored in r14 is calculated.
3. During the third cycle, the ARM9EJ-S core performs a Fetch from the destination
+ i, refilling the instruction pipeline.
Table 8-4 Branch and ARM branch with link cycle timings
(pc’ + 2i) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-9
Instruction Cycle Times
1. The first instruction acts as a simple data operation. It takes a single cycle to add
the PC to the upper part of the offset, and stores the result in r14. If the previous
instruction requested a data memory access, the data is transferred in this cycle.
2. The second instruction acts similarly to the ARM BL instruction over three
cycles:
a. During the first cycle, the ARM9EJ-S core calculates the final branch target
address while performing a Prefetch from the current PC.
b. During the second cycle, the ARM9EJ-S core performs a Fetch from the
branch destination, while calculating the return address to be stored in r14.
c. During the third cycle, the ARM9EJ-S core performs a Fetch from the
destination + 2, refilling the instruction pipeline.
(pc’+i) -
8-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
1. During the first cycle, the ARM9EJ-S core extracts the branch destination and the
new core state while performing a Prefetch from the current PC. This Prefetch is
performed in all cases, because by the time the decision to take the branch has
been reached, it is already too late to prevent the Prefetch. In the case of BX and
BLX<register>, the branch destination new state comes from the register. For
BLX<immediate> the destination is calculated as a PC offset. The state is always
changed. If the previous instruction requested a memory access (and there is no
interlock in the case of BX, BLX <register>), the data is transferred in this cycle.
2. During the second cycle, the ARM9EJ-S core performs a Fetch from the branch
destination, using the new instruction width, dependent on the state that has been
selected. If the link bit is set, the return address to be stored in r14 is calculated.
3. During the third cycle, the ARM9EJ-S core performs a Fetch from the destination
+2 or +4 dependent on the new specified state, refilling the instruction pipeline.
(pc’ + 2i’) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-11
Instruction Cycle Times
1. The first instruction acts as a simple data operation. It takes a single cycle to add
the PC to the upper part of the offset, and stores the result in r14. If the previous
instruction requested a data memory access, the data is transferred in this cycle.
(pc’+2i’) -
8-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
The ALU combines the A bus operand with the (shifted) B bus operand according to
the operation specified in the instruction. The ARM9EJ-S core pipelines this result and
writes it into the destination register, when required. Compare and test operations do not
write a result because they only affect the status flags.
An instruction Prefetch occurs at the same time as the data operation, and the PC is
incremented.
When a register specified shift is used, an additional execute cycle is required to read
the shifting register operand. The instruction Prefetch occurs during this first cycle.
The PC can be one or more of the register operands. When the PC is the destination, the
external bus activity is affected. When the ARM9EJ-S core writes the result to the PC,
the contents of the instruction pipeline are invalidated, and the ARM9EJ-S core takes
the address for the next instruction Prefetch from the ALU rather than the incremented
address. The ARM9EJ-S core refills the instruction pipeline before any more
instruction execution takes place. Exceptions are locked out while the pipeline is
refilling.
Note
Shifted register with destination equals PC is not possible in Thumb state.
(pc+3i) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-13
Instruction Cycle Times
(pc+3i) -
(pc’+2i) -
8-14 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
8.8 MRS
An MRS operation always takes two cycles to execute. The first cycle enables any
pending state changes to the PSR to be made. The second cycle passes the PSR register
through the ALU so that it can be written to the destination register.
Note
The MRS instruction can only be executed when in ARM state.
(pc+3i) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-15
Instruction Cycle Times
Note
MSR instructions can only be executed in ARM state.
(pc+3i) -
(pc+3i) -
8-16 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
During the first (Execute) stage of a multiply instruction, the multiplier and
multiplicand operands are read onto the A and B buses, on which the multiplier unit is
connected. The first stage of the multiplier performs Booth recoding and partial product
summation, using 16 bits of the multiplier operand each cycle.
During the second (Memory) stage of a multiply instruction, the partial product result
from the Execute stage is added with an optional accumulate term (read onto the C bus)
and a possible feedback term from a previous multiply step for multiplications that
require additional cycles.
Note
In Thumb state, only the MULS and MLAS operations are possible.
8.10.1 Interlocks
The multiply unit in the ARM9EJ-S core operates in both the Execute and Memory
stage of the pipeline. Because of this, the multiplier result is not available until the end
of the Memory stage of the pipeline. If the following instruction requires the use of the
multiplier result, then it must be interlocked so that the correct value is available. This
applies to all instructions that require the multiply result for the first Execute cycle or
first Memory cycle of the instruction except for multiply accumulate instructions using
the previous multiply result as the accumulator operand.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-17
Instruction Cycle Times
Table 8-11 shows the cycle timing for MUL and MLA instructions with and without
interlocks.
(pc+3i) -
(pc+3i) -
The MULS and MLAS instructions always take four cycles to execute, and cannot generate
interlocks in following instructions.
Table 8-12 shows the cycle timing for MULS and MLAS instructions.
(pc+3i) -
8-18 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Table 8-13 shows the cycle timing for SMULL, UMULL, SMLAL, and UMLAL instructions with
and without interlocks.
(pc+3i) -
(pc+3i) -
The SMULLS, UMULLS, SMLALS, and UMLALS instructions always take five cycles to execute,
and cannot generate interlocks in following instructions.
Table 8-14 shows the cycle timing for the SMULLS, UMULLS, SMLALS, and UMLALS
instructions.
(pc+3i) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-19
Instruction Cycle Times
Table 8-15 shows the cycle timing for SMULxy, SMLAxy, SMULWy, and SMLAWy instructions
with and without interlocks.
b b (pc+3i) b -
(pc+3i) -
Table 8-16 shows the cycle timing for SMLALxy instructions with and without interlocks.
(pc+3i) -
(pc+3i) -
8-20 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
8.11.1 Interlocks
The instructions in this class use both the Execute and Memory stages of the pipeline.
Because of this, the result of an instruction in this class is not available until the end of
the Memory stage of the pipeline. If a following instruction requires the use of the
result, then it must be interlocked so that the correct value is available. This applies to
all instructions that require the result for the first Execute cycle. Instructions that require
the result of a QADD or similar instruction for the first Memory cycle do not incur an
interlock.
Table 8-17 shows the cycle timing for QADD, QDADD, QSUB, and QDSUB
instructions with and without interlocks.
(pc+3i) b -
(pc+3i) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-21
Instruction Cycle Times
Note
Destination equals PC is not possible in Thumb state.
8.12.1 Interlocks
The result of an aligned word load instruction is not available until the end of the
Memory stage of the pipeline. If the following instruction requires the use of this result
then it must be interlocked so that the correct value is available. This interlock is
referred to as a single-cycle load-use interlock.
Unaligned word loads, load byte (LDRB), and load halfword (LDRH) instructions use
the byte rotate unit in the Write stage of the pipeline. This introduces a two-cycle
load-use interlock, that can affect the two instructions immediately following the load
instruction.
Once an interlock has been incurred for one instruction it does not have to be incurred
for a later instruction.
8-22 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
For example, the following sequence incurs a two-cycle interlock on the first ADD
instruction, but the second ADD does not incur any interlocks:
LDRB r0, [r1, #1]
ADD r2, r0, r3
ADD r4, r0, r5
A two-cycle interlock refers to the number of unwaited ARM9EJ-S core clock cycles
to which the interlock applies. If a multi-cycle instruction separates a load instruction
and the instruction using the result of the load, then no interlock can apply. The
following example does not incur an interlock:
LDRB r0, [r1]
MUL r6, r7, r8
ADD r4, r0, r5
There is no forwarding path from loaded data to the C read port of the register bank, that
is used for the store data of STR and STM instructions and for the accumulate operand
of multiply accumulate instructions. The result of a load must reach the Write stage of
the pipeline before it can be made available at the C read port, resulting in a single-cycle
load-use interlock from loaded data to the C read port.
Most interlock conditions are determined when the instruction being interlocked is still
in the Decode stage of the pipeline. Load multiple and Store multiple instructions can
incur a Decode stage interlock when the base register is not available because of a
previous instruction. Store multiple instructions can also incur an Execute stage
interlock when the first register to be stored is not available because of a previous
instruction. This is referred to as a second-cycle interlock.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-23
Instruction Cycle Times
A second-cycle interlock can be incurred on the first word of data stored by an STM
instruction or during the first cycle of a register controlled shift. The following example
does not incur an interlock:
LDR r3, [r1]
STMIA r0, {r2-r3}
Table 8-18 shows the cycle timing for basic load register operations, where:
InMREQ, DnMREQ,
Cycle IA INSTR DA DnTRANS RDATA
ISEQ DSEQ
(pc+3i) (da)
(pc+3i) (da)
(pc’+2i) -
8-24 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
InMREQ, DnMREQ,
Cycle IA INSTR DA DnTRANS RDATA
ISEQ DSEQ
(pc’+2i) -
Note
Destination equals PC is not possible in Thumb state.
Table 8-19 shows the cycle timing for load operations resulting in simple interlocks.
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA
ISEQ DSEQ
(pc+3i) -
(pc+3i) -
With more complicated interlock cases you cannot consider the load instruction in
isolation. This is because in these cases the load instruction has vacated the Execute
stage of the pipeline and a later instruction has occupied it.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-25
Instruction Cycle Times
Table 8-20 shows the one-cycle interlock incurred for the following sequence of
instructions:
LDRB r0, [r1]
ADD r6, r6, r3
ADD r2, r0, r1
Table 8-20 Example sequence LDRB, ADD and ADD cycle timing
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA
ISEQ DSEQ
(pc+5i) -
Table 8-21 shows the cycle timing for the following code sequence:
LDRB r0, [r2]
STMIA r3, {r0-r1}
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA
ISEQ DSEQ
(pc+4i) r1
8-26 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Table 8-22 shows the cycle timing for a store register operation, where:
(pc+3i) Rd
(pc+3i) Rd
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-27
Instruction Cycle Times
1. During the first cycle, the ARM9EJ-S core calculates the address of the first word
to be transferred, while performing an instruction Prefetch.
2. During the second and subsequent cycles, ARM9EJ-S core reads the data
requested in the previous cycle and calculates the address of the next word to be
transferred. The new value for the base register is calculated.
When a Data Abort occurs, the instruction continues to completion. The ARM9EJ-S
core prevents all register writing after the abort. The ARM9EJ-S core restores the
modified base pointer (that the load activity before the abort occurred might have
overwritten).
When the PC is in the list of registers to be loaded, the ARM9EJ-S core invalidates the
current contents of the instruction pipeline. The PC is always the last register to be
loaded, so an abort at any point prevents the PC from being overwritten.
Note
LDM with destination = PC cannot be executed in Thumb state. However, POP{Rlist,
PC} equates to an LDM with destination = PC.
8.14.1 Interlocks
8-28 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA
ISEQ DSEQ
(pc+3i) -
(pc+3i) (da++)
(pc’+2i) -
(pc’+2i) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-29
Instruction Cycle Times
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA
ISEQ DSEQ
(pc+3i) -
8-30 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
1. During the first cycle, the ARM9EJ-S core calculates the address of the first word
to be transferred, while performing an instruction Prefetch and also calculating
the new value for the base register.
2. During the second and subsequent cycles, ARM9EJ-S core stores the data
requested in the previous cycle and calculates the address of the next word to be
transferred.
When a Data Abort occurs, the instruction continues to completion. The ARM9EJ-S
core restores the modified base pointer (that the load activity before the abort occurred
might have overwritten).
InMREQ, DnMREQ,
Cycle IA INSTR DA WDATA
ISEQ DSEQ
(pc+3i) -
(pc+3i) R’’’
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-31
Instruction Cycle Times
8-32 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-33
Instruction Cycle Times
The swap operation might be aborted in either the read or the write cycle. An aborted
swap operation does not affect the destination register.
Note
Data swap instructions are not available in Thumb state.
The DLOCK output of ARM9EJ-S core is driven HIGH for both read and write cycles
to indicate to the memory system that it is an atomic operation.
8.18.1 Interlocks
A swap operation can cause one and two-cycle interlocks in a similar fashion to a load
register instruction.
Table 8-25 shows the cycle timing for the basic data swap operation.
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA WDATA
ISEQ DSEQ
(pc+3i) - Rd
(pc+3i) - -
8-34 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA WDATA
ISEQ DSEQ
(pc+3i) - -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-35
Instruction Cycle Times
8.19 PLD
A PLD operation executes in a single cycle. During the Execute cycle, the Prefetch
address is calculated and broadcast on DA[31:0]. DnMREQ and DSEQ indicate an
internal cycle, and DnSPEC is asserted.
InMREQ, DnMREQ,
Cycle IA INSTR DA RDATA WDATA
ISEQ DSEQ
(pc+3i) - -
8-36 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
1. During the first cycle, the ARM9EJ-S core constructs the forced address, and a
mode change might take place.
2. During the second cycle, the ARM9EJ-S core performs a Fetch from the
exception address. The return address to be stored in r14 is calculated. The state
of the CPSR is saved in the relevant SPSR.
3. During the third cycle, the ARM9EJ-S core performs a Fetch from the exception
address + 4, refilling the instruction pipeline.
The exception entry cycle timings are show in Table 8-27, where:
pc Is one of:
• the address of the SWI instruction for SWIs
• the address of the instruction following the last one to be executed
before entering the exception for interrupts
• the address of the aborted instruction for Prefetch Aborts
• the address of the instruction following the one that attempted the
aborted data transfer for Data Aborts.
1 Xn N cycle 1 0 - I cycle
(Xn+8) -
Note
The value on the INSTR bus can be unpredictable in the case of Prefetch Abort or Data
Abort entry.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-37
Instruction Cycle Times
If the coprocessor cannot perform the requested task, it leaves CHSD at Absent. When
the coprocessor is able to perform the task, but cannot commit immediately, the
coprocessor drives CHSD to Wait, and in subsequent cycles drives CHSE to Wait until
able to commit, where it drives CHSE to Last.
Note
Coprocessor operations are only available in ARM state.
The coprocessor data operation cycle timings are shown in Table 8-28.
RDATA/
Cycle IA IREQa INSTR DA DREQb Pc LCd CHSD CHSE
WDATA
Ready Last
(pc+3i) -
Not Wait
ready
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
(pc+3i) -
8-38 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
The coprocessor commits to the transfer only when it is ready to accept the data. The
coprocessor indicates that it is ready for the transfer to commence by driving CHSD or
CHSE to Go. The ARM9EJ-S core produces addresses and requests data memory reads
on behalf of the coprocessor, that is expected to accept the data at sequential rates. The
coprocessor is responsible for determining the number of words to be transferred. It
indicates this using the CHSD and CHSE signals, setting the appropriate signal to Last
in the cycle before it is ready to initiate the transfer of the last data word.
Note
Coprocessor operations are only available in ARM state.
The load coprocessor register cycle timings are shown in Table 8-29.
1 register Last
ready
1 pc+3i S cycle (pc+2i) da N cycle 1 0 -
(pc+3i) (da)
1 register Wait
not ready
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
(pc+3i) (da)
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-39
Instruction Cycle Times
m registers Go
(m > 1)
1 pc+3i I cycle (pc+2i) da N cycle 1 0 Go
ready
2 pc+3i I cycle - da++ S cycle (da) 1 0 Go
(pc+3i) (da++)
m registers Wait
(m > 1)
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
not ready
. pc+3i I cycle - - I cycle - 1 0 Wait
8-40 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
The coprocessor commits to the transfer only when it is ready to write the data. The
coprocessor indicates that it is ready for the transfer to commence by driving CHSD or
CHSE to Go. The ARM9EJ-S core produces addresses and requests data memory
writes on behalf of the coprocessor, that is expected to produce the data at sequential
rates. The coprocessor is responsible for determining the number of words to be
transferred. It indicates this using the CHSD and CHSE signals, setting the appropriate
signal to Last in the cycle before it is ready to initiate the transfer of the last data word.
Note
Coprocessor operations are only available in ARM state.
The store coprocessor register cycle timings are shown in Table 8-30.
1 register Last
ready
1 pc+3i S cycle (pc+2i) da N cycle 1 0 -
(pc+3i) CPData1
1 register Wait
not ready
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
(pc+3i) CPData1
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-41
Instruction Cycle Times
m Go
registers
1 pc+3i I cycle (pc+2i) da N cycle 1 0 Go
(m > 1)
ready 2 pc+3i I cycle - da++ S cycle CPData1 1 0 Go
(pc+3i) CPDatam
m Wait
registers
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
(m > 1)
not ready . pc+3i I cycle - - I cycle - 1 0 Wait
(pc+3i) CPDatam
8-42 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Data is transferred over the data bus interface, in a similar fashion to a load register
operation.
Note
Coprocessor operations are only available in ARM state.
Ready Last
(pc+3i) CPData
(pc+3i) CPData
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-43
Instruction Cycle Times
Data is transferred over the data bus interface, in a similar fashion to a store register
operation.
Note
Coprocessor operations are only available in ARM state.
Ready Last
(pc+3i) Rd
Not Wait
ready
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
(pc+3i) Rd
8-44 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Data is transferred over the data bus interface, in a similar fashion to a load register
operation.
Note
Coprocessor operations are only available in ARM state.
Ready Go
(pc+3i) CPData2
(pc+3i) CPData2
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-45
Instruction Cycle Times
Data is transferred over the data bus interface, in a similar fashion to a store register
operation.
Note
Coprocessor operations are only available in ARM state.
Ready Go
(pc+3i) Rn
Not Wait
ready
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
Rn
8-46 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Note
By default, CHSD and CHSE must be driven to Absent unless the coprocessor
instruction is being handled by a coprocessor. Coprocessor operations are only
available in ARM state.
The cycle timings for coprocessor absent instructions are shown in Table 8-35.
RDATA/
Cycle IA IREQa INSTR DA DREQb Pc LCd CHSD CHSE
WDATA
Coprocessor Absent
absent in
1 pc+3i I cycle (pc+2i) - I cycle 1 0 - -
decode
2 0x4 N cycle - - I cycle - 0 0 - -
(0xC) -
Coprocessor Wait
absent in
1 pc+3i I cycle (pc+2i) - I cycle 1 0 Wait
execute
. pc+3i I cycle - - I cycle - 0 0 Wait
(0xC) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-47
Instruction Cycle Times
8-48 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Instruction Cycle Times
Table 8-36 shows the instruction cycle timing for an unexecuted instruction.
(pc + 3i) -
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 8-49
Instruction Cycle Times
8-50 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Chapter 9
AC Parameters
This chapter gives the AC timing parameters of the ARM9EJ-S core. It contains the
following sections:
• Timing diagrams on page 9-2
• AC timing parameter definitions on page 9-9.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 9-1
AC Parameters
Instruction memory interface timing parameters are shown in Figure 9-1 on page 9-3.
9-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
AC Parameters
CLK
InMREQ
InMREQ,
Tovinmreq
Tohinmreq
ISEQ ISEQ
Toviseq
Tohiseq
IA[31:1] Address
Toviaddr
Tohiaddr
InTRANS
InM[4:0]
ITBIT Control
IJBIT Tovictl
Tohictl
IKILL Control
Tovikill
Tohikill
INSTR[31:0]
Tisinstr
Tihinstr
IABORT
Tisiabort
Tihiabort
DBGIEBKPT
Tisiebkpt
Tihiebkpt
Data memory interface timing parameters are shown in Figure 9-2 on page 9-4.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 9-3
AC Parameters
CLK
DnMREQ,
DSEQ,
DMORE, TRANS
DnSPEC Tovdtrans
Tohdtrans
DBURST[3:0]
DA[31:0] Address
Tovdaddr
Tohdaddr
DnRW,
DMAS[1:0],
DLOCK, Control
DnTRANS, Tovdctl
Tohdctl
DnM[4:0]
WDATA[31:0] Data
Tovwdata
Tohwdata
DKILL Data
Tovdkill
Tohdkill
RDATA[31:0]
Tisrdata
Tihrdata
DABORT
Tisdabort
Tihdabort
DBGDEWPT
Tisdewpt
Tihdewpt
CLK
CLKEN
Tisclken
Tihclken
Coprocessor interface timing parameters are shown in Figure 9-4 on page 9-5.
9-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
AC Parameters
CLK
PASS
Tovpass
Tohpass
LATECANCEL
Tovlate
Tohlate
CHSD[1:0]
Tischsd
Tihchsd
CHSE[1:0]
Tischse
Tihchse
CLK
nFIQ,
nIRQ
Tisint
Tihint
nRESET
Tisnreset
Tihnreset
CFGBIGEND,
CFGDISLTBIT,
CFGHIVECS Tiscfg
CFGTHUMB32 Tihcfg
Debug interface timing parameters are shown in Figure 9-6 on page 9-6.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 9-5
AC Parameters
CLK
DBGACK
Tovdbgack
Tohdbgack
DBGRNG[1:0]
Tovdbgrng
Tohdbgrng
DBGRQI
Tovdbgrqi
Tohdbgrqi
DBGINSTREXEC,
DBGINSTRVALID
Tovdbgstat
Tohdbgstat
DBGCOMMRX,
DBGCOMMTX
Tovdbgcomm
Tohdbgcomm
DBGEN,
EDBGRQ,
DBGEXT[1:0]
Tisdbgin
Tihdbgin
CLK
FIQDIS,
IRQDIS
Tovintdis
Tohintdis
JTAG interface timing parameters are shown in Figure 9-8 on page 9-7.
9-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
AC Parameters
CLK
DBGIR[3:0],
DBGSCREG[4:0],
DBGTAPMS[3:0] Tovdbgsm
Tohdbgsm
DBGnTDOEN
Tovtdoen
Tohtdoen
DBGSDIN
Tovsdin
Tohsdin
DBGTDO
Tovtdo
Tohtdo
DBGnTRST
Tisntrst
Tihntrst
DBGTDI,
DBGTMS
Tistdi
Tihtdi
DBGTCKEN
Tistcken
Tihtcken
TAPID
Tistapid
Tihtapid
DBGSDOUT
DBGTDO
Ttdsh
Ttdsd
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 9-7
AC Parameters
CLK
ETMZIFIRST
ETMZILAST
Tovetmzi Tohetmzi
CLK
ETMIAFE [31:0]
Tovetmiafe Tohetmiafe
CLK
PADV
Tovpadv Tohpadv
9-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
AC Parameters
Note
The figures quoted are relative to the rising clock edge after the clock skew for internal
buffering has been added. Inputs given a 0% hold figure therefore require a positive
hold relative to the top-level clock input. The amount of hold required is equivalent to
the internal clock skew.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 9-9
AC Parameters
9-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
AC Parameters
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. 9-11
AC Parameters
9-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Appendix A
Signal Descriptions
This appendix lists and describes all the ARM9EJ-S interface signals. It contains the
following sections:
• Clock interface signals on page A-2
• Instruction memory interface signals on page A-3
• Data memory interface signals on page A-5
• Miscellaneous signals on page A-7
• Coprocessor interface signals on page A-8
• Debug signals on page A-9
• ETM Interface signals on page A-12.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. A-1
Signal Descriptions
CORECLKENOUT Output The principal state advance signal for the ARM9EJ-S
core.
A-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Signal Descriptions
InMREQ Output If LOW at the end the cycle, then the processor
Not instruction requires a memory access during the following
memory request cycle.
InM[4:0] Output These contain the current mode of the processor and
Instruction mode are valid with the address.
ISEQ Output If HIGH at the end of the cycle then any instruction
Instruction Sequential memory access during the following cycle is
Sequential from the last instruction memory access.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. A-3
Signal Descriptions
A-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Signal Descriptions
RDATA [31:0] Input This bus is used to transfer data between the
Read data memory system and the processor during read
cycles (when DnRW is LOW).
WDATA [31: 0] Output This bus is used to transfer data between the
Write data memory system and the processor during write
cycles (when DnRW is HIGH).
DMORE Output If HIGH at the end of the cycle, then the data
Data more memory access in the following cycle is directly
followed by a Sequential data memory access.
DnMREQ Output If LOW at the end the cycle, then the processor
Not data memory requires a data memory access in the following
request cycle.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. A-5
Signal Descriptions
DnRW Output If LOW at the end of the cycle, then any data
Data not read, write memory access in the following cycle is a read.
If HIGH then it is a write.
DnSPEC Not data Output If LOW at the end of the cycle, then the
speculative request processor is indicating to the memory system
that the data stored at the memory location
specified by DA might be required in
subsequent cycles. DnSPEC is a speculative
signal, so the memory system does not have to
perform any action based on DnSPEC unless it
sees fit. The memory system must return an
abort for a speculative access. DnSPEC is not
asserted in the same cycle as DnMREQ.
DSEQ Output If HIGH at the end of the cycle, then any data
Data Sequential address memory access in the following cycle is
Sequential from the last data memory access.
A-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Signal Descriptions
nFIQ Input This is the Fast Interrupt Request signal. This input is a
Not fast interrupt synchronous input to the core. It is not synchronized
internally to the core.
CFGTHUMB32 Input If HIGH, then the ARM9EJ-S core issues 32-bit Fetches
in Thumb state. If LOW, then the ARM9EJ-S core
issues16-bit Fetches in Thumb state.
nRESET Input This active LOW reset signal is used to start the
Not reset processor from a known address. This is a level-sensitive
asynchronous reset.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. A-7
Signal Descriptions
A-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Signal Descriptions
DBGIR[3:0] Output These four bits reflect the current instruction loaded
TAP controller into the TAP controller instruction register. These bits
instruction register change when the TAP state machine is in the
UPDATE-IR state.
DBGnTRST Input This is the active LOW reset signal for the
Not test reset EmbeddedICE internal state. This signal is a
level-sensitive asynchronous reset input.
DBGnTDOEN Output When LOW, this signal denotes that serial data is
Not DBGTDO being driven out on the DBGTDO output.
enable DBGnTDOEN is usually used as an output enable for
a DBGTDO pin in a packaged part.
DBGSCREG[4:0] Output These five bits reflect currently selected scan chain by
Scan chain select the TAP Scan Chain Register controller. These bits
number change when the TAP state machine is in the
UPDATE-DR state.
DBGSDOUT Input This is the serial data out of an external scan chain.
Input boundary When an external boundary scan chain is not
scan serial output connected, this input must be tied LOW.
data
DBGTAPSM[3:0] Output This bus reflects the current state of the TAP controller
TAP controller state state machine.
machine
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. A-9
Signal Descriptions
DBGEN Input This input signal enables the debug features of the
Debug enable processor to be disabled. This signal must be LOW
when debugging is not required.
DBGRQI Output This signal represents the state of bit 1 of the debug
Internal debug control register that is combined with EDBGRQ and
request presented to the core debug logic.
A-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Signal Descriptions
TAPID[31:0] Input This input specifies the ID code value shifted out on
Boundary scan ID DBGTDO when the IDCODE instruction is entered
code into the TAP controller.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. A-11
Signal Descriptions
ETMZIFIRST Output Indicates the current decode cycle is the first being
traced for the current Jazelle instruction.
ETMZILAST Output Indicates the current decode cycle is the last being
traced for the current Jazelle instruction.
A-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Appendix B
Debug in Depth
This appendix describes in more detail the debug features of the ARM9EJ-S core, and
includes additional information about the EmbeddedICE-RT logic. It contains the
following sections:
• Scan chains and JTAG interface on page B-2
• Resetting the TAP controller on page B-5
• Instruction register on page B-6
• Public instructions on page B-7
• Test data registers on page B-10
• ARM9EJ-S core clock domains on page B-18
• Determining the core and system state on page B-19
• Behavior of the program counter during debug on page B-25
• Priorities and exceptions on page B-28
• EmbeddedICE-RT logic on page B-29
• Vector catching on page B-41
• Coupling breakpoints and watchpoints on page B-42
• Disabling EmbeddedICE-RT on page B-45
• EmbeddedICE-RT timing on page B-46.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-1
Debug in Depth
The scan chains enable commands to be serially shifted into the ARM core, so that the
state of the core and the system can be interrogated. The JTAG interface requires only
five pins on the package.
A JTAG style Test Access Port (TAP) controller controls the scan chains. For more
details of the JTAG specification, see IEEE Standard 1149.1 - 1990 Standard Test
Access Port and Boundary-Scan Architecture.
The two scan paths used for debug purposes are referred to as scan chain 1 and scan
chain 2, and are shown in Figure B-1.
ARM9EJ-S
EmbeddedICE-RT ETM
Scan chain 1
interface
Main processor
Scan chain 2 logic
TAP controller
Scan chain 1
Scan chain 1 is used for debugging the ARM9EJ-S core when it has entered debug state.
You can use it to:
• inject instructions into the ARM pipeline
B-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Scan chain 2
Scan chain 2 enables access to the EmbeddedICE-RT registers. See Test data registers
on page B-10 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-4 shows the state transitions that occur in the TAP
controller. The state numbers shown in the diagram are output from the ARM9EJ-S
core on the DBGTAPSM[3:0] bits.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-3
Debug in Depth
Test-Logic-Reset
0xF
tms=1
tms=0
tms=1 tms=1
Capture-DR Capture-IR
0x6 0xE
tms=0 tms=0
Shift-DR Shift-IR
0x2 0xA
tms=0 tms=0
tms=1 tms=1
tms=0 tms=0
Pause-DR Pause-IR
0x3 0xB
tms=0 tms=0
tms=1 tms=1
tms=0 tms=0
Exit2-DR Exit2-IR
0x0 0x8
tms=1 tms=1
Update-DR Update-IR
0x5 0xD
1. From IEEE Std 1149.1-1990. Copyright 1999 IEEE. All rights reserved.
B-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
• to ready the boundary-scan interface for use, drive DBGnTRST LOW, and then
HIGH again
• to prevent the boundary scan interface from being used, the DBGnTRST input
can be tied permanently LOW.
Note
A clock on CLK with DBGTCKEN HIGH is not necessary to reset the device.
1. System mode is selected. This means that the boundary-scan cells do not intercept
any of the signals passing between the external system and the core.
2. The IDCODE instruction is selected. When the TAP controller is put into the
SHIFT-DR state, and CLK is pulsed while enabled by DBGTCKEN, the
contents of the ID register are clocked out of DBGTDO.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-5
Debug in Depth
The fixed value b0001 is loaded into the instruction register during the CAPTURE-IR
controller state.
B-6 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
In the following descriptions, the ARM9EJ-S core samples DBGTDI and DBGTMS
on the rising edge of CLK with DBGTCKEN HIGH. All output transitions on
DBGTDO occur as a result of the rising edge of CLK with DBGTCKEN HIGH.
The EXTEST instruction enables a boundary scan chain to be connected between the
DBGSDIN and DBGSDOUT pins. External logic, based on the DBGTAPSM,
DBGSCREG, and DBGIR signals is required to use the EXTEST function for such a
boundary scan chain. Using EXTEST with scan chain 1 or scan chain 2 selected is
UNPREDICTABLE.
You must use this instruction to preload the boundary scan register with known data
prior to selecting INTEST or EXTEST instructions.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-7
Debug in Depth
The SCAN_N instruction connects the scan path select register between DBGTDI and
DBGTDO:
• In the CAPTURE-DR state, the fixed value 10000 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 DBGTDI and DBGTDO, and remains connected until a subsequent
SCAN_N instruction is issued.
The scan path select register is five bits long in this implementation, although no finite
length is specified.
The INTEST instruction places the selected scan chain in test mode:
• The INTEST instruction connects the selected scan chain between DBGTDI and
DBGTDO.
• When the INTEST instruction is loaded into the instruction register, all the scan
cells are placed in their test mode of operation. For example, in test mode, input
cells select the output of the scan chain to be applied to the core.
• 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 DBGTDO pin, while new test data is shifted in through the
DBGTDI pin.
The IDCODE instruction connects the device identification code register (or
ID register) between DBGTDI and DBGTDO. The ID register is a 32-bit register that
enables the manufacturer, part number, and version of a component to be read through
the TAP. See ARM9EJ-S core device identification (ID) code register on page B-10 for
details of the ID register format.
B-8 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
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
DBGTDI and DBGTDO.
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
DBGTDI, and shifted out through DBGTDO after a delay of one CLK cycle.
The first bit to shift out is a zero.
The RESTART instruction is used to restart the processor on exit from debug state. The
RESTART instruction connects the bypass register between DBGTDI and DBGTDO,
and the TAP controller behaves as if the BYPASS instruction has been loaded.
The processor exits debug state when the RUN-TEST/IDLE state is entered.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-9
Debug in Depth
In addition, other scan chains can be added between DBGSDOUT and DBGSDIN, and
selected when in INTEST mode.
In the following descriptions, data is shifted during every CLK cycle when
DBGTCKEN enable is HIGH.
The Bypass register purpose, bit length, and operating mode description is given below:
Length 1 bit.
The ARM9EJ-S core device identification (ID) code register purpose, bit length, and
operating mode description is given below:
B-10 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
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
0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
The values of the bits in the ID code register are shown in Table B-2. When the
ARM9EJ-S is integrated into a larger design the larger system determines the ID code.
Note
IEEE Standard 1149.1 requires that bit 0 of the ID register be set to 1.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-11
Debug in Depth
The Instruction register purpose, bit length, and operating mode description is given
below:
Length 4 bits.
Operating mode In the SHIFT-IR state, the instruction register is selected as the
serial path between DBGTDI and DBGTDO.
During the CAPTURE-IR state, the binary value b0001 is loaded
into this register. This value is shifted out during SHIFT-IR (least
significant bit first), while a new instruction is shifted in (least
significant bit first).
During the UPDATE-IR state, the value in the instruction register
specifies the current instruction.
On reset, IDCODE specifies the current instruction.
The Scan path select register purpose, bit length, and operating mode description is
given below:
Length 5 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 DBGTDI
and DBGTDO.
During the CAPTURE-DR state, the value b10000 is loaded into
this register. This value is shifted out during SHIFT-DR (least
significant bit first), while a new value is shifted in (least
significant bit first). During the UPDATE-DR state, the value in
the scan path select register selects a scan chain to become the
currently active scan chain. All additional 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 3 is selected as the active scan chain.
The number of the currently-selected scan chain is reflected on the
DBGSCREG[4:0] output bus. You can use the TAP controller to
drive external chains in addition to those within the ARM9EJ-S
B-12 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Scan chain
Function
number
0 Reserved
1 Debug
2 EmbeddedICE-RT programming
4–15 Reserved
16–31 Unassigned
The scan chain present between DBGSDIN and DBGSDOUT is connected between
DBGTDI and DBGTDO whenever scan chain 3 is selected, or when any unassigned
scan chain number 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
DBGSDOUT. The multiplexor can be controlled by decoding DBGSCREG[4:0].
The scan chains enable serial access to the core logic and to the EmbeddedICE
hardware for programming purposes. Each scan chain cell is simple, and comprises a
serial register and a multiplexor. A typical cell is shown in Figure B-4 on page B-14.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-13
Debug in Depth
0 1
CLK
Test mode
select
Shift
enable
Serial data in
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 parallel
register (loads from the shift register after UPDATE-DR state) under multiplexor
control.
For output cells, capture involves placing the value of a core output 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 the control signals for the scan cells are generated internally by the TAP controller.
The action of the TAP controller is determined by current instruction and the state of
the TAP state machine.
B-14 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Scan chain 1
The scan chain 1 purpose, bit length, and description is given below:
Purpose Scan chain 1 is used for communication between the debugger and
the ARM9EJ-S core. It is used to read and write data, and to scan
instructions into the instruction pipeline. The SCAN_N
instruction is used to select scan chain 1.
Length 67 bits.
Scan chain 1 provides serial access to RDATA[31:0] when the core is doing a read, and
to the WDATA[31:0] bus when the core is doing a write. It also provides serial access
to the INSTR[31:0] bus, and to the control bits, SYSPEED and WPTANDBKPT. For
compatibility with the ARM9TDMI, there is one additional unused bit that must be zero
when writing, and is UNPREDICTABLE when reading.
There are 67 bits in this scan chain, the order being (from serial data in to out):
1. INSTR[31:0].
2. SYSPEED.
3. WPTANDBKPT.
4. Unused bit.
5. RDATA[31:0] or WDATA[31:0].
66 RDATA[0] Bidir
/WDATA[0]
35 RDATA[31] Bidir
/WDATA[31]
34 Unused -
33 WPTANDBKPT Input
32 SYSSPEED Input
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-15
Debug in Depth
31 INSTR[31] Input
0 INSTR[0] Input
The scan chain order is the same as for the ARM9TDMI. The unused bit is to retain
compatibility with ARM9TDMI.
• For a read the data value taken from the 32 bits in the scan chain allocated for data
is used to deliver the RDATA[31:0] value to the core.
Scan chain 2
The scan chain 2 purpose, bit length, scan chain order and operation description is given
below:
Length 38 bits.
Scan chain order From DBGTDI to DBGTDO. Read/write, register address bits 4
to 0, data values bits 31 to 0.
B-16 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
During SHIFT-DR, a data value is shifted into the serial register. Bits 32 to 36 specify
the address of the EmbeddedICE register to be accessed.
During UPDATE-DR, this register is either read or written depending on the value of
bit 37 (0 = read, 1 = write).
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-17
Debug in Depth
During normal operation, CLKEN conditions CLK to clock the core. When the
ARM9EJ-S core is in debug state, DBGTCKEN conditions CLK to clock the core.
B-18 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Before examining the core and system state, the debugger must determine if the
processor entered debug from Thumb state, ARM state, or Jazelle state by examining
bits 4 and 5 of the EmbeddedICE-RT debug status register. When bit 4 is HIGH, the
core has entered debug from Thumb state. When bit 5 is HIGH, the core has entered
debug from Jazelle state.When bit 4 and 5 is LOW the core has entered debug from
ARM state.
When the processor has entered debug state from Thumb state, the simplest method 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, execute the following sequence of Thumb
instructions on the core (with the SYSSPEED bit set LOW):
STR R0, [R1]; Save R0 before use
MOV R0, PC ; Copy PC into R0
STR R0, [R1]; 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 method, 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.
When the processor has entered debug state from Jazelle state, the debugger must force
the core into ARM state before doing anything else. The debugger can then execute the
same sequence of instructions to determine the processor state.
To force the processor into ARM state from Jazelle state execute the following
sequence of ARM instructions on the core (with SYSSPEED bit set LOW).
STMIA r0,{r0,pc} ; save r0 before use and take note of PC at debug entry
LDMIA r0,{r0} ; load r0 with a word aligned address (to jump to ARM state)
BX r0 ; jump to ARM state
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-19
Debug in Depth
Note
When the processor has entered debug state from Jazelle state the scan chain is used to
scan instructions into the ARM decoder not the Jazelle decoder.
You can use the sequences of ARM instructions shown in Example B-1 to determine
the processor state.
With the processor in the ARM state, typically the first instruction to execute is:
STMIA R0, {R0-R15}
This instruction 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 bank of registers available in the current
mode, you might want to access the other banked registers. To do this, you must change
mode. Normally, a mode change can occur only if the core is already in a privileged
mode. However, while in debug state, a mode change can occur from any mode into any
other mode.
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 is entered in Supervisor mode, the instruction sequence
can be as shown in Example B-1.
B-20 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
All these instructions execute at debug speed. Debug speed is much slower than system
speed. This is because between each core clock, 67 clocks occur to shift in an
instruction, or shift out data. Executing instructions this slowly is acceptable for
accessing the core state because the ARM9EJ-S core is fully static. However, you
cannot use this method for determining the state of the rest of the system.
While in debug state, you can only scan the following ARM or Thumb instructions into
the instruction pipeline for execution:
• all data processing operations
• all load, store, load multiple, and store multiple instructions
• MSR and MRS
• B, BL, and BX.
To meet the dynamic timing requirements of the memory system, any attempt to access
system state must occur synchronously. Therefore, the ARM9EJ-S core must be forced
to synchronize back to system speed. Bit 32 of scan chain 1, SYSSPEED, controls this.
You can place a legal debug instruction onto the instruction data bus of scan chain 1
with bit 32 (the SYSSPEED bit) LOW. This instruction is then normally executed at
debug speed. To execute an instruction at system speed, a NOP (such as MOV R0, R0)
must be scanned in as the next instruction with bit 32 set HIGH.
After the system speed instructions are scanned into the instruction data bus and clocked
into the pipeline, the RESTART instruction must be loaded into the TAP controller.
This causes the ARM9EJ-S core automatically to re-synchronize back to CLK
conditioned with CLKEN when the TAP controller enters RUN-TEST/IDLE state, and
executes the instruction at system speed. Debug state is reentered when the instruction
completes execution, when the processor switches itself back to CLK conditioned with
DBGTCKEN. When the instruction completes, DBGACK is HIGH. At this point
INTEST can be selected in the TAP controller, and debugging can resume.
To determine if a system speed instruction has completed, the debugger must look at
SYSCOMP (bit 3 of the debug status register). The ARM9EJ-S core must access
memory through the data data bus interface, as this access can be stalled indefinitely by
CLKEN. Therefore, the only way to determine if the memory access has completed is
to examine the SYSCOMP bit. When this bit is HIGH, the instruction has completed.
The state of the system memory can be fed back to the debug host by using system speed
load multiples and debug speed store multiples.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-21
Debug in Depth
There are restrictions on which instructions can have the SYSSPEED bit set. The valid
instructions on which to set this bit are:
• loads
• stores
• load multiple
• store multiple.
When the ARM9EJ-S core returns to debug state after a system speed access, the
SYSSPEED bit is set LOW. The state of this bit gives the debugger information about
why the core entered debug state the first time this scan chain is read.
After restoring the internal state, a branch instruction must be loaded into the pipeline.
See Behavior of the program counter during debug on page B-25 for details on
calculating the branch.
The SYSSPEED bit of scan chain 1 forces the ARM9EJ-S core to resynchronize back
to CLK conditioned with CLKEN. The penultimate instruction in the debug sequence
is a branch to the instruction at which execution is to resume. This is scanned in with
bit 32 (SYSSPEED) set LOW. The final instruction to be scanned in is a NOP (such as
MOV R0, R0), with bit 32 set HIGH. The core is then clocked to load this instruction into
the pipeline.
The following ARM instructions are used to exit from debug state to Jazelle state:
BXJ r0 ; jump to Jazelle state
LDMIA r0,{pc} ; reload pc
MOV pc,pc ; system speed access to return to functional Jazelle
state
Next, 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 CLK conditioned with CLKEN occurs within
the ARM9EJ-S core. Normal operation then resumes, with instructions being fetched
from memory.
B-22 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
The delay, waiting until the state machine is in RUN-TEST/IDLE state, enables
conditions to be set up in other devices in a multiprocessor system without taking
immediate effect. Then, when RUN-TEST/IDLE state is entered, all the processors
resume operation simultaneously.
The function of DBGACK is to tell the rest of the system when the ARM9EJ-S core is
in debug state. You can use this signal to inhibit peripherals such as watchdog timers
that have real-time characteristics. Also, you can use DBGACK to mask out memory
accesses that are caused by the debugging process. For example, when the ARM9EJ-S
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. So, on exit from debug state, the pipeline must
be refilled to its previous state. Therefore, because of the debugging process, more
memory accesses occur than are normally expected. It is possible, using the DBGACK
signal and a small amount of external logic, for a peripheral that is sensitive to the
number of memory accesses to return the same result with and without debugging.
Note
You can only use DBGACK in such a way using breakpoints. It does not mask the
correct number of memory accesses after a watchpoint.
For example, consider a peripheral that counts the number of instruction Fetches. This
device must return the same answer after a program has run both with and without
debugging.
Figure B-5 shows the behavior of the ARM9EJ-S core on exit from debug state.
CLK
INSTR[31:0]
DBGACK
In Figure B-6 on page B-31, two instructions are fetched after the instruction that
breakpoints. Figure B-5 shows that DBGACK masks the first three instruction Fetches
out of the debug state, corresponding to the breakpoint instruction, and the two
instructions prefetched after it.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-23
Debug in Depth
Under some circumstances DBGACK can remain HIGH for more than three
instruction Fetches. Therefore, if you require precise instruction access counting, you
must provide some external logic to generate a modified DBGACK that always falls
after three instruction Fetches.
Note
When system speed accesses occur, DBGACK remains HIGH throughout. It then falls
after the system speed memory accesses are completed, and finally rises again as the
processor reenters debug state. Therefore, DBGACK masks all system speed memory
accesses.
B-24 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
For example, if the ARM9EJ-S core entered debug state from a breakpoint set on a
given address and two debug speed instructions were executed, a branch of seven
addresses must occur (four for debug entry, plus two for the instructions, plus one for
the final branch). The following sequence shows ARM instructions scanned into scan
chain 1. This is the Most Significant Bit (MSB) first, so the first digit represents the
value to be scanned into the SYSSPEED bit, followed by the instruction:
0 EAFFFFF9 ; B -7 addresses (two’s complement)
1 E1A00000 ; NOP (MOV R0, R0), SYSSPEED bit is set
After the ARM9EJ-S core enters debug state, it must executea 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).
To return to program execution after entry to debug state from a watchpoint, use the
same procedure described in ARM and Thumb state breakpoints.
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.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-25
Debug in Depth
On entry to debug from Jazelle the PC contains the address of the instruction not
executed because of debug entry plus four bytes (except for software breakpoints where
pc equals address of breakpoint instruction plus four bytes). The PC is then frozen until
the core state is forced to ARM state. This behavior means that whatever the cause of
debug entry from Jazelle state the return address is always the PC value at entry minus
four bytes.
If a watchpointed access also has a Data Abort returned, the ARM9EJ-S core enters
debug state in Abort mode. Entry into debug is held off until the core changes into Abort
mode, and has fetched the instruction from the abort vector.
A similar sequence follows when an interrupt, or any other exception, occurs during a
watchpointed memory access. The ARM9EJ-S 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 be given the choice of servicing the
exception before debugging.
For example, suppose that an abort has occurred on a watchpointed access and ten
instructions have been executed in debug state. You can use the following sequence to
return to program execution:
0 EAFFFFF1; B -15 addresses (two’s complement)
1 E1A00000; NOP (MOV R0, R0), SYSSPEED bit is set
This code forces a branch back to the abort vector, causing the instruction at that
location to be re-fetched and executed.
Note
After the abort service routine, the instruction that caused the abort and watchpoint is
re-fetched and executed. This triggers the watchpoint again, and the ARM9EJ-S core
reenters debug state.
B-26 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Entry into debug state through a debug request is similar to a breakpoint. Entry to debug
from ARM or Thumb state adds four addresses to the PC, and every instruction
executed in debug state adds one address, and from Jazelle state adds four bytes.
For example, the following sequence handles a situation in which you have invoked a
debug request when in ARM or Thumb state, and then decide to return to program
execution immediately:
0 EAFFFFFB; B -5 addresses (2’s complement)
1 E1A00000; NOP (MOV R0, R0), SYSSPEED bit is set
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 five 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 ARM9EJ-S core enters Abort mode before returning to debug state.
This scenario is similar to an aborted watchpoint, but the problem is much harder to fix
because the abort is not caused by an instruction in the main program, and so the link
register does not point to the instruction that caused the abort. An abort handler usually
looks at the link register to determine the instruction that caused the abort, and the abort
address. In this case, the value of the link register is invalid, but because the debugger
can determine which location was being accessed, you can write the debugger to help
the abort handler fix the memory system.
The calculation of the branch return address when entered from ARM or Thumb state
can be summarized as:
PC-(4+N+5S)
where N is the number of debug speed instructionsexecuted (including the final branch),
and S is the number of system speed instructions executed.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-27
Debug in Depth
When a breakpointed instruction Fetch causes a Prefetch Abort, the abort is taken and
the breakpoint is disregarded. Normally, 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 might be
data-dependent), the ARM9EJ-S core enters debug state.
The Prefetch Abort, therefore, takes higher priority than the breakpoint.
B.9.2 Interrupts
When the ARM9EJ-S core enters debug state, interrupts are automatically disabled.
If an interrupt is pending during the instruction prior to entering debug state, the
ARM9EJ-S core enters debug state in the mode of the interrupt. On entry to debug state,
the debugger cannot assume that the ARM9EJ-S core is in the mode expected by your
program. The ARM9EJ-S core must check the PC, the CPSR, and the SPSR to
determine accurately the reason for the exception.
Debug, therefore, takes higher priority than the interrupt, but the ARM9EJ-S core does
recognize that an interrupt has occurred.
When a Data Abort occurs on a watchpointed access, the ARM9EJ-S core enters debug
state in Abort mode. The watchpoint, therefore, has higher priority than the abort, but
the ARM9EJ-S core remembers that the abort happened.
B-28 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Because the ARM9EJ-S core has a Harvard Architecture, you must specify if the
watchpoint unit examines the instruction or the data interface. This is specified by bit 3
of the control value register:
• when bit 3 is set, the data interface is examined
• when bit 3 is clear, the instruction interface is examined.
There cannot be a don’t care case for bit 3 because the comparators cannot compare the
values on both buses simultaneously. Therefore, bit 3 of the control mask register is
always clear and cannot be programmed HIGH. Bit 3 also determines if the internal
IBREAKPT or DWPT signal must be driven by the result of the comparison.
Figure B-6 on page B-31 gives an overview of the operation of the EmbeddedICE-RT
logic.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-29
Debug in Depth
a. An attempted write to the communications channel control register can be used to reset bit 0
of that register.
B-30 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Scan chain
register
R/W Update
4
5 Address
Address decoder
0 Enable
31
Control
Control
Control
I Control
Breakpoint/
D Control watchpoint
32
Data
Data
Data
Data Rangeout
INSTR[31:0]
DD[31:0]
Address
Address
Address
IA[31:1]
0 DA[31:0]
TDI TDO
For each value register there is an associated mask register in the same format. Setting
a bit to 1 in the mask register causes the corresponding bit in the value register to be
ignored in any comparison.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-31
Debug in Depth
If bit 3 of the control register is programmed to a 1, the comparators examine the data
address, data, and control signals.
In this case, the format of the control register is as shown in Figure B-7.
Note
You cannot mask bit 8 and bit 3.
8 7 6 5 4 3 2 1 0
Bit
Name Function
number
[0] DnRW Compares against the data not read/write signal from the core to
detect the direction of the data data bus activity. DnRW is 0 for a
read, and 1 for a write.
[2:1] DMAS[1:0] Compares against the DMAS[1:0] signal from the core to detect
the size of the data data bus activity.
[4] DnTRANS Compares against the data not translate signal from the core to
determine between a User mode (DnTRANS = 0) data transfer,
and a privileged mode (DnTRANS = 1) transfer.
[5] DBGEXT Is an external input into the EmbeddedICE-RT logic that enables
the watchpoint to depend on some external condition. The
DBGEXT input for watchpoint 0 is labeled DBGEXT[0], and
the DBGEXT input for watchpoint 1 is labeled DBGEXT[1].
B-32 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Table B-6 Watchpoint control register for data comparison functions (continued)
Bit
Name Function
number
[6] CHAIN Selects the chain output of another watchpoint unit to implement
some debugger requests. For example, breakpoint on address
YYY only when in process XXX.
In the ARM9EJ-S core EmbeddedICE-RT logic, the
CHAINOUT output of watchpoint 1 is connected to the CHAIN
input of watchpoint 0. The CHAINOUT output is derived from
a latch. The address or control field comparator drives the write
enable for the latch and the input to the latch is the value of the
data field comparator. The CHAINOUT latch is cleared when
the control value register is written or when DBGnTRST is
LOW.
[8] ENABLE If a watchpoint match occurs, the internal DWPT signal is only
asserted when the ENABLE bit is set. This bit only exists in the
value register. It cannot be masked.
8 7 6 5 4 3 2 1 0
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-33
Debug in Depth
Bit
Name Function
number
[1] ITBIT Compares against the Thumb state signal from the core to
determine between a Thumb or Jazelle (ITBIT = 1) instruction
Fetch or an ARM (ITBIT = 0) instruction Fetch.
[2] IJBIT Compares against the Jazelle state signal from the core to
determine between a Jazelle (IJBIT = 1) instruction Fetch or an
ARM or Thumb (IJBIT = 0) instruction Fetch.
[4] InTRANS Compares against the not translate signal from the core to
determine between a user mode (InTRANS = 0) instruction Fetch,
and a privileged mode (InTRANS = 1) Fetch.
[5] DBGEXT Is an external input into the EmbeddedICE-RT logic that enables
the watchpoint to depend on some external condition. The
DBGEXT input for watchpoint 0 is labelled DBGEXT[0], and the
DBGEXT input for watchpoint 1 is labeled DBGEXT[1].
[6] CHAIN Selects the chain output of another watchpoint unit to implement
some debugger requests. For example, breakpoint on address YYY
only when in process XXX.
In the ARM9EJ-S core EmbeddedICE-RT logic, the CHAINOUT
output of watchpoint 1 is connected to the CHAIN input of
watchpoint 0. The CHAINOUT output is derived from a latch.
The address or control field comparator drives the write enable for
the latch, and the input to the latch is the value of the data field
comparator. The CHAINOUT latch is cleared when the control
value register is written, or when nTRST is LOW.
B-34 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
The debug control register is 6 bits wide. Writing control bits occurs during a register
write access (with the read/write bit HIGH). Reading control bits occurs during a
register read access (with the read/write bit LOW).
5 4 3 2 1 0
These functions are described in Table B-8 and Table B-9 on page B-36.
Bit
Name Function
number
[5] Embedded- Controls the address and data comparison logic contained within
ICE disable the Embedded-ICE logic. When set to 1, the address and data
comparators are disabled. When set to 0, the address and data
comparators are enabled. You can use this bit to save power in a
system where the Embedded-ICE functionality is not required.
The reset state of this bit is 0 (comparators enabled). An extra
piece of logic initialized by debug reset ensures that the
Embedded-ICE logic is automatically disabled out of reset. This
extra logic is set by debug reset and is automatically reset on the
first access to scan chain 2.
[4] Monitor Controls the selection between monitor mode debug (monitor
mode mode enable = 1) and Halt mode debug. In monitor mode,
enable breakpoints and watchpoints cause Prefetch Aborts and Data
Aborts to be taken (respectively). At reset, the monitor mode
enable bit is set to 1.
[2] INTDIS If bit 2 (INTDIS) is asserted, the interrupt signals to the processor
are inhibited. Table C-8 shows interrupt signal control.
[1:0] DBGRQ, These bits enable the values on DBGRQ and DBGACK to be
DBGACK forced.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-35
Debug in Depth
0 0 Permitted
1 x Inhibited
x 1 Inhibited
Both IRQ and FIQ are disabled when the processor is in debug state (DBGACK =1),
or when INTDIS is forced.
As shown in Figure B-11 on page B-39, the value stored in bit 1 of the control register
is synchronized and then ORed with the external EDBGRQ before being applied to the
processor.
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
ARM9EJ-S 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).
The structure of the debug control and status registers is shown in Figure B-11 on
page B-39.
The debug status register is ten bits wide. If it is accessed for a read (with the read/write
bit LOW), the status bits are read. The format of the debug status register is shown in
Figure B-10.
9 6 5 4 3 2 1 0
MOE IJBIT 6
ITBIT SYSCOMP IFEN DBGRQ DBGACK
B-36 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Bit
Name Function
number
[1:0] DBGRQ, Enable the values on the synchronized versions of EDBGRQ and
DBGACK DBGACK to be read.
[2] IFEN Enables the state of the core interrupt enable signal to be read.
[3] SYSCOMP enables the state of the SYSCOMP bit from the core to be read.
This enables the debugger to determine that a memory access
from the debug state has completed.
[4] ITBIT enables the status of the output ITBIT to be read. This enables
the debugger to determine what state the processor is in, and
therefore which instructions to execute.
[5] IJBIT enables the status of the output IJBIT to be read. This enables the
debugger to determine what state the processor is in, and
therefore which instructions to execute.
The structure of the debug control and status registers is shown in Figure B-11 on
page B-39
MOE[3:0] Meaning
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-37
Debug in Depth
MOE[3:0] Meaning
B-38 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
IJBIT Bit 5
(from core) IJBIT
ITBIT Bit 4
(from core) ITBIT
SYSCOMP Bit 3
(from core) SYSCOMP
DBGACK
Interrupt mask enable
(from core) + (to core)
Bit 2
INTDIS
Bit 2
+ IFEN
Bit 1
DBGRQ
DBGRQ
EDBGRQ + (to core)
(from ARM9E-S input)
Bit 1
DBGRQ
DBGACK Bit 0
(from core) DBGACK
DBGACK
Bit 0 + (to ARM9E-S output)
DBGACK
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-39
Debug in Depth
7 6 5 4 3 2 1 0
B-40 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
For example, if the processor executes a SWI instruction while bit 2 of the vector catch
register is set, the ARM9EJ-S core fetches an instruction from location 0x8. The vector
catch hardware detects this access and forces the internal IBREAKPT signal HIGH
into the ARM9EJ-S core control logic. This, in turn, forces the ARM9EJ-S core to enter
debug state.
In monitor mode debug, vector catching is disabled on Data Aborts and Prefetch Aborts
to avoid the processor being forced into an unrecoverable state as a result of the aborts
that are generated for the monitor mode debug.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-41
Debug in Depth
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 IA bus from the ARM9EJ-S core if control register bit 3 is clear,
or the DA bus from the ARM9EJ-S core if control register bit 3 is set
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 INSTR bus from the ARM9EJ-S core if control register bit 3 is
clear, or the RDATA bus from the ARM9EJ-S core if control register bit
3 is set and the processor is doing a read, or the WDATA bus from the
ARM9EJ-S core if control register bit 3 is set and the processor is doing
a write
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 ARM9EJ-S core, other watchpoint
registers, and the DBGEXT signal.
CHAINOUT signal
Note
There is no CHAIN input to Watchpoint 1 and no CHAIN output from Watchpoint 0.
B-42 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
Take, for example, the request by a debugger to breakpoint on the instruction at location
YYY when running process XXX in a multiprocessor 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.
This RANGE input enables you to couple two breakpoints together to form range
breakpoints.
For Watchpoint 1:
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-43
Debug in Depth
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.
B-44 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Debug in Depth
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. B-45
Debug in Depth
See Chapter 9 AC Parameters for details of the required setup and hold times for these
signals.
B-46 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Glossary
This glossary describes some of the terms used in this manual. Where terms can have
several meanings, the meaning presented here is intended.
Abort A mechanism that indicates to a core that it must halt execution of an attempted illegal
memory access. An abort can be caused by the external or internal memory system as a
result of attempting to access invalid instruction or data memory. An abort is classified
as either a prefetch abort, a data abort, or an external abort. See also Data Abort,
External Abort and Prefetch Abort.
Abort model An abort model is the defined behavior of an ARM processor in response to a Data
Abort exception. Different abort models behave differently with regard to load and
store instructions that specify base register writeback.
ALU See Arithmetic Logic Unit.
Application Specific Integrated Circuit(ASIC)
An integrated circuit that has been designed to perform a specific application function.
It can be custom-built or mass-produced.
Arithmetic Logic Unit (ALU)
The part of a processor core that performs arithmetic and logic operations.
ARM state A processor that is executing ARM (32-bit) word-aligned instructions is operating in
ARM state.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. Glossary-1
Glossary
Glossary-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Glossary
EmbeddedICE The additional JTAG-based hardware provided by debuggable ARM processors to aid
debugging.
Endianness Byte ordering. The scheme that determines the order in which successive bytes of a data
word are stored in memory. See also Little-endian and Big-endian.
Exception vector One of a number of fixed addresses in low memory, or in high memory if high vectors
are configured, that contains the first instruction of the corresponding interrupt service
routine.
External Abort An abort that is generated by the external memory system. See also Data Abort, Abort
and Prefetch Abort.
Halfword A 16-bit data item.
Jazelle state The state of the core when executing Java byte codes.
Joint Test Action Group (JTAG)
The name of the organization that developed standard IEEE 1149.1. This standard
defines a boundary-scan architecture used for in-circuit testing of integrated circuit
devices. It is commonly known by the initials JTAG.
JTAG See Joint Test Action Group.
Little-endian Byte ordering scheme in which bytes of increasing significance in a data word are
stored at increasing addresses in memory. See also Big-endian and Endianness.
Macrocell A complex logic block with a defined interface and behavior. A typical VLSI system
comprises several macrocells (such as an ARM9E-S, an ETM9, and a memory block)
plus application-specific logic.
Prefetch Abort An indication from a memory system to a core that it must halt execution of an
attempted illegal memory access. A prefetch abort can be caused by the external or
internal memory system as a result of attempting to access invalid instruction memory.
See also Data abort, External abort and Abort
Processor A contraction of microprocessor. A processor includes the CPU or core, plus additional
components such as memory, and interfaces. These are combined as a single macrocell,
that can be fabricated on an integrated circuit.
Region A partition of instruction or data memory space.
Register A temporary storage location used to hold binary data until it is ready to be used.
SBO See Should be one.
SBZ See Should be zero.
SCREG The currently selected scan chain number in an ARM TAP controller.
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. Glossary-3
Glossary
Glossary-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Index
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. Index-1
Index
CLKEN A-2 D E
Clock domains 6-15
Clock skew 9-9 Data EmbeddedICE-RT B-29
Code density 1-6 Abort 2-24, B-28 debug status register 6-16
Comms channel, using 6-20 dependencies 1-5 disabling 6-8, B-45
Compression, instruction 1-6 operations 8-13 hardware B-29
Condition code flags 2-16 types 2-7 logic 6-4, 6-6
Condition fields 1-20 Data interface 3-15 logic registers B-30
Configuration input timing 9-5 cycle types 3-25 operation 6-6
Control bits 2-17 internal cycles 3-31 overview 6-6
Coprocessor nonsequential cycles 3-26 programming B-2
CDP 5-12 sequential cycles 3-28 register map B-29
clocking 5-5 signals 3-15 registers, accessing B-3
connecting 5-17 Data memory interface signals A-5 reset 7-4
handshake encoding 5-7 DBGnTRST 7-2 timing B-46
handshake signals 5-6 Debug Endian effects 3-7, 3-34
interface 5-2 actions in debug state 6-14 Endianness 2-4
interface signals A-8 comms channel control register ETM interface signals A-12
interlocked MCR 5-10 6-17 Exception 2-20
interlocked MCRR 5-11 comms channel registers 6-17 entry and exit 2-20
late-canceled CDP 5-12 comms channel reset 6-21 entry, ARM and Jazelle states 2-21
LDC/STC 5-4 comms data read register 6-17 entry, Thumb state 2-21
LDC/STC cycle timing 5-4 comms data write register 6-17 FIQ 2-22
MCR 5-16 control and status register structure IRQ 2-23
MCR or MRC transfer timing 5-8 B-39 priority 2-27
MCRR or MRRC transfer timing control register 6-6, B-35 vectors 2-26
5-9 entry from ARM state B-20 Execute 1-2
none connected 5-21 entry from Thumb state B-19 External coprocessor
pipeline 5-2 extensions 6-2 VFP9 5-18
register transfer cycle 3-31 hardware extensions 6-4
register transfer instructions 6-17 interface 6-2
undefined instructions 5-21 interface signals 6-5 F
Coprocessor instructions Jazelle state 6-24
busy-wait 5-6 monitor mode 6-2, 6-22 F bit, FIQ disable 2-17
during busy-wait 5-15 Multi-ICE 6-15 Fetch 1-2
during interrupts 5-15 request 6-13, B-25, B-27 Fields 1-20
privileged instructions 5-14 sending to the debugger 6-20 FIQ disable, F bit 2-17
privileged modes 5-14 signals A-9 FIQ exception 2-22
Coprocessor pipeline 5-2 state 6-5 FIQ mode 2-8
core B-19 state, processor restart on exit B-9 Flags 2-16
Core diagram, ARM9EJ-S 1-8 status register 6-6, 6-19, B-36 Forwarding 1-5
Core reset 7-4 support 6-6 Functional diagram, ARM9EJ-S 1-8
CORECLKENOUT A-2 debug 6-5
Coupling breakpoints and watchpoints Decode 1-2
B-42 Determining state 6-16 H
CPSR 2-9, 2-12, 2-15 Device identification code B-8, B-10
mode B-26 Device reset 7-2 Halfword access 3-22
Current program status register 2-9, Disabling EmbeddedICE-RT 6-8 High registers 2-14
2-12, 2-15
Index-2 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B
Index
I J System 2-8
Undefined 2-8
I bit, IRQ disable 2-17 J bit 2-16 User 2-8
ID register B-5, B-8, B-10 Java bytecode 1-6 Monitor mode debug 6-22
IDCODE instruction B-5, B-11 Jazelle state 1-6 Multi-ICE 6-15
Identification register See ID register breakpoints 6-24
InMREQ A-3 byte-aligned instructions 2-3
Instruction monitor mode 6-24 N
compression 1-6 watchpoints 6-24
coprocessor register transfer 6-17 Jazelle state to ARM state 2-3 N flag 2-16
cycle counts 8-3 JTAG instructions Nonsequential cycle 3-9
fetch, nonsequential 3-9 IDCODE B-5, B-11 nRESET 7-2
fetch, sequential 3-10 INTEST B-12
interface 3-3 RESTART B-9
interface cycle types 3-8 SCAN_N B-12, B-16 O
interface signals 3-3 SCAN_N TAP B-15
length 2-6 TAP B-12 Operating state
memory interface signals A-3 JTAG interface 6-4, 6-5 ARM 2-3
pipeline 1-2 Java 2-3
pipeline operation 1-4 T bit 2-17
register B-9, B-10 L Thumb 2-3
SCAN_N B-8, B-12
set, ARM 1-6, 1-13 Link register 2-9, 2-12
set, summary 1-12 Little-endian 2-4 P
set, Thumb 1-6 Low registers 2-14
system speed B-27 LR 2-12 Pipeline 5-2
Interface, boundary-scan B-5 Pipeline follower 5-2
Interface, debug 6-2 Prefetch Abort 2-24, B-28
Interlocking 1-5 M Priorities and exceptions B-28
Internal cycle 3-9, 3-11 Priority of exceptions 2-27
Interrupt 4-2 Mask registers B-31 Privileged modes 2-8
disable flags 2-22 Maximum interrupt latency 4-6 Processor state, determining B-20
re-enabling after an interrupt MCR 5-16 Product revision status xvii
exception 4-3 Memory 1-2 Program counter 2-9, 2-12
registers 4-5 access 1-5 Program status registers 2-15
stopping CLK 4-5 cycle 3-8 PSR
synchronization 4-3 formats 2-4 control bits 2-17
using CLK and CLKEN 4-5 interface 3-2 mode bit values 2-18
Interrupt hardware 4-3 Minimum interrupt latency 4-7 reserved bits 2-19
Interworking 2-3 Miscellaneous signals A-7
INTEST Mode
instruction B-12 abort 2-8, B-26 Q
mode B-16 bits 2-18
IRQ FIQ 2-8 Q flag 2-16
disable, I bit 2-17 identifier 2-10
exception 2-23 IRQ 2-8
mode 2-8 privileged 2-8 R
PSR bit values 2-18
supervisor 2-8 Register
ARM DDI 0222B Copyright © 2001, 2002. ARM Limited. All rights reserved. Index-3
Index
Index-4 Copyright © 2001, 2002. ARM Limited. All rights reserved. ARM DDI 0222B