lect6 -datahazards

lect6 -datahazards - Dealing With Data Hazards In Software...

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

View Full Document Right Arrow Icon
CSE 141 Dean Tullsen Pipeline Data Hazards Warning, warning, warning! CSE 141 Dean Tullsen Dealing With Data Hazards In Software In Hardware Data Hazards are caused by instruction dependences . For example, the add is data-dependent on the subtract: subi $5, $4, #45 add $8, $5, $2 Data Hazards are caused by instruction dependences . For example, the add is data-dependent on the subtract: subi $5, $4, #45 add $8, $5, $2 CSE 141 Dean Tullsen Dealing with Data Hazards in Software IM Reg ALU DM Reg IM Reg DM IM Reg DM Reg IM Reg DM Reg IM Reg DM Reg CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 sub $2 , $1, $3 and $12, $2 , $5 nop nop nop CSE 141 Dean Tullsen How Many No-ops? sub $2, $1,$3 and $4, $2,$5 or $8, $2,$6 add $9, $4,$2 slt $1, $6,$7
Background image of page 1

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

View Full DocumentRight Arrow Icon
CSE 141 Dean Tullsen Are No-ops Really Necessary? sub $2, $1,$3 and $4, $2,$5 or $8, $3,$6 add $9, $2,$8 slt $1, $6,$7 CSE 141 Dean Tullsen Dealing with Data Hazards in Hardware Part II-Pipeline Stalls sub $2 , $1, $3 and $12, $2 , $5 or $13, $6, $2 add $14, $2 , $2 sw $15, 100( $2 ) IM IM Reg DM Reg CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 Bubble Bubble Bubble Reg DM Reg IM Reg DM Reg IM Reg DM IM Reg CSE 141 Dean Tullsen Pipeline Stalls sub $2, $1, $3 add $12, $3, $5 or $13, $6, $2 add $14, $12, $2 sw $14, 100($2) IM Reg DM Reg CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 IF ID EX M WB IF ID EX M WB CSE 141 Dean Tullsen Pipeline Stalls To insure proper pipeline execution in light of register dependences, we must: the hazard the pipeline
Background image of page 2
CSE 141 Dean Tullsen Knowing When to Stall IM Reg ALU DM Reg IM Reg DM IM Reg DM Reg IM Reg DM Reg IM Reg DM Reg CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 6 types of data hazards – two reg reads * 3 reg writes CSE 141 Dean Tullsen The Pipeline PC Instruction& memory Address Instruction Instruction& [20–16] MemtoReg ALUOp Branch RegDst ALUSrc 4 16 32 Instruction& [15–0] 0 0 Registers Write& register Write& data Read& data 1 Read& data 2 Read& register 1 Read& register 2 Sign& extend M& u& x 1 Write& data Read& data M& u& x 1 ALU& control RegWrite MemRead Instruction& [15–11] 6 IF/ID ID/EX EX/MEM MEM/WB MemWrite Address
Background image of page 3

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

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

Page1 / 7

lect6 -datahazards - Dealing With Data Hazards In Software...

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

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