Professional Documents
Culture Documents
Arm Overview
Arm Overview
T
TM
1L
Agenda
TM
ARM Ltd
TM
TM
TM
Intellectual Property
to protect ARM IP
TM
Agenda
Programmers Model
Instruction Sets
System Design
Development Tools
TDMI
TM
TM
Processor Modes
TM
r0
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r11
r12
r13 (sp)
r14 (lr)
r15 (pc)
cpsr
spsr
FIQ
IRQ
SVC
Undef
Abort
r8
r9
r10
r11
r12
r13 (sp)
r14 (lr)
r8
r9
r10
r11
r12
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
spsr
spsr
spsr
spsr
spsr
TM
10
10
FIQ
User
mode
r0-r7,
r15,
and
cpsr
IRQ
User
mode
r0-r12,
r15,
and
cpsr
SVC
Undef
User
mode
r0-r12,
r15,
and
cpsr
User
mode
r0-r12,
r15,
and
cpsr
Abort
User
mode
r0-r12,
r15,
and
cpsr
r8
r9
r10
r11
r12
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
r13 (sp)
r14 (lr)
spsr
spsr
spsr
spsr
spsr
Thumb state
Low registers
Thumb state
High registers
cpsr
TM
11
11
The Registers
TM
12
12
28 27
N Z C V Q
24
23
16 15
J bit
I F T
mode
c
Architecture xT only
T = 0: Processor in ARM state
T = 1: Processor in Thumb state
Mode bits
T Bit
TM
13
13
TM
14
14
Exception Handling
0x08
Software Interrupt
0x04
Undefined Instruction
0x00
Reset
0x18
0x0C
FIQ
IRQ
(Reserved)
Data Abort
Prefetch Abort
0x1C
0x14
0x10
Vector Table
Vector table can be at
0xFFFF0000 on ARM720T
and on ARM9/10 family devices
TM
15
15
Development of the
ARM Architecture
1
2
3
Early ARM
architectures
Halfword
and signed
halfword /
byte support
System
mode
ARM7TDMI
ARM720T
5TE
CLZ
SA-110
SA-1110
Thumb
instruction
set
Improved
ARM/Thumb
Interworking
4T
ARM9TDMI
ARM940T
Saturated maths
DSP multiplyaccumulate
instructions
ARM1020E
Jazelle
5TEJ
Java bytecode
execution
ARM9EJ-S
ARM926EJ-S
ARM7EJ-S
ARM1026EJ-S
SIMD Instructions
Multi-processing
XScale
ARM9E-S
ARM966E-S
TM
V6 Memory
architecture (VMSA)
Unaligned data
support
ARM1136EJ-S
16
16
Agenda
Instruction Sets
System Design
Development Tools
TM
17
17
r3,#0
skip
r0,r1,r2
CMP
r3,#0
ADDNE r0,r1,r2
SUBS r1,r1,#1
BNE loop
TM
18
18
Condition Codes
EQ
NE
CS/HS
CC/LO
MI
PL
VS
VC
HI
LS
GE
LT
GT
LE
AL
39v10 The ARM Architecture
Description
Equal
Not equal
Unsigned higher or same
Unsigned lower
Minus
Positive or Zero
Overflow
No overflow
Unsigned higher
Unsigned lower or same
Greater or equal
Less than
Greater than
Less than or equal
Always
TM
Flags tested
Z=1
Z=0
C=1
C=0
N=1
N=0
V=1
V=0
C=1 & Z=0
C=0 or Z=1
N=V
N!=V
Z=0 & N=V
Z=1 or N=!V
19
19
Examples of conditional
execution
TM
20
20
Branch instructions
Branch :
B{<cond>} label
BL{<cond>} subroutine_label
31
28 27
Cond
25 24 23
1 0 1 L
Offset
Link bit
0 = Branch
1 = Branch with link
Condition field
The processor core shifts the offset field left by 2 positions, sign-extends
it and adds it to the PC
32 Mbyte range
How to perform longer branches?
TM
21
21
Consist of :
Arithmetic:
Logical:
Comparisons:
Data movement:
ADD
AND
CMP
MOV
ADC
ORR
CMN
MVN
SUB
EOR
TST
SBC
BIC
TEQ
RSB
Syntax:
RSC
TM
22
22
Destination
Multiplication by a power of 2
Division by a power of 2,
preserving the sign bit
Destination
CF
CF
Division by a power of 2
CF
CF
TM
23
23
Operand
2
Barrel
Shifter
Immediate value
ALU
Result
39v10 The ARM Architecture
TM
24
24
The data processing instruction format has 12 bits available for operand2
11
8 7
rot
x2
0
immed_8
Quick Quiz:
0xe3a004ff
MOV r0, #???
Shifter
ROR
4 bit rotate value (0-15) is multiplied by two to give range 0-30 in steps of 2
TM
25
25
Examples:
31
ror #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
ror #8
ror #30
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0
MOV r0,#4096
; uses 0x40 ror 26
TM
26
26
For example
LDR r0,=0xFF
LDR r0,=0x55555555
=>
=>
MOV r0,#0xFF
LDR r0,[PC,#Imm12]
DCD 0x55555555
TM
27
27
Multiply
Syntax:
Cycle time
Rd = Rm * Rs
Rd = (Rm * Rs) + Rn
RdHi,RdLo := Rm*Rs
RdHi,RdLo := (Rm*Rs)+RdHi,RdLo
Above are general rules - refer to the TRM for the core you are using
for the exact details
TM
28
28
STR
STRB
STRH
Word
Byte
Halfword
Signed byte load
Signed halfword load
Syntax:
e.g. LDREQB
TM
29
29
Address accessed
TM
30
30
Offset
12
Base
Register
0x5
0x20c
0x5
Source
Register
for STR
r1
0x200
0x200
r1
Offset
0x20c
12
0x20c
r0
0x5
r1
0x200
0x5
0x200
TM
Source
Register
for STR
31
31
Syntax:
<LDM|STM>{<cond>}<addressing_mode> Rb{!}, <register list>
4 addressing modes:
LDMIA / STMIA
LDMIB / STMIB
LDMDA / STMDA
LDMDB / STMDB
increment after
increment before
decrement after
decrement before
IA
LDMxx r10, {r0,r1,r4}
STMxx r10, {r0,r1,r4}
Base Register (Rb) r10
IB
DA
DB
r4
r4
r1
r1
r0
r0
Increasing
Address
r4
r1
r4
r0
r1
r0
TM
32
32
28 27
Cond
24 23
1 1 1 1
Condition Field
The SWI handler can examine the SWI number to decide what operation
has been requested.
Syntax:
SWI{<cond>} <SWI number>
TM
33
33
28 27
N Z C V Q
24
23
16 15
I F T
mode
c
Syntax:
MRS{<cond>} Rd,<psr>
; Rd = <psr>
MSR{<cond>} <psr[_fields]>,Rm ; <psr[_fields]> = Rm
where
In User Mode, all bits can be read but only the condition flags (_f) can be
written.
TM
34
34
B <label>
BL <subroutine>
func1
func2
STMFD sp!,
{regs,lr}
BL func1
BL func2
LDMFD sp!,
{regs,pc}
TM
:
:
:
:
MOV pc, lr
35
35
Thumb
Thumb is a 16-bit instruction set
Optimised for code density from C code (~65% of ARM code size)
Improved performance from narrow memory
Subset of the functionality of the ARM instruction set
31
15
ADD r2,#1
TM
36
36
Agenda
Introduction
Programmers Model
Instruction Sets
System Design
Development Tools
TM
37
37
16 bit RAM
32 bit RAM
Interrupt
Controller
nIRQ
8 bit ROM
I/O
Peripherals
nFIQ
ARM
Core
TM
38
38
AMBA
Arbiter
External
RAM
ARM
TIC
External
Bus
Interface
Decoder
Interrupt
Controller
On-chip
RAM
APB
System Bus
Peripheral Bus
ADK
Remap/
Pause
AHB or ASB
AMBA
Timer
Bus Interface
Bridge
External
ROM
Reset
ACT
PrimeCell
TM
39
39
Agenda
Introduction
Programmers Model
Instruction Sets
System Design
Development Tools
TM
40
40
Debug Tools
Platforms
Integrator Family
Multi-ICE
Multi-Trace
TM
41
41
Debugger (+ optional
trace tools)
TAP
controller
ETM
EmbeddedICE
Logic
ARM
core
Trace Port
JTAG port
EmbeddedICE Logic
TM
42
42