You are on page 1of 2

Forwarding Cases for the Pipelined Datapath

add t0, t1, t2


sub t3, t0, t4 fwd t0, MEMEX

******************

add t0, t1, t2


sub t3, t4, t5
or t6, t0, t7 fwd t0, WBEX

*****************

add t0, t1, t2


sub t3, t4, t5
or t6, t0, t3 fwd t0, WBEX and fwd t3, MEMEX

*****************

add t0, t1, t2


sub t0, t3, t4
or t5, t0, t6 fwd t0, MEMEX

*****************

add t0, t1, t2


sub t3, t4, t5
or t6, t0, t0 fwd t0, WBEX (at both inputs of ALU)

*****************

lw t0, 0(s0) Insert a nop


add t1, t0, t2 lw t0, 0(s0)
nop
add t1, t0, t2 fwd t0, WBEX

****************

lw t0, 0(s0)
add t1, t2, t3
sub t4, t0, t5 fwd t0, WBEX

******************

-1-
 
lw t1, 0(s0) Insert a nop
lw t2, 0(s1) lw t1, 0(s0)
add t3, t1, t2 lw t2, 0(s1)
nop
add t3, t1, t2 fwd t2, WBEX (t1 doesn’t need forwarding)

*****************

add t0, t0, t0


sub t0, t0, t0 fwd t0, MEMEX (at both inputs of ALU)

*****************

add t0, t1, t2


sub t3, t0, t4 fwd t0, MEMEX
or t4, t0, t3 fwd t0, WBEX fwd t3, MEMEX

*****************

add t0, t1, t2


sw t0, 0(s0) (Option 1: fwd t0, MEMEX) (Option 2: fwd t0, WBMEM)

*****************

add t0, t1, t2


or t5, t6, t7
sw t0, 0(s0) (Option 1: fwd t0, MEMID) (Option 2: fwd t0, WBEX)

*****************

lw t0, 0(s0)
sw t0, 0(s1) fwd t0, WB  MEM

-2-
 

You might also like