Space time diagram - Personal Web Pages

Report
Questions
For the following code sequence
ADD R1, R2, R3
SHL R3, R4, R5
SUB R1, R6, R3
SUB R5, R3, R1
(a) How many potential data hazards are there?
(b) Draw a space time diagram showing the progression of the
instructions through a 5-stage pipeline (the pipeline as described
in notes).
(c) How many cycles are saved if internal forwarding is applied?
ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides10Quiz.ppt
Modification date: Nov 22, 2014
1
Space time diagram
1. ADD R1, R2, R3
2. SHL R3, R4, R5
3. SUB R1, R6, R3
4. SUB R5, R3, R1
(without forwarding)
Waiting on (read after write)
Waiting on (write after write)
Set R1
invalid
Set R3
invalid
Write to Write to
R1, set R3, set
valid
valid
Read R2 Read R4
and R3 and R5
1
MEM
1
IF
1
Read R3
Read R3
2
4
3
2
3
1
2
1
2
3
3
3
3
2
3
4
4
4
4
EX
OF
Set R5
invalid
Read R1
Set R1
invalid
Read R6
OS
Write to
R5, set
valid
Write to
R1, set
valid
4
4
3
4
4
4
4
2
Space time diagram
1. ADD R1, R2, R3
2. SHL R3, R4, R5
3. SUB R1, R6, R3
4. SUB R5, R3, R1
(with forwarding)
Forward R3
Set R1
invalid
Set R3
invalid
Write to Write to
R1, set R3, set
valid
valid
Read R2 Read R4
and R3 and R5
Read R6
OS
1
MEM
1
OF
1
Write to
R1, set
valid
Set R5
invalid
Write to
R5, set
valid
2 cycles saved
Read R3
3
2
2
4
3
1
2
1
2
3
3
3
4
2
3
4
4
4
4
EX
IF
Set R1
invalid
Forward R1
4
4
3
4
4
3

similar documents