MIT6_004s09_lec23

MIT6_004s09_lec23 - MIT OpenCourseWare http:/ocw.mit.edu...

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

View Full Document Right Arrow Icon
MIT OpenCourseWare http://ocw.mit.edu For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms . 6.004 Computation Structures Spring 2009
Background image of page 1

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

View Full DocumentRight Arrow Icon
L23 – Pipeline Issues 1 6.004 – Spring 2009 5/5/09 Pipeline Issues This pipeline stuff makes my head hurt! Maybe it’s that dumb hat Home Stretch: Lab #8 due Thursday 5/7 ; Quiz 5 FRIDAY 5/8 ! modified 5/4/09 10:06 L23 – Pipeline Issues 2 6.004 – Spring 2009 5/5/09 Recalling Data Hazards IF RF ALU WB i i+1 i+2 i+3 i+4 i+5 i+6 ADD CMP MUL SUB ADD CMP MUL SUB ADD CMP MUL SUB ADD CMP MUL SUB ADD(r1, r2, r3) CMPLEC(r3, 100, r0) MULC(r3, 100, r4) SUB(r0, r4, r5) PROBLEM: Subsequent instructions can reference the contents of a register well before the pipeline stage where the register is wri±en. SOLUTION #2: Add special hardware to maintain the sequential execution semantics of the ISA. SOLUTION #1: Deal with it in SOFTWARE; expose the pipeline for all to see. L23 – Pipeline Issues 3 6.004 – Spring 2009 5/5/09 Bypass Paths Register File WA WD WE ALU AB Y IR WB IR ALU Register File RA1 RA2 RD1 RD2 IR RF Y WB B A Bypass muxes MULC(r3,100,r4) SUB(r0,r4,r5) CMPLEC(r3,100,r0) Add special data paths, called BYPASSES, that route the results of the ALU and WB stages to the RF stage, thus substituting the register’s old contents with a value that will be wri±en to that register at some point in the future. Detection of these cases has to be incorporated into the decoding logic of the RF stage, which basically looks at the instructions in the ALU and WB stage to see if their destination register matches a source register reference. IF RF ALU WB But there are some problems that BYPASSING CAN’T FIX! L23 – Pipeline Issues 4 6.004 – Spring 2009 5/5/09 Load Hazards Consider LOADS: Can we fix all these problems using bypass paths? LD ADD XOR LD ADD XOR LD ADD XOR LD ADD XOR LD(r1, 0, r4) ADD(r4, r1, r5) XOR(r3, r4, r6) The hazard between the XOR and the LD can be addressed by our established bypass paths…
Background image of page 2
L23 – Pipeline Issues 5 6.004 – Spring 2009 5/5/09 Load Hazard (easy) (NB: SAME RF AS ABOVE!) +4 PC RF PC MEM PC ALU Rb: <15:11> Ra <20:16> RA2SEL Rc <25:21> Instruction Memory A D IR RF Instruction Fetch + C: <15:0> << 2 sign-extended Register File WA WD WE WDSEL 0 1 2 IR MEM D MEM Y MEM D ALU B IR ALU A 0 1 BSEL Z ALU AB Y RD Data Memory WD Adr R/W Register File ALU Write Back ASEL 0 1 Rc <25:21> <PC>+C PCSEL JT 0 1 2 3 4 XAdr ILL OP PC IF 00 01 XP WASEL WA Register File RA1 RA2 RD1 RD2 JT C: <15:0> sign-extended ALUFN WERF XOR(r3, r4, r6) LD(r1, 0, r4) The XOR operand r4 can simply be bypassed from the output of the memory in the WB stage to the RF stage… by our normal bypass path. L23 – Pipeline Issues 6 6.004 – Spring 2009 5/5/09 Structural Data Hazard The XOR hazard is pre±y easy, but… LD ADD XOR LD ADD XOR LD ADD XOR LD ADD XOR LD(r1, 0, r4) ADD(r1, r4, r5) XOR(r3, r4, r6) ???
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.

This note was uploaded on 11/07/2011 for the course COMPUTER S 6.004 taught by Professor Staff during the Spring '09 term at MIT.

Page1 / 8

MIT6_004s09_lec23 - MIT OpenCourseWare http:/ocw.mit.edu...

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