Due date: On or before Thursday, May 08, 2025 Absolutely no copying others’ works |
Name: ___________________________ |
IF | ID | EX | MEM | WB |
---|---|---|---|---|
270 ps | 360 ps | 170 ps | 320 ps | 180 ps |
ALU/Logic | Jump/Branch | Load | Store |
---|---|---|---|
40% | 30% | 15% | 15% |
lw
instruction in a pipelined and non-pipelined processor?loop: lw $s0, 0($s3) # I1 lw $s1, 8($s3) # I2 add $s2, $s0, $s1 # I3 addi $s3, $s3, -16 # I4 bnez $s2, loop # I5Assume that perfect branch prediction is used (no stalls due to control hazards), that there are no delay slots, that the pipeline has full forwarding support, and that branches are resolved in the EX (as opposed to the ID) stage.
RAR | RAW | WAR | WAW |
---|---|---|---|
on $s0 for I1 and I3
|
n+5
and ending at the cycle n+12
.
Executed Instructions | Pipeline Cycles | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
n+1 | n+2 | n+3 | n+4 | n+5 | n+6 | n+7 | n+8 | n+9 | n+10 | n+11 | n+12 | n+13 | n+14 | n+15 | n+16 | |
lw $s0, 0($s3) |
IF | ID | EX | MEM | WB | |||||||||||
lw $s1, 8($s3) |
||||||||||||||||
add $s2, $s0, $s1 |
||||||||||||||||
addi $s3, $s3, -16 |
||||||||||||||||
bnez $s2, LOOP |
||||||||||||||||
lw $s0, 0($s3) |
||||||||||||||||
lw $s1, 8($s3) |
||||||||||||||||
add $s2, $s0, $s1 |
||||||||||||||||
addi $s3, $s3, -16 |
||||||||||||||||
bnez $s2, LOOP |
||||||||||||||||
Completely busy |
n+5
) during which the addi
is in the IF stage.
End with the cycle (i.e., n+12
) during which the bnez
is in the IF stage.)