Professional Documents
Culture Documents
ARM Architecture
About ARM
Acronym for Advanced RISC Machines Founded in November 1990 Designs the ARM range of RISC processor cores Licenses ARM core design to semiconductor partners
ARM does not fabricate silicon itself
CISC Vs RISC
CISC Emphasis on hardware Includes multi-clock complex instructions Memory-to-memory: "LOAD" and "STORE" incorporated in instructions Small code sizes, high cycles per second Transistors used for storing complex instructions
ARM Architecture
RISC Emphasis on software Single-clock, reduced instruction only Register to register: "LOAD" and "STORE" are independent instructions Low cycles per second, large code sizes Spends more transistors on memory registers
3
About RISC
Reduced Instruction Set Computer Common Characteristics
One Instruction per cycle Register to Register operations Large register file Simple Addressing Modes Simple Instruction Formats Hardwired Programmed Unit Less number of instructions
ARM Architecture
Effective pipelining
Lesser pipeline stalling
ARM Architecture
Additional Features
Control over ALU and shifter Auto-increment and auto-decrement addressing modes Load and Store multiple instructions Conditional execution of all instructions
ARM Architecture 6
ARM1026EJ-S
SC100
ARM720T
1994
1996
1998
2000
2002
2004
2006
time
ARM Architecture 7
Version 2
Multiply and Accumulate Instructions
Coprocessor support Two more banked regs in fast interrupt mode SWP and SWPB load and store instructions 26-bit address space
8
ARM Architecture
Version 4
Half word load/store instructions Load and sign extend bytes and halfwords instructions T Thumb state transfer instruction Privileged processor mode
ARM Architecture
ARM Architecture
10
Disadvantages
More instructions for the same job Some exception handling instructions are not included
ARM Architecture
11
ARM Architecture
12
Features
Features DSP Jazelle
Architecture
v4T
Thumb
Media
v5TE
v5TEJ v6
P P P P
P P P
P P
ARM Architecture
13
V3
V3M V4 V4TxM V4T V5 V5T
3
3 4 4 4 5 5
None
1 1 None 2
No
No Yes No Yes Yes Yes
No
V5TxM
V5TE
5
5
2
2
No
Yes
Yes
ARM Architecture
14
ARM7TDMI T Thumb Code D JTAG Debug M Fast Multiplier I Embedded Cell Macrocell F Vector Floating Point
ARM Architecture
15
5TE
5TEJ
ARM9EJ - S
ARM926EJ - S
mode
SA - 1110 accumulate instructions ARM7EJ - S ARM1026EJ - S
3
Thumb instruction Early ARM set ARM7TDMI ARM9TDMI ARM1020E
4T
XScale
architectures
support
ARM1136EJ - S 16
ARM Architecture
16
ARM Architecture
17
Intellectual Property
ARM provides hard and soft views to licensees
RTL and synthesis flows GDSII layout
ARM Architecture
18
Programmers Model
Data Types Processor Modes Registers General Purpose Registers Program Status Registers Exceptions Memory
ARM Architecture
20
Data Types
ARM processors support following data types
Byte Halfword Word 8 bits 16 bits 32 bits
Halfwords must be aligned to two-byte boundaries Words must be aligned to four-byte boundaries
ARM Architecture
21
Processor Modes
ARM supports seven processor modes
User: unprivileged mode under which most tasks run FIQ: entered when a high priority (fast) interrupt is
raised IRQ: entered when a low priority (normal) interrupt is raised
Undefined: used to handle undefined instructions System: privileged mode using the same registers
as user mode
ARM Architecture 22
Registers
ARM processor has total 37 registers
31 general-purpose registers (32 bits wide)
Unbanked registers, R0-R7 Banked register, R8-R14 Program Counter R15
Only 16 are visible, others used for exception processing 6 status registers (32 bits wide)
Saved Program Status Register (SPCR) Current Program Status Register (CPSR)
ARM Architecture
23
Register Organization
ARM Architecture
24
Special Registers
Program Counter (R15)
Points to instruction which is two instructions after the instruction being executed ARM instr four bytes (32-bits) and are always word aligned Two LS Bits are always zero
ARM Architecture
25
28 27
24
23
16
15
N Z C V Q
I F T
mode
N Z C V
Set to 1 when result is negative Set to 1 when result is zero Set to 1 on carry or borrow generation and on shift operations Set to 1 if signed overflow occurs
26
ARM Architecture
28 27
24
23
16
15
N Z C V Q
I F T
mode
I F
Disables IRQ interrupts when set Disables FIQ interrupts when set T=0 indicates ARM execution T=1 indicates Thumb execution
27
ARM Architecture
28 27
24
23
16
15
N Z C V Q
I F T
mode
Q Indicates occurrence of overflow and/or saturation M[4:0] 0b10000 0b10001 0b10010 0b10011 0b10111 0b11011 0b11111
ARM Architecture
Exceptions
Generated to handle an event ARM supports seven types of exceptions When exception occurs execution is forced from fixed memory address known as exception vector
Exception Type Reset Undefined Instruction Mode Supervisor Undefined Normal Address 0x00000000 0x00000004 Priority 1 6
6 5 2
4 3
29
Memory
Address Space
ARM uses a single, flat address space of 232 8-bit bytes Address calculations done using ordinary integer instructions. Address wraps around if there is an overflow or underflow
No support for unaligned memory (instruction and data) accesses Memory-mapped I/O
ARM Architecture
30
Endianness
Big Endian Memory System
31 15 0
Byte at address Byte at address Byte at address Byte at address A A+1 A+2 A+3
Word Address at A Halfword At Address A+2 Halfword At Address A Byte at address Byte at address Byte at address Byte at address A+3 A+2 A+1 A
Conditional Execution
Almost all ARM instructions can be conditionally executed If N, Z, C and V flags in CPSR satisfy a condition then the instruction is executed or it is treated as a NOP. Value of 0b1111 in condition field is used for instructions which can be unconditionally executed 4-bit condition code field
31 28 27
cond
ARM Architecture 32
Condition Codes
Suffix Description
Equal Not equal Unsigned higher or same Unsigned lower Minus
Flags tested
Z=1 Z=0 C=1 C=0 N=1
EQ NE CS/HS CC/LO MI
PL
VS VC HI LS GE LT GT LE AL
Positive or Zero
Overflow No overflow Unsigned higher Unsigned lower or same Greater or equal Less than Greater than Less than or equal Always
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
Example:
ARM Architecture
ADDNE
R0,R1,R2
33
ARM Architecture
34
Exception-generating Instructions
Two exception generation instructions present
The Software Interrupt (SWI) used to cause a SWI exception. By this the User mode code can make calls to privileged OS code The Breakpoint (BKPT) used for software breakpoints. It causes a Pre-fetch Abort exception to occur
ARM Architecture
35
ARM Architecture
36
DSP extension introduced to implement efficient signal processing without compromising on control capabilities
ARM Architecture 37
Thank You
ARM Architecture
38