L10+Control+Hazards - Hazards& Exceptions – Control...

Info iconThis preview shows pages 1–9. 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

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: Hazards & Exceptions – Control Hazards Topic 10 Control Hazards ¡ Branch determines flow of control ¡ Fetching next instruction depends on branch outcome ¡ Pipeline can’t always fetch correct instruction (Branch Hazard) ¡ Still working on ID stage of branch ¡ In MIPS pipeline ¡ Need to compare registers and compute target early in the pipeline ¡ Add hardware to do it in ID stage ¡ Originally Branch Hazards Branch Hazards ¡ If branch outcome determined in MEM ¡ Stall branch or take penalty of wrong branch PC Stall or flush 3 instructions Branch Hazard Resolutions ¡ Stall on branch ¡ Always assume branch not taken ¡ Branch prediction ¡ Delayed Branch Branch Hazard Resolutions ¡ Stall on branch ¡ Wait until branch outcome determined before fetching next instruction Worst case should be 3 stalls Branch Hazard Resolution ¡ Always assume branch not taken ¡ Penalty will be to flush 3 instructions ¡ This penalty can be reduced to 1 instruction Reducing Branch Penalty ¡ Move hardware for determining PC to ID stage ¡ Target address calculation ¡ Register comparator ¡ For taken branch, penalty reduced to 1 instruction ¡ Example: branch taken 36:...
View Full Document

{[ snackBarMessage ]}

Page1 / 25

L10+Control+Hazards - Hazards& Exceptions – Control...

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

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