Pipelinenew
Pipelinenew
It allows storing and executing instructions in an orderly process. It is also known as pipeline
processing.
What Is Pipelining
Laundry Example
A B C D
Ann, Brian, Cathy, Dave
each have one load of clothes
to wash, dry, and fold
Washer takes 30 minutes
2
What Is Pipelining
6 PM 7 8 9 10 11 Midnight
Time
30 40 20 30 40 20 30 40 20 30 40 20
T
a A
s
k
B
O
r C
d
e
r D
Linear Pipeline
Asynchronous
Synchronous
Nonlinear Pipeline
Asynchronous
Input Output/Input
Ready S 1
ACK ACK
Synchronous
Latch input ….
CLK Pulse
Pipeline Example
5 stage pipeline:
Fetch – Decode – Read – Execute - Write
F D R E W
F D R E W
F D R E W
F D R E W
Pipelined processor: 9 cycles = start-up latency (4) + number of instrs (5)
F
F D R E W Draining the
pipeline
F D R E W
F D R E W
Filling the F D R E W
pipeline
F D R E W
Theoretical Speedup due to Pipelining
tn = k x tp
Sk = n.k/(k+(n-1))
Efficiency is measured by the percentage of busy time
space span over the total time space span.
Impact on Clock cycle time due to Pipelining
Lets recall
Time
S1 X
S2 X
S3 X
S4
X
Dynamic Pipeline
S1 X X X
S2 X X
S3 X X X
Latency Analysis
Latency : the number of clock cycles between two initiations
of the pipeline
10010
State Diagram
10010 i =1
1
ICV – 10010 OR
CVi – 01001
11011 CV* 11011
State Diagram
10010 3
i =3
ICV – 10010 OR
11011 CVi – 00010
CV* 10010
State Diagram
10010 3
i =4
1 4
11011 10011
ICV – 10010 OR
CVi – 00001
CV* 10011
State Diagram
5
10010 3
i =5
1 4
11011 10011
ICV – 10010 OR
CVi – 00000
CV* 10010
State Diagram
5
10010 3
4
1 3
11011 10011
i =3
ICV – 10010 OR
CVi – 00010
CV* 10010
State Diagram
5
10010 3
4
1 3
4
11011 10011
i =4
ICV – 10010 OR
CVi – 00001
CV* 10011
State Diagram
5
10010 3
4
1 3
4
11011 10011
3
i =3
ICV – 10010 OR
CVi – 00011
CV* 10011
State Diagram
5+
10010 3
5+ 4
1 3
4
11011 10011
3
i =5
ICV – 10010 OR
CVi – 00000
CV* 10010
State Diagram
5+
10010 3
5+ 4 5+
1 3
4
11011 10011
3
i =5
ICV – 10010 OR
CVi – 00000
CV* 10010
State Diagram
The state with all zeros has a self-loop which corresponds to empty pipeline
and it is possible to wait for indefinite number of latency cycles of the form
(7),(8), (9),(10) etc.
Simple Cycle: latency cycle in which each state is encountered
only once.
Complex Cycle: consists of more than one simple cycle in it.
It is enough to look for simple cycles
State Diagram
ALU
n Ifetch Reg DMem Reg
s
t
r.
ALU
Ifetch Reg DMem Reg
O
r
ALU
Ifetch Reg DMem Reg
d
e
r
ALU
Ifetch Reg DMem Reg
Collision Free Scheduling 18