370L18 - EECS/CS 370 Pipeline Data Hazards Lecture 18 Next...

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

View Full Document Right Arrow Icon
EECS/CS 370 Pipeline Data Hazards Lecture 18
Background image of page 1

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

View Full DocumentRight Arrow Icon
2/38 Next four lectures on pipelining Today: Data hazards What are they? How do you detect them? How do you deal with them? Control hazards Other issues: exceptions, performance Exam #2
Background image of page 2
3/38 PC Inst mem Register file M U X A L U M U X 1 Data memory + + M U X IF/ ID ID/ EX EX/ Mem Mem/ WB M U X Bits 0-2 Bits 16-18 op dest offset valB valA PC+1 PC+1 target ALU result op dest valB op dest ALU result mdata eq? instruction 0 R2 R3 R4 R5 R1 R6 R0 R7 regA regB Bits 22-24 data dest
Background image of page 3

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

View Full DocumentRight Arrow Icon
4/38 PC Inst mem Register file M U X A L U M U X 1 Data memory + + M U X IF/ ID ID/ EX EX/ Mem Mem/ WB M U X op dest offset valB valA PC+1 PC+1 target ALU result op dest valB op dest ALU result mdata eq? instruction 0 R2 R3 R4 R5 R1 R6 R0 R7 regA regB data dest
Background image of page 4
5/38 PC Inst mem Register file M U X A L U M U X 1 Data memory + + M U X IF/ ID ID/ EX EX/ Mem Mem/ WB M U X op offset valB valA PC+1 PC+1 target ALU result op valB op ALU result mdata eq? instruction 0 R2 R3 R4 R5 R1 R6 R0 R7 regA regB fwd fwd fwd data
Background image of page 5

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

View Full DocumentRight Arrow Icon
6/38 Pipeline function for ADD Fetch: read instruction from memory Decode: read source operands from reg Execute: calculate sum Memory: Pass results to next stage Writeback: write sum into register file
Background image of page 6
7/38 Data Hazards add 1 2 3 nand 3 4 5 time fetch decode execute memory writeback fetch decode execute memory writeback add nand If not careful, you will read the wrong value of R3
Background image of page 7

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

View Full DocumentRight Arrow Icon
8/38 Three approaches to handling data hazards Avoidance Make sure there are no hazards in the code Detect and Stall If hazards exist, stall the processor until they go away. Detect and Forward If hazards exist, fix up the pipeline to get the correct value (if possible)
Background image of page 8
Handling data hazards: avoid all hazards Assume the programmer (or the compiler) knows about the processor implementation. Make sure no hazards exist.
Background image of page 9

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

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

This note was uploaded on 04/13/2010 for the course CSE 245 taught by Professor Dawan during the Spring '10 term at Punjab Engineering College.

Page1 / 38

370L18 - EECS/CS 370 Pipeline Data Hazards Lecture 18 Next...

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

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