ele74908controlhazards - HU L08 Control Hazards.1 1 ELE 749...

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 DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: HU L08 Control Hazards.1 1 ELE 749 Lecture 08: Containing Control Hazards Ali Ziya Alkar ELE749 Computer Organization and Design [Adapted from Computer Organization and Design , Patterson & Hennessy, © 2005, UCB] HU L08 Control Hazards.2 2 Review: Datapath with Data Hazard Control Read Address Instruction Memory Add PC 4 Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 16 32 ALU Shift left 2 Add Data Memory Address Write Data Read Data IF/ID Sign Extend ID/EX EX/MEM MEM/WB Control ALU cntrl Branch PCSrc Forward Unit Hazard Unit 1 ID/EX.RegisterRt ID/EX.MemRead P C . W r i t e I F / I D . W r i t e HU L08 Control Hazards.3 3 Control Hazards ¡ When the flow of instruction addresses is not sequential (i.e., PC = PC + 4); incurred by change of flow instructions z Conditional branches ( beq , bne ) z Unconditional branches ( j, jal, jr ) z Exceptions ¡ Possible approaches z Stall (impacts CPI) z Move decision point as early in the pipeline as possible, thereby reducing the number of stall cycles z Delay decision (requires compiler support) z Predict and hope for the best ! ¡ Control hazards occur less frequently than data hazards, but there is nothing as effective against control hazards as forwarding is for data hazards HU L08 Control Hazards.4 4 Datapath Branch and Jump Hardware ID/EX Read Address Instruction Memory Add PC 4 Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 16 32 ALU Data Memory Address Write Data Read Data IF/ID Sign Extend EX/MEM MEM/WB Control ALU cntrl Forward Unit HU L08 Control Hazards.5 5 Datapath Branch and Jump Hardware ID/EX Read Address Instruction Memory Add PC 4 Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 16 32 ALU Data Memory Address Write Data Read Data IF/ID Sign Extend EX/MEM MEM/WB Control ALU cntrl Forward Unit Branch PCSrc Shift left 2 Add Shift left 2 Jump PC+4[31-28] HU L08 Control Hazards.6 6 Jumps Incur One Stall ¡ Jumps not decoded until ID, so one flush is needed flush I n s t r. O r d e r j j target A L U IM Reg DM Reg A L U IM Reg DM Reg Fix jump hazard by waiting – stall – but affects CPI A L U IM Reg DM Reg ¡ Fortunately, jumps are very infrequent – only 3% of the SPECint instruction mix HU L08 Control Hazards.7 7 Supporting ID Stage Jumps ID/EX Read Address Instruction Memory Add PC 4 Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 16 32 ALU Data Memory Address Write Data Read Data IF/ID Sign Extend EX/MEM MEM/WB Control ALU cntrl Forward Unit Branch PCSrc Shift left 2 Add Shift left 2 Jump PC+4[31-28] HU L08 Control Hazards.8 8 Two “Types” of Stalls ¡ Noop instruction (or bubble) inserted between two instructions in the pipeline (as done for load-use situations) z Keep the instructions earlier in the pipeline (later in the code) from progressing down the pipeline for a cycle (“bounce” them in place with write control signals) z Insert noop...
View Full Document

This note was uploaded on 05/25/2011 for the course ELECTRONIC 749 taught by Professor Aliziyaalkar during the Spring '11 term at Hacettepe Üniversitesi.

Page1 / 35

ele74908controlhazards - HU L08 Control Hazards.1 1 ELE 749...

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