5-Stage Pipeline CPU Hardware
5-Stage Pipeline CPU Hardware
5-Stage Pipeline CPU Hardware
6
DMIPS
Dhrystone is a synthetic benchmark program for system programming. So
DMIPS measures not just instructions per second but gives an idea of how
long overall it will take one processor to perform a task versus another,
taking into account the different number and kinds of instructions.
The industries have adopted the VAX 11/780 as the reference 1 MIPS
machine. The VAX 11/780 achieves 1757 Dhrystones per second.
7
Sign Extend -> converts
signed 8/16 bit to 32 bit
value and places in reg.
Two source registers (Rn
and Rm) and one result
register Rd
Barrel shifter =>
preprocess Rm before it
enters to ALU
MAC unit => for multiply
and accumulation
operation
8
On Chip Debug Hardware
9
ARM Architecture
ARM Core under study is ARM7TDMI
ARM state => Instructions are 32-bit wide and address is word aligned
Thumb state => Instructions are 16-bit and address is half-word aligned
ARM Modes:
Different Modes of ARM processor are defined for specific purpose
User mode => most application softwares run in this mode
10
ARM Architecture
Exception modes => Supervisor, IRQ, FIQ, abort, undefined
Non exception modes=> User, System
‘supervisor’ mode => runs embedded operating system routines
‘User’ mode => runs Application programs
IRQ & FIQ modes => handles hardware interrupts
Abort mode => handles memory access violations
Undefined mode => handles undefined instruction
ARM Architecture
CPSR:
32-bit register with condition flags, control bits, status & ext.
Only privileged modes have full write access to CPSR
Every processor mode except user mode can change mode by writing
directly to the mode bits of the CPSR.
13
Banked Registers:
15
ARM Architecture
MOV PC, LR or
B LR
16
ARM Family and Cores
18
19
ARM - The Barrel Shifter
LSL : Logical Left Shift ASR: Arithmetic Right Shift
CF Destination 0 Destination CF
Destination CF
20
ARM Data Processing Instructions
CMP,CMN,TST & TEQ always update flags (even if ‘S’ is not used as
suffix) and do not alter any register. They use only Rn and OP2.
MOV & MVN use only two operands i.e. Rd and ‘op2’
21
Data processing:
ADD R9, R5, R5, LSL #3 ; R9 = R5+(R5*8) = 9*R5
RSB R9, R5, R5, LSR #3 ; R9 = (R5/8) – R5
MOV R12, R4, ROR R3 ;R12= R4 rotated right by value of R3
CMP R7, R5 ; update flags after (R7-R5)
Conditional Execution:
ARM instructions can be made to execute conditionally by post fixing
them with the appropriate condition code field. (e.g. MOVEQ R0,R1)
Condition checks the status of appropriate flags
If condition is true, normal execution otherwise no execution.
Adv. => Greater pipeline performance and higher code density leading to
higher instructions throughput
22
ARM Conditional Execution
23
ARM Conditional Execution
Set the flags, and then use various conditional codes
CMP r0, # 0 if (a==0) x=0; (here r0 = a, r1= x)
MOVEQ r1, # 0 if (a>0) x=1;
MOVGT r1, #1
Set of Conditional compare instruction
CMP r0, # 4 if (a==4 or a==10)
CMPNE r0, #10 x=0;
MOVEQ r1, # 0
24