{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L13 - Load Use Hazards Require Stalls ECS 154B Computer...

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

View Full Document Right Arrow Icon
1 ECS 154B Computer Architecture II Winter 2008 Data and Control Hazards §6.5 – 6.6 Adapted from slides by Mary Jane Irwin, Penn State 2 Load Use Hazards Require Stalls No forwarding can help Requires a Hazard Detection Unit – Detects hazards – Inserts pipeline bubble ALU IM Reg DM Reg lw $4, 16($5) add $8, $4 , $7 ALU IM Reg DM Reg nop 3 Stalling The Pipeline Stalls occur by inserting pipeline bubble – Hold some state registers (stage repeats) – Allow other stages to continue processing ALU IM Reg DM Reg lw $4, 16($5) add $8, $4 , $7 ALU IM Reg DM Reg add becomes nop ALU IM Reg DM Reg Repeats 4 Stalling The Pipeline Load Use Hazard code lw $4, 16($5) add $8, $4, $7 ALU IM Reg DM Reg add lw
Background image of page 1

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

View Full Document Right Arrow Icon
2 5 Stalling The Pipeline Load Use Hazard code lw $4, 16($5) add $8, $4, $7 ALU IM Reg DM Reg add lw Hazard Detected 6 Stalling The Pipeline Load Use Hazard code lw $4, 16($5) add $8, $4, $7 IM Reg DM Reg add lw nop Bubble Inserted Stage Repeated 7 Stalling The Pipeline Load Use Hazard code lw $4, 16($5) add $8, $4, $7 ALU IM Reg Reg add lw nop Data Forwarded 8 Stalling The Pipeline Load Use Hazard code lw $4, 16($5) add $8, $4, $7 ALU IM Reg DM add nop No Register Written
Background image of page 2
3 9 How To Stall The Pipeline Two ways to stall the pipeline – Set control signals to safe values – Change instruction Set control signals – All control signals become 0 – Only MemWrite and RegWrite need to be 0 Change the instruction – Make destination register $0 – MIPS nop = 0x00000000 ( sll $0, $0, 0 ) 10 How To Stall The Pipeline Read Address IM PC Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 IF/ID ID/EX Control 11
Background image of page 3

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

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

{[ snackBarMessage ]}