Professional Documents
Culture Documents
SUSHMA RAWAL
Introduction
SUSHMA RAWAL
RISC Architecture
Simple but powerful instructions that execute
within a single cycle at a high clock speed.
Reduced complexity of instruction performed by
hardware.
Provides greater flexibility and intelligence in
software, therefore places greater demand on the
compiler.
SUSHMA RAWAL
SUSHMA RAWAL
SUSHMA RAWAL
ARM PROCESSOR
It incorporates these typical RISC architecture
features:
Large uniform register file
Load/store architecture, where data-processing
operations only operate on register contents, not
directly on memory contents
Simple addressing modes, with all load/store
addresses being determined from register contents
and instruction fields only.
SUSHMA RAWAL
ARM PROCESSOR
ARM PROCESSOR
These enhancements to a basic RISC architecture
enable ARM processors to achieve a good balance
of high performance, small code size, low power
consumption, and small silicon area.
ARM processor is small to reduce power
consumption and extend battery operation. Eg
mobile phones and PDAs.
SUSHMA RAWAL
ARM PROCESSOR
ARM core is a 32-bit processor.
ARM processor uses load-store architecture.
There are no data processing instructions that
directly manipulate data in memory.
Data processing is carried out solely in registers.
Register file is made up of 32-bit registers.
SUSHMA RAWAL
REGISTERS
General purpose registers hold either data or
address
All registers are 32-bit in size.
16 data registers ( R0 to R15) and 2 PSR
ARM processor has assigned special functions to
3 registers.
R13- Stack Pointer (SP)
R14- Link Register (LR)
R15- Program Counter (PC)
SUSHMA RAWAL
Registers
Stack Pointer- stores the head of the stack
in the current processor mode
Link register- core puts the return address
when it calls a subroutine
Program counter- contains the address of
the next instruction to be fetched by the
processor.
SUSHMA RAWAL
Registers
In ARM state the registers R0 R13 are
orthogonal.
Any instruction that you can apply to R0
can equally well apply to other registers.
SUSHMA RAWAL
CPSR
ARM uses CPSR to monitor and control
internal operations.
CPSR is a dedicated 32-bit register and
resides in the register file.
SUSHMA RAWAL
Status
Extensions
Control
31 30 29 28
F T
Interrupt
Masks
Condition flags
SUSHMA RAWAL
0
Mode
Processor
mode
10111
10001
Interrupt request
10010
Supervisor
10011
System
11111
Undefined
11011
User
10000
SUSHMA RAWAL
Processor Modes
Processor Modes determine - which
registers are active and have access rights to
the CPSR.
Priviledged mode
- allows full read write access to CPSR
Non Priviledged mode
- read access to control field of CRSP
- read-write access to conditional flags
SUSHMA RAWAL
Processor Modes
Priviledged Modes
Abort
Fast interrupt request
Interrupt request
Supervisor
System
Undefined
Nonpriviledged mode
User
SUSHMA RAWAL
Processor Modes
The ARM has seven operating modes:
User (unprivileged mode under which most user tasks
run)
FIQ (entered when a high priority (fast) interrupt is
raised)
IRQ (entered when a low priority (normal) interrupt is
raised)
Supervisor (entered on reset or when a Software
Interrupt instruction is executed). OS kernel executes.
Abort (used to handle memory access violations)
Undefined (used to handle undefined instructions)
System (privileged mode using the same registers as
user mode). OS routines can be configured to run in this
mode.
SUSHMA RAWAL
Banked Registers
ARM has 37 registers in total, all of which
are 32-bits long.
SUSHMA RAWAL
Banked Registers
20 registers are hidden from a program at
different times.
These registers are called banked registers
They are available only when the processor
is in a particular mode.
SUSHMA RAWAL
Banked Registers
Banked registers are arranged into several banks,
with the accessible bank being governed by the
processor mode. Each mode can access
a particular set of r0-r12 registers
a particular r13 (the stack pointer) and r14 (link
register)
r15 (the program counter)
cpsr (the current program status register)
SUSHMA RAWAL
Register Organisation
General registers and Program Counter
User32 / System
FIQ32
Supervisor32
Abort32
IRQ32
Undefined32
r0
r0
r0
r0
r0
r0
r1
r1
r1
r1
r1
r1
r2
r2
r2
r2
r2
r2
r3
r3
r3
r3
r3
r3
r4
r4
r4
r4
r4
r4
r5
r5
r5
r5
r5
r5
r6
r6
r6
r6
r6
r6
r7
r7
r7
r7
r7
r7
r8
r8_fiq
r8
r8
r8
r8
r9
r9_fiq
r9
r9
r9
r9
r10
r10_fiq
r10
r10
r10
r10
r11
r11_fiq
r11
r11
r11
r11
r12
r12_fiq
r12
r12
r12
r12
r13 (sp)
r13_fiq
r13_svc
r13_abt
r13_irq
r13_undef
r14 (lr)
r14_fiq
r14_svc
r14_abt
r14_irq
r14_undef
r15 (pc)
r15 (pc)
r15 (pc)
r15 (pc)
r15 (pc)
r15 (pc)
cpsr
cpsr
cpsr
sprsr_fiq
spsr_fiq
cpsr
SUSHMA RAWAL
cpsr
spsr_svc
spsr_abt
sprsr_fiq
spsr_irq
spsr_undef
sprsr_fiq
Banked registers
Every mode except the user mode, can change
mode by writing directly to the mode bits of the
cpsr.
All processor modes except system mode have a
set of associated banked registers that are a subset
of the main 16 registers.
A banked register maps one-on-one onto a user
mode register.
With change of mode, a banked register from the
new mode will replace an existing register.
SUSHMA RAWAL
SUSHMA RAWAL
SUSHMA RAWAL
32-bit
16-bit
Core instructions
58
30
Conditional
execution
Data processing
instructions
Most
Only branch
instructions
Separate barrel
shifter and ALU
instructions
Access to barrel
shifter and ALU
SUSHMA RAWAL
Read-write in
privileged mode
No direct access
Register usage
15 general
purpose registers
+ pc
8 general purpose
registers+7 high
registers + pc
SUSHMA RAWAL
Interrupt masks
Interrupt masks are used to stop specific interrupt
requests from interrupting the processor.
Two interrupt request levels- IRQ, FIQ
CPSR has two interrupt mask bits
- 7 (I bit )-IRQ
- 8 (F bit )-FIQ
These interrupt requests are masked when set
SUSHMA RAWAL
Conditional Flags
Updated by
- comparisons
- results of ALU operations that specify S
instruction suffix.
Eg: SUBS
SUSHMA RAWAL
Conditional execution
Conditional execution controls whether or not the
core will execute an instruction.
Condition attribute is postfixed to the instruction
mnemonic, which is encoded into the instruction.
Prior to execution, the processor compares the
condition attribute with the conditional flags in the
CPSR.
If they match then the condition is executed.
When a condition mnemonic is not present, it is
always AL
SUSHMA RAWAL
Conditional execution
SUSHMA RAWAL
SUSHMA RAWAL
SUSHMA RAWAL
Data abort
Prefetch abort
Fast interrupt request
Interrupt request
Software interrupt
Reset
Undefined instructions
SUSHMA RAWAL
SUSHMA RAWAL
SUSHMA RAWAL
FIQ
Occurs when an external peripheral generates the FIQ
input signal.
Core disables both FIQ and IRQ interrupts.
IRQ
Occurs when an external peripheral generates the IRQ
input signal.
IRQ handler will be entered if neither FIQ or abort
exceptions occur.
On entry IRQ interrupt is disabled.
SUSHMA RAWAL
SUSHMA RAWAL
SUSHMA RAWAL
Reset
0x04
Undefined instruction
0x08
Software interrupt
0x0C
Prefetch abort
0x10
Data abort
0x14
Reserved
0x18
Interrupt request
0x1C
SUSHMA RAWAL
Pipeline
The ARM uses a pipeline in order to increase the
speed of the flow of instructions to the processor.
Allows several operations to be undertaken
simultaneously, rather than serially.
Rather than pointing to the instruction being
executed, the PC points to the instruction being
fetched.
Pipeline allows the core to execute an instruction
every cycle.
SUSHMA RAWAL
Pipeline
As the pipeline length increases, the amount of
work done at each stage is reduced.
This allows the processor to attain a higher
operating frequency.
This increases the throughput.
The system latency also increases because it takes
more cycles to fill the pipeline before the core can
execute an instruction.
SUSHMA RAWAL
Pipeline
The execution of a branch instruction or branching
by the direct modification of the pc causes the
ARM core to flush its pipeline.
An instruction in the execute stage will complete
even though an interrupt has been raised.
Other instructions in the pipeline will be
abandoned, and the processor will start filling the
pipeline from the appropriate entry in the vector
table.
SUSHMA RAWAL
ARM nomenclature