0% found this document useful (0 votes)
10 views

Lnpu/oukput Dapendence X: Anb WAR

The document discusses pipeline execution stages including fetch, decode, execute, memory access, and write back. It also provides examples of instructions going through different stages of a 5-stage pipeline processor and calculates the clock cycles taken.

Uploaded by

Chiranjeeb Rout
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lnpu/oukput Dapendence X: Anb WAR

The document discusses pipeline execution stages including fetch, decode, execute, memory access, and write back. It also provides examples of instructions going through different stages of a 5-stage pipeline processor and calculates the clock cycles taken.

Uploaded by

Chiranjeeb Rout
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

19/7/22

peluning
S e q v e n t b e l E x e c u t i g n

PA: P X+Y

P2: P 1

Pa:RX4P

P4: S R-
p5:T R P
PE: U=S+T

P5

wite
fter
Data Dependence
RAW Read
dependence:
X>y
x t > Y : WAR
Flow

dependece: WAW
Anb X Y:
dependeuce
Oukpue
lnpu/oukput dapendence X
>Unknowu dependence
GRAH
Draw dependence qapk s1: R1<-MCA)

S2: R z R+R4
s1: Lonol R1,A
S2 Add RaR1 S3: R<-R3

S3 Move Ra,R3 s4: Ma>-R1

S4 Store B,R1 R-M6)


S13S4
53- S,
S1 S2 ,
s2-S2
s1- >$3
S3
S2+

Do dopendence graph
S1 R1 <- MCA)
s1: Load R1,A
S2 R2 <-MCB)
S2 Lord Rz,B $3 RL<R1+ R2
s3 Ald R1,R2 R1
Sh MCA) <-
S4: Skore AR1
S5M(6) R2
S5: Sre B, R2
s5,si s
S3 S3 S4, s2
S $3, s2
$3 53 i ot considered
5|X Since memor
51 >S1 S2 + ,

s1 S3
dvptase of ipeluning No. of lock cyclas ve

Nen-Pipelined) 6ycles
clock Pigekind4 cc

Ald:RR; R2R2t+R3
R3-R3/R1
STAGE oF
Detng in 1 cdeck eyele PieELINE
D Decode, Ex Execuiom,
Eanple:
MA: Me.mom Access,WB : Wate Back
SIRI<RI+R2 ExTi EDEA Data of Rz
S2 R2 R2
2CCC F D ExEx MAW obbained
S3 R3 +RZ CCc ongE***|* |D Ex M* |B . cc
2 34 S * *Delay 12
uesi 1 12
S-stage figeline Proces sst:
EXE for
LoAD, ADD, sUg cCe
IF,ID, Ex E ,MEM, WB 1 clock cy ola anch excep
for MUL
Exe)
,DiV: 2. cC
lesuchonm
LoAD R3,1CR2)
DV RI, R3, R
ADD R5, RG
SUB
R7RI R8
MUL RA, RRIO
22/7/22 2
M
2 R i + Rz
SI: R3
sTFID) EXE MEM |wB 6 LO

S2:RyR2+RS 32 TF TD EXE MEM wBE


ss: 6 7 K I t k 3 S
; 3
IF IDExEMEM WB
S
S 4 : R 6 < - R 1 + R 3

= 1 IF |IDEXE IMEnNB
Jeck y c l
Clock ccles = |l stalls = 3

INE Goes hom: 2 3


SI R3 -CR2)

3ack
IFIDExEMEMW
52 RI
R3/R IF ID ExE ExEMEMwB
s 3 R 5 - R I t R 6

IF D ExE MEMW
S4 RT -RI~28 IF ExE MEMwg
S5 R1 -R)&RID TF D EXE MEMWS)
. of Cc
Stall
12 CC= II stall = 1

eet Exe) 26lal22


Add Ri RItRz Add R-ActRz
>Accuulatoy

+ype. TS fi st regestez|Souce R- Farmat C32 bs): ALU(coe) ustuctions


rt secnd restersers AD SB,ETE
o desination register o R 4 ShiFeFcode
o pcode=O Shift vve (lukt/ig
Cindicaks type t instruckion)
MPS Dgtruckion
Add $3,$1,4io
represestohn:
6inA Awer per fhied epresentbion
Decimal no. per field

0000po 01pod1o1 0l04Dob|ooopo 1doooo

hex Ox 012 A 4020


Machine Lang ug
presewtiom
struction

Qneshon SuBl++9 1 ,+ 20 R2,F30R3)


goo1o)
D203 9 o o0ooioo Ioloo ioljoioojlooopo/0p
Ox22 eox62E4

at 3 hex: Ox O2MME 48 2

bioy move *9 RI t zoRa) yTyhep


/
Lapx3o
E24
T- ype hstructio

OPsotaddes/umedia
Taet/hestnation
MovE 9 1 , #2DRZ Ox 3D

Coodpo 1o oolaiioo|poopeooo0o0
hexOx 023A1 O030
27 t122
tEcode Cfmcion Crdo NA
, ten represet wh KX XXXX
op Cde - o f all
am tnebc gerakors
SLL sutt ft :2dadd-esso
SLL #18 R #1| R2,2
oooo00
DIDooo00ooloo0Djo x x xXKX
hex ill contain xx ia Hhe ad

lw #8,4# )
Vaelctent conke
Dolo loool olooo| O000 Obo0 o0o0
o00
S #3, 8*)
Rugiste valwe stored in
des ta ma memory
le opcgde x21
3C# )
20
1 00 pl ooosiooo
oo00 000D 0000 I o00
Soure des ahom

OxO11 o008
XOK

g0o0oilo oo
13
4

682G|
hex:
0x O1 CF

21 7 122
o MIPS
,4A3
High-lesel n g u a g e : in saD,$ai,$a2
Mnemonicsfa,h,i

Regsker,
i+j)
f Cg+h)
rejiskers
aiables
allocated to
fai)-La2+ $a3
C$aO+
$O

7MIAS
$a1
add gto, $a0,
a l , $a3
add $t1,s
$to ,$t1
Sulb $vo,

>High-leel lnguage

j= O +1O J=k

MIPS Con stnn


rthmeh
addi Sti, sto,io;erat
ddi sto, 4,03

ink i-o, isks


JL+1D

add $to, $o,0;


add $ti,9to,/0
$to ,$+l;
add $t2, 23
in $sz,2A[oJ
in$s3
LL:in
$s1,h
MIPS AC3
to,12 ($s /$to
3-ht A3 dd isl,$s2,$t0
AC =ht AL33; Au$tO,i2(}s3);
add $bo,bsz2,$t0; /$0= htAL:)
su
$40, (s3); //AL«) -§to
ine i12 j=lo, AL3);
,

ACo)= ij
AC4J
Co) -ACo)+ nC1)
A = ACo)- ACi)
ACo ACo-AC1
ti =122
aadi $to, $o, 12
addi $t1,$0, lo
ACo) =i
Sw to , $s1) lw B , ($s);
AC=j $t2,oG5) ;
sw b2, 46sD ore efhi cint Hh doing
i 5 4 $ s / $ 2 A[ol + aC1] =

adds $t2, ACo= $t2 eveyng in one stateneub


Sw s

t 2 , $ä,4), $tz= alo)- ALi)

1Sw st3
subi $b2 , js, 4 ) ; t 2 = ACo)-A C1l;
Sw *ta, ¢sSI ACo) - $t2
slsl22 ata thazards
w w

RA:Flo w dpendency>S«t; Opcrand Frsardeng

7WAR An > Sel :


register Renamng Technar
RA R2+ R3 RA R2+R3
R3 30
T 1 - 20
R2 20

utpuk
Set: Register Renaming Techniqve
R -R2 +R3 RtR3
Ta-R4-R5
R1Ry-R5

slsllstuchon Sheduling depends on campila)


a=b+c
cCode def;
CASE 1: MIPS astmuction

Lw R1 R FDEx MA WB
R2-C F Ex MA WB
Lw R2,c
D Ex MA wS
Lw R4,e FD Ex MA WB
RS
Lw R5,f FDEx MA WB
A3R1+R2
tDD R3,R,R2 R6-R +RS F D Ex MA
ADD R6,R, RS F Ex MA NB
EX
Sw a ,RR d R F
Si d,RG Stl
CC
cAtSE 2 MIPS lusejon
..FDEx MA wg
R1-
R-c FDEx MA 8
Ex MA WB
F
RY-e- Ex MA wB
F D
R3R+R -
Ex MA WB
D E xMA WB
RS4 F
R6-R4+R5- F D Ex MA
.F

d R6 wB

cc 16

esb+c
tg+h Lw R5, 9
Lw R1, A
LW R6
Lw R2, tDD R7, k5,R6

ApD R3,R1, R2 Sw +,R7


Sw C,R3
ADD R1,R2,,R3
SW e, 6
ol8l22
Speedup = nke
E-1)
Fo h> k
Speadep
MIDSEM-20 13
Jeck yele 2Xo
5ox 1os

I5 2x1o cP I = -33
CPIRIOS

o.4+Os o.4 + O.6


o.5
4.33-1
V3

MiDsEM-2020
20 nkt

Non-Pipeun nx 40 CkC) =
/7a
20 nx4o
23
6182
1-b ooneh predchonchngre
For Cizo;i<5 i++) IS NT
aa+L

Achh onSeyvence T
Predichon
=
TTT T NT
NT TTTTT8
Accuncy 6GY.
h a State : NT 3

Ackual Segvence TT T TT NT
NT TT

NT T
NT

T
NT T NTT
fCiz 3) it+ Predacbi oM NT T
onsieo
coubnre

i+t Accuracy XX X
NT
AS:
T T TT AccuTA
TT7

P NTT
-bbrauel Preoicie ontechngve
tecknigve

AsTT 7TNT IS:NT

Accuray =
T T
P:NTNT T

rCj=1 j<Y3j ++)


at+
3

248 22 333 A
ET
IDI Fo wO 33 2 B
4 cc 33 1 c

c 44 3
35 * 3+ 3R2* 51*
49
Atnaae no. yoks

Executin hne k G b-1)C


4+1.99) + (00-1)*1.17
+1-19) +94 1-99)

+-1),
Test
nstuchm
e Pioeune
Exete 10 iustmchn
mo
Ec stge sane aXecution Hme .find speedp "

.3
45+04

uk
yoo
26lglz : Instmetion evel faralle Lism CILP)
Pipeline deph No. of stages
=

Speednp= CPTunpipel
1+ fipelne sball cyckes pe« iustuction CPT Pipelines

6 Staus per îustmehom


(0. x2+.05* 2)
s predichon
=
K
1+0.1+0.I

2 307. daka degendent = 5 stalls


Speedup 20
2 2.5
20 20 x 4556
)
1+ 0.7 x5

5
stages 23 / Loads nert ustucki n uses load valre
oads= 5 xo.3 1
inasas
o. =
0.|15
Jmps 0-02x 1 0.0 =

Cond aoval =
o. 25x 0 .11 * 1 -
o .o475
Totl lenglby =)
29/s22 LLP

Lop n e n n l i n g

uE>*91;
=i-3)
i=i-3) /Loop vvoU twie
/LooP n

Ciloo0 ;
cmstat;
C i =R Ci)+
Li - + cnstad -21 -3 0
Ci-
TLi-= KLi-2]
+ corstat

3 Toal ho. t steps: 4

0 wn brance s bake minimum 1 stall reg wred

,emsbant (5)
301 812 21 200o

F o =2.
LD Fo, olRA),

APp Fi,Fo, /F4 2+5=F


=

20
SD F, OCRA) / a r [o) =7
2 2606
DA R4, Ra,#3/R1=200o+1

= 2002 2008

1
Address increments by

toreduce wo. of dock cles


lasbuchom Schaduuug

Lp Fo,o CR4)
R1 , R1,#8
DAD
1 so

ADD A, Fo, F Addres akrendy


iucremented by
8(R1) / Prevous index
SDF4-
s&oringia

b
a: a [i++]+
5

H/Wa=i++

19l22 e ime 3 . 5 rm 6 cc
rednces
LP rdl
219 22
12 Cc
No-P ebned
Ppened=G cc CR
=

Clock Rat
iaS. n
NO. f
2
nx12 2
Specdup CR ) T
T2 2T1

AnSmes: Ti:7
6n 6
+
-

36
L6+-1ex6 ) 30 +b
C max+ delay
6 +0 6

Non-Ppelned = 129n

12
2 n
syeead-) 30t bn
Speedp=2 = 2

91122
. Cik5)
whle Ci5)
As TTNTINT

P TTTTi

jTACy 5 100 783. NI

2 b
T T
NTT Stng-
T NT T AS T NT
A g S T NT T
Weak-w
TTT
P TT NT T NTr P T S S W
AccA lo/,
F,D wB 1 cc
Bxe ADD =icc SUB
MUL -3 M 6
DR2 R t RO Ex WS
I D
IF D EX Ex EX WB
Ex WB
RGR5-R1 D
+ O.095 +O. 56
O.15 x o.|
x3 to.o8 x3

2
E M
R1 R2 R3
M W
ADADD R RS F
DSUB FDE M
R6 R R
DMVL FDE M W
R R DE M W
O Rs
Ro R R11
XO

5o s (5ox 5)
hne
1.0483
o.8+ 0 : 5
O8 + 0O

A.D433 15.44
Napipelave )
Pipelan

May speedg e.3 .2

4.25
O Suko
LD F6,3CR2) Lond2 ycle
LD F2,45(R3) FPadd2 cyles
LD F, 56(RN)
Ffwwla py 10 cyoles
MULD Fo,P2,M
sUBD Fs, F6,F2
FU 3 Londer CLD/sT), 3 ADOE 2 Mulb pliers

Execuh om wite
Rsult Tsse Compete esu lt
LD P6,3(R)
Coplete
LD F2,15(R3) 2
LD FYS6(e) 5 6
MUL Fo, F2, F - 4 19
SUBD
$, F6 5 7
5 8
ISsUe Conplete Res ult
LD F6 3 (R) 2
LD F , 4s (R3 2

LD F4, 56 (R) 3 5
MULD Fo, F2 F
DiVD FiO,Fo, FG 5 21 22

LD2cc MULI FU3 Loaddet , 3 tlder 2 mulbplie


ADD 2 CC Div

LD Fo o 1 sSe Cmplute Resu l


1
MvLTD F4 Fo R2
15
J-17
L 6
BNEZ LLrp 2
5

SD 2doseks -1 20
-22
Mut4 cc 1
23
LD 8 cc 3 19 3 20
T12
a 25
13 DA 28
TT

|S
Supe scala Superpipelne 26l1ol 22

C1,1) =
k+(N-1) Scalar
Superscalax
tCmy1) k +(N-m) m isSwes
m ha
ving sAme k sages
ldcal Specd up
SCm, 1) = t C1,1) n CktN-4) =mCk+ N-1)
C1) k+(N) N Ck-1)

SupeTpeluing
EAch stage divide into substages
2
FE FF261 62 LFa
3

Superpipelned Superscala ferformance


Cmn) k+N-)
mn

SCm 4)= t(4,1) Mn Ck +N 4)


ECm ) kmn+N-m
sCm) EC4,4) - mn
CkN-4)
m+N-m
Dsadventages
P-rbem schedmlng
Detinental affeck on perfomance vanus
bcomeS more prono unced haza vds
4 l h l 2 2

AMAT And alcbal Miss Rate


of Hhe givea fsltai, nfarmakion
ulst
HT L1 cycle
O.05ns AMAT I t 0.0> * ML1t0.05XI6.5 =1.325
MR L1

HT L2
4 cycles MP 4 + 0-25 x 50 I6.5
MR La 0.25ns
AMAT L2
MP Lz
50 yces
MPL * ME 0. o125 ns
obnl Mi

8 1 0 0 0 nctuchions

to mISSes iu L1
20 i sses îu L2

1 cqcle
L4 h tie
L2 HT 1o cy e
L2 miss PRalty =
Iod

e mstmeLim
1.5 henyretrenes=1.0
CeI
s6ume idal
A local and qlobal miss t e o enc nel AMAT, stall eyoes pey
ind
nstuceh on and hose wiout L2 a h

Local wiss a t fp L1 =40 . 4%


ooo

Local mussate f Lz / 2 Z 5o
27
wcs ake = 4 x 5° 7 =

qlobal
o 20x00 2
Tast
lo+ o. 5 x jdo Averae Heary salls pe
W AMAT 1+(0.o4)| ( 3 . - 1 ) XI.S - 3 .
L
1+0,01x 6D
3.4

Wrhuk L2 cake
160 5
5
1 + 47 x
TInst (5-1.)x1.5
AtMAT

Mwmory
Stales pe
t erage
improvemenk uith Lz
1)
teriinana
6+ 52
(3.641)
5 veent
what is t e npace ot *cmd-lerel ache asso ciaativ1ty
Civen Mhe data below,
o s miss penalby

Assu me io Cc
dine cl mapped
=

HT in L2 fr
asspcialviky increases by
ut b e o.5 Cc
2-w seke
La tov r e c e maprel 20/
LoCal i s t e f
LMR L2 fv 2-wy SA =I07.
MP L2|Od CC

AMAT 10+207. * io= 30cc


iod E
0 7 x 20.5 cc
AMAT2w 0 .f

increase. o 1 inCYase
ra cically
20 Cc
AMAT2w 0 t o KjoD
l + Id7xlod = 2.1 CC

Associalviby Tag sleck &Set


Sek Asseciaive Tag Se Number lock-
MM siz 4G8 =2 x 2 2qte

Eapa-
MM Size 3 G3 2x 23
Block Sie 8KB 2 x2 2 B
Word Size 1B
Fo Assoc ahve
Mapes
Phy Sical Mdress bs splu = 33

19 Tas Dictan Sise


EXmpl-3
2B Block Offset l12
MM s Ze 44B
1 MB 28 No. ns 22
Cache siw 2 12
Blocks R 4 KB 2 B
22Y

Word sizu : 15 seks


=

ber
Fot 2-w SA Mo-peig
PA l,2 32 T SN 8ieck
2x13
Ta Diveckety :

You might also like