{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cs3330-chap4-pipeline-3

cs3330-chap4-pipeline-3 - 1 Consider this sequence sub $2...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 ¡ Consider this sequence: sub $2 , $1,$3 and $12, $2 ,$5 or $13,$6, $2 Data Hazards in ALU Instructions 4.7 Data Hazards: or $13,$6, $2 add $14, $2 , $2 sw $15,100( $2 ) ¡ We can resolve hazards with forwarding ¢ How do we detect when to forward? Forwarding vs. Sta CS/ECE 3330 – Fall 2009 lling Dependencies & Forwarding CS/ECE 3330 – Fall 2009 1 2 ¡ Pass register numbers along pipeline ¢ e.g., ID/EX.RegisterRs = register number for Rs sitting in ID/EX pipeline register Detecting the Need to Forward ¡ ALU operand register numbers in EX stage are given by ¢ ID/EX.RegisterRs, ID/EX.RegisterRt CS/ECE 3330 – Fall 2009 2 ¡ Data hazards when 1a. EX/MEM.RegisterRd = ID/EX.RegisterRs 1b. EX/MEM.RegisterRd = ID/EX.RegisterRt Detecting the Need to Forward Fwd from EX/MEM pipeline reg 2a. MEM/WB.RegisterRd = ID/EX.RegisterRs 2b. MEM/WB.RegisterRd = ID/EX.RegisterRt Fwd from MEM/WB pipeline reg CS/ECE 3330 – Fall 2009 3 3 ¡ But only if forwarding instruction will write to a register! ¢ EX/MEM.RegWrite, MEM/WB.RegWrite Detecting the Need to Forward ¡ And only if Rd for that instruction is not $zero ¢ EX/MEM.RegisterRd ≠ 0, MEM/WB.RegisterRd ≠ CS/ECE 3330 – Fall 2009 4 Forwarding Paths CS/ECE 3330 – Fall 2009 5 a. Without forwarding 4 Forwarding Paths CS/ECE 3330 – Fall 2009 6 ¡ EX hazard ¢ if (EX/MEM.RegWrite and (EX/MEM.RegisterRd ≠ 0) and (EX/MEM.RegisterRd = ID/EX.RegisterRs)) ForwardA = 10 Forwarding Conditions ForwardA = 10 ¢ if (EX/MEM.RegWrite and (EX/MEM.RegisterRd ≠ 0) and (EX/MEM.RegisterRd = ID/EX.RegisterRt)) ForwardB = 10 CS/ECE 3330 – Fall 2009 7 5 ¡ MEM hazard ¢ if (MEM/WB.RegWrite and (MEM/WB.RegisterRd ≠...
View Full Document

{[ snackBarMessage ]}

Page1 / 16

cs3330-chap4-pipeline-3 - 1 Consider this sequence sub $2...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online