For the following sequence of MIPS instructions. Explain your answers using the
ID: 3886477 • Letter: F
Question
For the following sequence of MIPS instructions. Explain your answers using the 5-stage pipeline.
Without Forwarding:
a) show the pipelining sequence and schedule the instruction in a 5 stage pipeline.
b) reorder the provided code to minimize stalls. (Your reordering shouldn't impact the semantics and end result of the code.
With Forwarding:
c) show the pipelining sequence
d) reorder the code to minimize the stalls.
e) compare with original (no forward) code. (# of total cycles and number of stall cycles.)
lw $R1, 0(SRO) add $R3, $R1, $R8 lw $R2,16(SR0) sub $R4, $R2, SR8 sw $R3, 32(SR4)Explanation / Answer
(a)The time sequence pipeline diagram (no data forwarding)
T0
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
I1
IF
ID
EX
MEM
WB
I2
IF
ID
X
X
EX
MEM
WB
I3
IF
ID
X
X
X
X
EX
MEM
WB
I4
IF
ID
X
X
X
X
X
X
EX
MEM
WB
I5
IF
ID
X
X
X
X
X
X
X
X
EX
MEM
WB
(b) Reordering of the provided code to minimize stalls:
I1: lw $R1, 0($R0)
I2: lw $R2, 16($R0)
I3: add $R3, $R1, $R8
I4: sub $R4, $R2, $R8
I5: sw $R3, 32($R4)
(c)The time sequence pipeline diagram (with forwarding)
T0
T1
T2
T3
T4
T5
T6
T7
T8
T9
I1
IF
ID
EX
MEM
WB
I2
IF
ID
EX
MEM
WB
I3
IF
ID
EX
MEM
WB
I4
IF
ID
EX
MEM
WB
I5
IF
ID
X
EX
MEM
WB
(d) Reordering of the provided code to minimize stalls:
I1: lw $R1, 0($R0)
I2: lw $R2, 16($R0)
I3: add $R3, $R1, $R8
I4: sub $R4, $R2, $R8
I5: sw $R3, 32($R4)
(e) Comparison between with and without Forwarding:
Without Forwarding
With Forwarding
No of Clock Cycles:
16
9
No of Stalls:
20
1
T0
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
I1
IF
ID
EX
MEM
WB
I2
IF
ID
X
X
EX
MEM
WB
I3
IF
ID
X
X
X
X
EX
MEM
WB
I4
IF
ID
X
X
X
X
X
X
EX
MEM
WB
I5
IF
ID
X
X
X
X
X
X
X
X
EX
MEM
WB
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.