Question: Note: If a data hazard is NOT prevented by data forwarding, then the pipeline stalls. Assume data forwarding is working, does the following code stall?

Note: If a data hazard is NOT prevented by data forwarding, then the pipeline stalls. Assume data forwarding is working, does the following code stall? "stall" means it needs an extra nop instruction inserted, If the code stalls then list the labels of the instruction(s) that cause a stall. (Assume you have completed part2a and part2b of the project.) This question is asking if stall signal is set to '1', four cases. See lecture 20 for four cases, and sample pipeline stages. L1: lw $3, 50($3) L2: add $2, $3, $4 L3: sw $2, 20($2) L4: lw $5, 30($2) L5: lw $6, 40($5) L6: or $5, $6, $5 

Referenced documents:

 Note: If a data hazard is NOT prevented by data forwarding,

then the pipeline stalls. Assume data forwarding is working, does the followingcode stall? "stall" means it needs an extra nop instruction inserted, Ifthe code stalls then list the labels of the instruction(s) that cause

A hazard is a condition in the pipeline when a stage of the pipeline would not perform the correct processing with the available data To be a hazard, the action of data forwarding, covered in the previous lecture, must be taken into account. Some cases where hazards would occur are: lw $1,100 ($0) add $22, $1, $1 MEM stage EX stage add $2, $1, $1 lw $1,100 ($0) hazard value for $1 not available Thus hold add $2, $1, $1 in ID stage, insert nop in Ex, this is a stall MEM stage ID stage EX stage add $2,$ 1, $1 lw $1,100 ($0) no hazard nop MEM stage ID stage EX stage WB stage add $22 $1, $1 lw $1,100 ($0) no hazard nop data forwarding add $4, $3, $1 beg 100 ID stage EX stage beg $3, $4 100 add $4, $3, $1 hazard value for $4 not available ID stage EX stage MEM stage no hazard beg $3, $4 100 add $4,$3, $1 nop data forwarding lw $5,40 ($1) beg $5, $4, L2 ID stage EX stage beg $5, $4,L2 lw $5,40 ($1) hazard value for $5 not available ID stage EX stage lw $5,40 ($1) hazard! value for $5 not available MEM stage ID stage EX stage WB stage lw $5,40 ($1) no hazard beg $5, $4,L2 nop nop normal lw A hazard is a condition in the pipeline when a stage of the pipeline would not perform the correct processing with the available data To be a hazard, the action of data forwarding, covered in the previous lecture, must be taken into account. Some cases where hazards would occur are: lw $1,100 ($0) add $22, $1, $1 MEM stage EX stage add $2, $1, $1 lw $1,100 ($0) hazard value for $1 not available Thus hold add $2, $1, $1 in ID stage, insert nop in Ex, this is a stall MEM stage ID stage EX stage add $2,$ 1, $1 lw $1,100 ($0) no hazard nop MEM stage ID stage EX stage WB stage add $22 $1, $1 lw $1,100 ($0) no hazard nop data forwarding add $4, $3, $1 beg 100 ID stage EX stage beg $3, $4 100 add $4, $3, $1 hazard value for $4 not available ID stage EX stage MEM stage no hazard beg $3, $4 100 add $4,$3, $1 nop data forwarding lw $5,40 ($1) beg $5, $4, L2 ID stage EX stage beg $5, $4,L2 lw $5,40 ($1) hazard value for $5 not available ID stage EX stage lw $5,40 ($1) hazard! value for $5 not available MEM stage ID stage EX stage WB stage lw $5,40 ($1) no hazard beg $5, $4,L2 nop nop normal lw

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!