Documente Academic
Documente Profesional
Documente Cultură
RISC Compiler
Greater Complexity
Code Generation
Processor
Greater
Complexity
Processor
Reduced Number of Instructions Execute in a single cycle The compiler synthesizes complicated operations Each instruction is a fixed length
The processing of instructions is broken down into smaller units that can be executed in parallel by pipelines Pipeline advances by one step on each cycle for maximum throughput
Have a large general purpose register set Any register can contain either data or address CISC has dedicated registers for specific purposes.
10
Separate load and store instructions transfers data between the register bank and external memory
11
12
13
14
Agenda
Registers CPSR Pipeline Exceptions, Interrupts and the Vector Table Core Extensions Architecture Revisions ARM Processor Families Summary
B.Tech ECE V semester SENSE, VIT University
15
Rd Result
MAC
ALU
Address
16
17
18
Flags
31 30 29 28
Status
Extension 7 6 5
Control 4 0
NZ CV
Function Condition Flags
I F T Mode
Interrupt Masks Processor Mode
Thumb State
19
Processor Modes
Determines which registers are active and the access rights to the cpsr register itself Privileged & Nonprivileged
Abort Fast Interrupt Request Interrupt Request Supervisor System Undefined User
B.Tech ECE V semester SENSE, VIT University
Processor Modes
Abort Failed attempt to access memory FIQ IRQ Two interrupt levels available on the ARM processor Supervisor OS kernel operates System Special version of user mode that allows full R/W access to the cpsr Undefined processor encounters an instruction that is undefined User used in programs & applications When a power is applied to the core it starts in supervisor mode.
B.Tech ECE V semester SENSE, VIT University
21
Banked Registers
User & System
r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 sp r14 lr r15 pc cpsr
Banked Registers
Fast Interrupt Request
r8_fiq r9_fiq r10_fiq r11_fiq r12_fiq r13_fiq r14_fiq
Abort
r13_abt r14_abt
spsr_fiq
spsr_irq
spsr_svc
spsr_undef
spsr_abt
22
Banked Registers
Banked registers are available only when the processor is in a particular mode Every processor mode except user mode can change mode by writing directly to the mode bits of the cpsr
23
spsr_irq
This change causes user register r13 and r14 to be banked The user registers are replaced with registers r13_irq and r14_irq spsr stores the previous mode cpsr
24
Processor Mode
Mode
Abort Fast Interrupt Request
Abbr:
abt fiq
Privileged
yes yes
Mode[4:0]
10111 10001
Interrupt Request
Supervisor System Undefined
irq
svc sys und
yes
yes yes yes
10010
10011 11111 11011
User
usr
no
10000
25
The Jazelle instruction set is a closed instruction set and is not openly available. To take advantage of Jazelle extra software has to be licensed from both ARM Limited and Sun Microsystems.
B.Tech ECE V semester SENSE, VIT University
26
Thumb (cpsr T = 1)
16 bit
30 Only branch instructions
32 bit
58 Most
Core Instruction
Over 60% of the java bytecodes are implemented in hardware; the rest of the codes are implemented in software
28
Interrupt Masks
Are used to stop specific interrupt requests from interrupting the processor
IRQ FIQ
The I bit masks IRQ when set to binary 1, and F bit masks FIQ when set to binary 1
29
Condition Flags
Flag Flag Name Set when
Saturation
V
C
oVerflow
Carry
Z N
Zero Negative
The result is zero, frequently used to indicate the equality Bit 31 of the result is a binary 1
30
Condition Flags
Condition flags are updated by comparisons and the result of ALU operations that specify the S instruction suffix
If SUBS results in a register value of zero, then the Z flag in the cpsr is set
31
Condition Flags Eg
Fields Bit
Flags
Status
27 24
Extension 7 6 5
Control
4 0
31
30
29
28
0 0 1 0 0 0
Function nzCvq j
0 1 0 10011
i F
svc
cpsr = nzCvqjiFt_SVC
32
Conditional Execution
Conditional execution controls whether or not the core will execute an instruction Most instructions have a condition attribute that determines if the core will execute it based on the setting of the condition flags Prior to execution, the processor compares the condition attribute with the condition flags in the cpsr If they match, then the instruction is executed, otherwise the instruction is ignored When a condition mnemonic is not present, the default behaviour is set to always (AL) execute
B.Tech ECE V semester SENSE, VIT University
33
Conditional Execution
Mnemonic EQ NE CS HS CC LO MI PL VS VC HI LS GE LT GT LE AL Name Condition Flags equal Z not equal z carry set/unsigned higher or same C carry clear/unsigned lower c minus/negative N plus/positive or zero n overflow V no overflow v unsigned higher zC unsigned lower or same Z or c signed greater than or equal NV or nv signed less than Nv or nV signed greater than NzV or nzv signed less than or equal Z or Nv or nV ECE V semester always B.Tech (unconditional) ignored
SENSE, VIT University 34
Pipeline
Is a mechanism a RISC processor uses to execute instructions Using a pipeline speeds up execution by fetching the next instruction while other instructions are being decoded and executed
35
Fetch loads an instruction from memory Decode identifies the instruction to be executed Execute processes the instruction and writes the result back to a register
B.Tech ECE V semester SENSE, VIT University
36
Decode
Execute
ADD
SUB ADD
CMP
SUB
ADD
Filling the pipeline Allows the core to execute an instruction every cycle
B.Tech ECE V semester SENSE, VIT University
37
Higher operating frequency higher performance Latency increases Increase in instruction throughput by around 13% in 5 stage pipeline 1.1 Dhrystone MIPS per MHz
B.Tech ECE V semester SENSE, VIT University
38
Decode
The instruction is fetched from memory and placed in the instruction pipeline The instruction is decoded and register operands read from the register file
An operand is shifted and the ALU result generated
Execute
Memory (Buffer/Data)
Write (Write-Back)
Data memory is accessed if required. Otherwise the ALU result is buffered for one clock cycle to give the same pipeline flow for all instructions The results generated by the instruction are written back to the register file, including any data loaded from memory
39
Increase in instruction throughput by around 34% in 6 stage pipeline 1.3 Dhrystone MIPS per MHz Code written for the ARM7 will execute on ARM9 and ARM10
B.Tech ECE V semester SENSE, VIT University
40
Time Cycle 1
ADD
MSR iFt_SVC
cpsr
AND
ADD
41
Pipeline Characteristics
An instruction in the execute stage will complete even though an interrupt has been raised The execution of a branch instruction or branching by the direct modification of the PC causes the ARM core to flush its pipeline
B.Tech ECE V semester SENSE, VIT University
42
43
Shorthand
RESET UNDEF
Address
0x00000000 0x00000004
High Address
0xffff0000 0xffff0004
SWI PABT
DABT IRQ FIQ
0x00000008 0x0000000C
0x000000010 0x000000014 0x000000018 0x00000001C
0xffff0008 0xffff000C
0xffff0010 0xffff0014 0xffff0018 0xffff001C
44
45
Core Extensions
Standard components placed next to the ARM core Improve performance, manage resources, provide extra functionality Three hardware extensions
46
Caches
Cache is a block of fast memory placed between main memory and the core Cache provides an overall increase in performance ARM has two forms of cache
Single unified cache for data and instruction Separate caches for data and instruction
B.Tech ECE V semester SENSE, VIT University
47
Memory Management
MMU is a class of processor hardware components for handling memory accesses requested by the CPU. The functions of MMUs are
Translation of virtual address to physical address. Memory protection Cache control etc
B.Tech ECE V semester SENSE, VIT University
48
Coprocessors
Coprocessors can be attached to the ARM processor A separate chip,that performs lot of calculations for the microprocessor,relieving the CPU some of its work and thus enhancing overall speed of system. A secondary processor used to speed up operation by taking over a specific part of main processors work. The ARM processor uses coprocessor 15 registers to control cache, TCMs, and memory management
B.Tech ECE V semester SENSE, VIT University
49
Architecture Revisions
Every ARM processor implementation executes a specific instruction set architecture (ISA) ISA have more than one processor implementation
50
Nomenclature
x - family y memory management / protection unit z - cache T Thumb 16 bit decoder D JTAG debug M fast multiplier I EmbeddedICE macrocell E Enhanced instructions (assumes TDMI) J - Jazelle F vector floating point unit S Synthesizible version
ARM{x}{y}{z}{T}{D}{M}{I}{E}{J}{F}{-S}
51
Revision History
Revision Example core ISA enhancement Implementation
ARMv1 ARMv2 ARMv2a ARMv3 ARM1 ARM2 First ARM Processor 26 bit addressing 32 bit multiplier 32 bit coprocessor support On chip cache Atomic swap instruction Coprocessor 15 for cache management 32 bit addressing Separate cpsr & spsr New modes UNDEF, ABORT MMU support virtual memory Signed & unsigned long multiply inst. Load store instruction New Mode system 26 bit addressing mode no longer supported
52
ARMv3M ARMv4
ARM7M StrongARM
Revision History
Revision Example core ISA enhancement Implementation
ARMv4T ARMv5TE ARM7TDMI & ARM9T Thumb ARM9E & ARM10E Superset of the ARMv4T Extra inst. added for changing state between ARM & Thumb Enhanced multiply instructions Extra DSP type instructions Faster multiply accumulate ARMv5TEJ ARM7EJ & ARM926EJ Java acceleration ARMv6 ARM11 Improved multiprocessor instructions Unaligned and mixed endian data handling New multimedia instructions
B.Tech ECE V semester SENSE, VIT University
53
Description of cpsr
Parts
Mode T I&F J Q V C Z N
Bits
4:0 5 7:6 24 27 28 29 30 31
Architecture
all ARMv4T all ARMv5TEJ ARMv5TE all all all all
Description
processor mode Thumb state interrupt masks Jazelle state condition flag condition flag condition flag condition flag condition flag
54
55
ARM9
ARM10
ARM11
eight-stage 335 0.4 mW/MHz (+ cache) 1.2 Harvard 16 x 32
three-stage five-stage six-stage 80 150 260 0.06 mW/MHz0.19 mW/MHz 0. 5 mW/MHz (+ cache) (+ cache) 0.97 1.1 1.3 Von Neumann Harvard Harvard 8 x 32 8 x 32 16 x 32
56
ARM926EJ-S MMU
none none unified 8K cache separate 16K/16K D + I cache separate 8K/8K D + I cache separate cache TCM configurable separate 4K/4K D + I cache separate cache TCM configurable separate TCM configurable
B.Tech ECE V semester SENSE, VIT University
no yes no no no
no no yes no
v5TEJ yes
separate 32K/32K no D + I cache separate 16K/16K no D + I cache yes separate cache TCM configurable yes separate cache TCM configurable yes separate cache TCM configurable
yes
yes
v5TE
v5TE
yes
yes
yes yes
v6 v6
yes yes
58
Cortex Family
for complex OS and user applications
ARM Cortex-R4(F)
59
Specialized Processors
StrongARM
Digital Semiconductor + Intel PDAs Low power consumption Harvard Architecture 5 stage pipeline No thumb support
60
Summary
Data flow in an ARM core. 3 instruction sets Register file Extensions
ISA
61