{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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
Image of page 1

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

View Full Document Right 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 written. 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 A B 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 written 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…
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 A B Y 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 0 1 XP WASEL 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 pretty 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) ???
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern