BCS-29 Advanced Computer Architecture: Linear & Nonlinear Pipelines Instruction Pipelines & Arithmetic Operations
BCS-29 Advanced Computer Architecture: Linear & Nonlinear Pipelines Instruction Pipelines & Arithmetic Operations
Input Output
Ready Ready Ready Ready
S1 S2 Sk
Ack Ack Ack Ack
S1 S1 S1
Clock
t tM d
X S1 X X X X X
S2
S2 X X X X X
X
S3
S3 X X X X X
X
S4 S4 X X X X X
• The frequency, f = 1 / t
= 1 / [t M + d ] (i.e., reciprocal of clock period)
Execution F I1 I2 I3
D I1 I2 I3
O I1 I2 I3
E I1 I2 I3
W I1 I2 I3
Dr P K Singh Slide-2.10
Dependencies
• Data Dependency
(Operand is not ready yet)
• Instruction Dependency
(Branching)
Will that Cause a Problem?
Data Dependency 1 2 3 4 5 6
I1 -- Add R1, R2, R3
I2 -- Sub R4, R1, R5
F I1 I2
Solutions
D I1 I 2
STALL
O I 1 I2
Forwarding E I1 I2
Write and Read in one cycle
….
W I1 I2
Dr P K Singh Slide-2.11
Instruction Dependency
I1 – Branch o
I2 – 1 2 3 4 5 6
Solutions
F I1 I2
STALL
D I1 I2
Predict Branch taken O I1 I2
Predict Branch not taken
….
E I1 I2
W I1 I 2
Dr P K Singh Slide-2.12
Non Linear Pipelines
• Non-Linear pipeline are dynamic pipeline because they
can be reconfigured to perform variable functions at
different times.
• Non-Linear pipeline allows feed-forward and feedback
connections in addition to the streamline connection.
X Y
S1 S2 S3
S1 S2 S3
S1 X X X
S2 X X
S3 X X X
S1 X1 X2 X1 X2 X1
S2 X1 X2 X1 X2
S3 X1 X2 X1 X2 X1
S1 X1 X2 X1 X1
S2 X1 X1 X2
S3 X1 X1 X1 X2
Dr P K Singh Slide-2.19
Forbidden Latencies
• X after X
4
S1 X1 X2 X1 X1
S2 X1 X1 X2 X2
S3 X1 X1 X2 X1
7
S1 X1 X1 X2 X1
S2 X1 X1
S3 X1 X1 X1
Dr P K Singh Slide-2.20
Permissible Latencies
• X after X
1
S1 X1 X2 X1 X2 X1
S2 X1 X2 X1 X2
S3 X1 X2 X1 X2 X1 X2
S1 X1 X2 X1 X1
S2 X1 X1 X2 X2
S3 X1 X1 X2 X1 X2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
X1 X2 X1 X2 X1 X2 X3 X4 X3 X4 X3 X4 X5 X6
X1 X2 X1 X2 X3 X4 X3 X4 X5 X6
X1 X2 X1 X2 X1 X2 X3 X4 X3 X4 X3 X4 X5
OR
0
Grant X if 0
8+
1011010
Cycles: (1, 8), (I, 8, 6, 8), (1,
8, 3, 8), (3), (6), [3, 8), (3, 6,
8+
3
6 8+
3) and many more are the
1*
1011011
legitimate cycles may be
1111111
3* 6
traced.
Dr. P K Singh MMMUT, Gorakhpur BCS-29(!)-27
Latency Analysis
• Latency Sequence:
• A sequence of permissible latencies between successive initiations
• Latency Cycle:
• A latency sequence that repeats the same subsequence (cycle)
indefinitely
• Simple cycles:
• A simple cycle is a latency cycle in which each state appears only
once.
(3), (6), (8), (1, 8), (3, 8), and (6,8)
• Greedy Cycles:
• Simple cycles whose edges are all made with minimum latencies from
their respective starting states.
• Greedy cycles must first be simple, and their average latencies must
be lower than those of other simple cycles.
(1,8), (3) → one of them is MAL(Minimum Average latency)
Minimum Average latency(MAL)
• The minimum-latency edges in the state diagrams are
marked with asterisks.
• At least one of the greedy cycles will lead to the MAL.
output
S1 S2 S3
MAL = 3
Reservation Tables
1 2 3 4 5
S1 X X
5+ 1011 3*
S2 X X
S3 X X
S1 S2 S3
D2
1 2 3 4 5 6 7
S1 X X
Forbidden: 2, 6 S2 X X
C.V. → 1 0 0 0 1 0 S3 X X
D1 D
D2 D