Pipeline Issues. This pipeline stuff makes my head hurt! Maybe it s that dumb hat. L17 Pipeline Issues Fall /5/02
|
|
- Arnold Lamb
- 6 years ago
- Views:
Transcription
1 Pipeline Issues This pipeline stuff makes my head hurt! Maybe it s that dumb hat L17 Pipeline Issues 1
2 Recalling Data Hazards PROLEM: Subsequent instructions can reference the contents of a register well before the pipeline stage where the register is written. DD(r1, r2, r3) CMPLEC(r3, 100, r0) MULC(r3, 100, r4) SU(r0, r4, r5) IF RF LU W SOLUTION #1: see. i i+1 i+2 i+3 i+4 i+5 i+6 DD CMP MUL SU DD CMP MUL SU DD CMP MUL SU DD CMP MUL SU Deal with it in SOFTWRE; expose the pipeline for all to SOLUTION #2: dd special hardware to maintain the sequential execution semantics of the IS. L17 Pipeline Issues 2
3 IF IR RF RF SU(r0,r4,r5) LU IR LU MULC(r3,100,r4) W IR W CMPLEC(r3,100,r0) W ypass Paths LU R1 RD1 ut there are some problems that YPSSING CN T FIX! Y Y W WD WE R2 RD2 ypass muxes dd special cheat paths, called YPSSES, that route the results of the LU and W 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 LU and W stage to see if their destination register matches a source register reference. L17 Pipeline Issues 3
4 Load Hazards Consider LODS: Can we fix all these problems using bypass paths? LD(r1, 0, r4) DD(r4, r1, r5) XOR(r3, r4, r6) IF RF LU W i i+1 i+2 i+3 i+4 i+5 i+6 LD DD XOR LD DD XOR LD DD XOR LD DD XOR The hazard between the XOR and the LD can be addressed by our established bypass paths L17 Pipeline Issues 4
5 PCSEL ILL Xdr OP 4 3 JT PC IF 00 Load Hazard (easy) +4 PC RF D IR RF Fetch Ra <20:16> Rb: <15:11> Rc <25:21> R2SEL XOR(r3, r4, r6) <PC>+C + C: <15:0> << 2 sign-extended Z R1 W RD1 JT C: <15:0> sign-extended R2 RD2 LD(r1, 0, r4) PC LU PC MEM IR LU IR MEM SEL 1 0 LUFN LU Y Y MEM 1 0 SEL dr D LU D MEM WD R/W Data RD LU The XOR operand r4 can simply be bypassed from the output of the memory in the W stage to the RF stage by our normal bypass path. (N: SME RF S OVE!) XP Rc <25:21> WSEL 0 1 W WD WE WDSEL WERF Write ack L17 Pipeline Issues 5
6 Structural Data Hazard The XOR hazard is pretty easy, but LD(r1, 0, r4) DD(r1, r4, r5) XOR(r3, r4, r6) IF RF LU W i i+1 i+2 i+3 i+4 i+5 i+6 LD DD XOR LD DD XOR??? LD DD XOR LD DD XOR How do we fix this one? In a 4-stage pipeline, for a LD instruction fetched during clock i, the data from memory isn t returned from memory until late into cycle i+3. ypassing can fix the XOR but not DD! L17 Pipeline Issues 6
7 PCSEL ILL Xdr OP 4 3 JT PC IF 00 Load Hazard (hard) +4 PC RF D IR RF Fetch Ra <20:16> Rb: <15:11> Rc <25:21> R2SEL DD(r4, r1, r5) LD(r1, 0, r4) PC LU <PC>+C + C: <15:0> << 2 sign-extended IR LU Z SEL 1 0 LUFN R1 W RD1 JT C: <15:0> sign-extended LU Y 1 0 SEL R2 RD2 D LU LU The r4 operand to the DD instruction hasn t yet been fetched from memory. PC MEM IR MEM Y MEM dr D MEM WD R/W Data RD It exists NOWHERE on our data paths we can t solve this problem by bypassing! (N: SME RF S OVE!) XP Rc <25:21> WSEL 0 1 W WD WE WDSEL WERF Write ack L17 Pipeline Issues 7
8 Load Delay ypassing can t fix the problem with DD since the data simply isn t available! We have to add some pipeline interlock hardware to stall DD s execution. LD(r1, 0, r4) DD(r1, r4, r5) XOR(r3, r4, r6) IF RF LU W i i+1 i+2 i+3 i+4 i+5 i+6 LD DD XOR XOR LD DD DD XOR LD DD XOR LD DD XOR If the compiler knows about a machine s load delay, it can often rearrange code sequences to eliminate such hazards. Many compilers provide machine-specific instruction scheduling. L17 Pipeline Issues 8
9 Timing & Pipelining ut, but, what about FSTER processors? FCT: Processors have become very fast relative to memories! nd this gap continues to grow Do we just increase the clock period to accommodate this bottleneck component? LTERNTIVE: Longer pipelines. 1. dd MEMORY WIT stages between STRT of read operation & return of data. 2. uild pipelined memories, so that multiple (say, N) memory transactions can be in progress at once. These steps add load delay slots; hence 3. Stall pipeline on unbypassable load delays. 4-Stage pipeline requires RED access in less than one clock. 5-Stage pipeline would allow nearly two clocks... L17 Pipeline Issues 9
10 Xdr ILL OP JT PCSEL PC IF PC RF D IR RF Omits some detail NO bypass or interlock logic Fetch 5-stage Pipeline Ra <20:16> Rb: <15:11> Rc <25:21> R2SEL + C: <15:0> << 2 sign-extended <PC RF >+4+C*4 Z R1 W RD1 JT C: <15:0> sign-extended R2 RD2 SEL SEL PC LU IR LU D LU LUFN LU Y LU PC MEM IR MEM Y MEM dr D MEM WD R/W ddress available right after instruction enters pipe stage PC W IR W Y W Data almost 2 clock cycles WSEL Rc <25:21> 0 1 W XP WD WE WDSEL WERF RD Write ack Data needed right before rising clock edge at end of Write ack pipe stage L17 Pipeline Issues 10
11 Xdr ILL OP JT PCSEL PC IF PC RF D IR RF Omits some detail NO bypass or interlock logic Fetch 5-stage pipeline Ra <20:16> Rb: <15:11> Rc <25:21> PC LU + C: <15:0> << 2 sign-extended <PC RF >+4+C*4 IR LU Z SEL 1 0 LUFN R1 W RD1 JT C: <15:0> sign-extended LU Y 1 R2 RD2 0 SEL R2SEL D LU LU We wanted a simple, clean pipeline but added IR IF mux to annul branch-slot instructions PC MEM PC W IR MEM IR W WSEL Rc <25:21> 0 1 W XP Y MEM Y W WD WE WDSEL WERF dr D MEM WD Data RD R/W Write ack added / bypass muxes to get data before it s written to regfile added LE/muxes to freeze IF/RF stage so we can wait for LD to reach W stage L17 Pipeline Issues 11
12 RF-stage ypass Details 1, 2, 3, 4 Hum, it looks like we have a few extra inputs on that mux from LU/MEM/W RD1 RD2 from LU/MEM/W Note: Note: can can use use distributed distributed mux mux built built from from tristate tristate drivers. drivers. ypass ypass PC+4+4*SXT(C) JT Z SXT(C) 1 0 SEL 1 0 SEL D To LU We ve been a little sloppy about this detail To LU To Mem L17 Pipeline Issues 12
13 ypass Implementation from mem Part 2 of the WDSEL mux Part 1 of the WDSEL mux to regs ypass From W Y MEM ypass From MEM Y LU ypass From LU alu PC LU from regs to alu Select 0 To reduce the amount of bypass logic, the WDSEL mux has been split: choice between LU and PC+4 is made in LU stage, choice between LU/PC and MEMDT is made is W stage. L17 Pipeline Issues 13
14 ypass Logic eta ypass logic (need two copies for / data): Ra or Rb/Rc Regfile (no bypass) Rc (W)* W bypass Rc (MEM)* MEM bypass Rc (LU)* LU bypass 31 5-bit compare Select 0 * If instruction is a ST (doesn t write into regfile), set RC for LU/MEM/W to R31 L17 Pipeline Issues 14
15 Linkage Write Timing The code: ssume Reg[LP] = DD(r31, r31, LP) R(f, LP) Reg[LP] =.+4 x: SU(LP, 1, LP)... f: XOR(LP, r31, r0) OR(r31, LP, r1) DD(r31, LP, r2) i i+1 i+2 i+3 i+4 i+5 i+6 IF RF LU MEM W DD R SU XOR OR DD DD R XOR OR DD DD R XOR OR DD R XOR DD R R Decision Time DD writes R writes Can Can we we make XOR s regfile access work work by by bypassing? L17 Pipeline Issues 15
16 PCSEL STLL Xdr 4 ILL OP 3 JT PC SEL 00 R/JMP STLL +4 PC RF XOR(r28 ) PC LU PC RF +4+4*SXT(C) STLL + nnul RF, ypass D IR RF nnul IF IR LU YPSSES PC RF +4+4*SXT(C) LUFN Ra:<20:16> R1 RD1 1 0 SEL LU Rb:<15:11> JT SXT(C) Y Z R2 RD2 Rc:<25:21> 1 0 SEL, YPSS 0 1 R2SEL YPSSES D LU Fetch LU PC bypass For R/JMP, Rc value is taken from PC, not LU. So we have to add bypass paths for PC LU and PC MEM. PC MEM R(,r28) PC W, ypass IR MEM IR W Y MEM Y W, YPSS dr D MEM WD Data RD R/W PC W is already taken care of if we bypass W stage from output of WDSEL mux WDSEL Rc:<25:21>, YPSS W WD WE WERF Write ack L17 Pipeline Issues 16
17 Unused Opcode Traps IDE: TRP illegal instructions to a special routine in the Operating System, which can Interpret them in software; or Print humane error report. IMPLEMENTTION: On ad Opcode (discovered in RF Stage): Select IllOp adr as next PC nnul instruction in IF stage Substitute NE(r31,0,XP) for bad instruction - will (eventually) store PC+4 into XP... need bypass paths to make XP usable immediately by code at IllOp! User program:... D(...) Illegal instr. r:... Operating System: UUO Handler IllOp: ST(r0,...) Save a reg, LD(xp,-4,r0) Fetch bad instr... LD(...,r0) Restore regs, JMP(xp) Return to pgm. L17 Pipeline Issues 17
18 Xdr ILL OP JT PCSEL STLL Illegal Opcode Traps PC SEL 00??? STLL +4 PC RF STLL D 0 1 nnul IF IR RF Fetch D NE(,XP) PC LU PC RF +4+4*SXT(C) + NE(R31,0,XP) nnul RF, YPSS IR LU YPSSES PC RF +4+4*SXT(C) LUFN Ra:<20:16> R1 RD1 1 0 SEL LU Rb:<15:11> JT SXT(C) Y Z R2 RD2 Rc:<25:21> 1 0 SEL, YPSS 0 1 R2SEL YPSSES D LU LU ad opcode decoded in RF stage: PC address of IllOp handler nnul instruction in IF PC MEM PC W, YPSS IR MEM IR W Y MEM Y W, YPSS dr D MEM WD Data R/W Force NE(R31,0,XP) in RF stage will save PC+4 in XP when it reaches W stage RD WDSEL Rc:<25:21>, YPSS W WD WE WERF Write ack L17 Pipeline Issues 18
19 Taking Exception In general, we d like to annul LL instructions following one that causes a trap or fault: FREEZE state at time of exception, for inspection by handler code. ILLEGL INSTRUCTIONS are recognizable in RF stage of pipe; are LL faults & traps? CONSIDER: RITHMETIC EXCEPTIONS: divide by zero, etc. Caught by LU subsystem, during processing of data in LU stage MEMORY FULTS: Program reference to illegal memory location... Caught by MEMORY subsystem, during processing of address input in MEM stage L17 Pipeline Issues 19
20 PCSEL STLL Xdr 4 ILL OP 3 JT PC SEL 00 nnulment Logic +4 D STLL PC RF STLL 0 1 nnul IF IR RF Fetch Fault in??? stage: PC LU PC RF +4+4*SXT(C) + NE(R31,0,XP) nnul RF, YPSS NE(R31,0,XP) nnul LU IR LU 1 0 YPSSES PC RF +4+4*SXT(C) LUFN Ra:<20:16> R1 RD1 1 0 SEL LU Rb:<15:11> JT SXT(C) Y Z R2 RD2 Rc:<25:21> 1 0 SEL, YPSS 0 1 R2SEL YPSSES D LU LU PC address of fault handler Force NE(R31,0,XP) in??? stage will save PC+4 in XP when it reaches W stage MEM FULT PC MEM PC W, YPSS NE(R31,0,XP) nnul MEM 2 IR MEM 1 0 IR W Y MEM Y W, YPSS dr D MEM WD Data R/W nnul all following instructions (those earlier in the pipeline): called flushing the pipe RD WDSEL Rc:<25:21>, YPSS W WD WE WERF Write ack L17 Pipeline Issues 20
21 synchronous I/O Interrupts This should be easy. Take, for example, The interrupted code:... DD(...) Interrupt SU(...) Taken MUL(...) HERE XOR(...)... The interrupt handler: xh: OR(...)... JMP(xp) Suppose key struck, interrupt requested (via IRQ) during the fetch of DD. Then let s Select Xdr (handler) as next PC Leave DD in pipeline; NO annulment! Code handler to return to SU instruction. Can this work??? Let s find out L17 Pipeline Issues 21
22 synchronous Interrupt Timing IF RF LU MEM W xh:... DD(...) SU(...) MUL(...) XOR(...)... Interrupt Taken HERE OR(...) interrupt handler... JMP(xp) Interrupt Occurs PC = Xadr?? i i+1 i+2 i+3 i+4 i+5 i+6 DD OR DD OR... DD OR... DD OR... DD OR... PROLEM: When does old PC+4 get written to XP??? L17 Pipeline Issues 22
23 Making Interrupts Work lternative: When taking interrupt, NNUL instruction in IF stage... UT instead of changing it to a, change it to NE(r31,0,XP) This will cause PC+4 of annulled instruction to be written to XP! CODE HNDLER to return to Reg[XP]-4 (since the annulled instruction is never executed) IF RF LU MEM W i i+1 i+2 i+3 i+4 i+5 i+6 DD OR NE OR... NE OR... NE OR... NE OR Interrupt taken L17 Pipeline Issues 23
24 Smart Interrupt Handler The interrupted code:... Interrupt taken HERE, DD(...) DD instruction annulled SU(...) MUL(...) XOR(...)... The interrupt handler: xh: OR(...)... SUC(xp,4,xp) djust XP so we JMP(xp) return to annulled instruction (DD) L17 Pipeline Issues 24
25 PCSEL STLL STLL Xdr 4 ILL OP 3 JT 2 PC SEL PC RF PC LU PC MEM PC W 1 0 PC RF +4+4*SXT(C), YPSS, YPSS STLL + NE(R31,0,XP) nnul RF NE(R31,0,XP) nnul LU NE(R31,0,XP) nnul MEM D nnul IF PC RF +4+4*SXT(C) Rc:<25:21> Ra:<20:16> Rb:<15:11> Rc:<25:21> W WD WE WERF IR RF IR LU IR MEM IR W YPSSES NE(R31,0,XP) LUFN R1 RD1 1 0 SEL JT SXT(C) LU Y Y MEM Y W Z R2 RD2 1 0 SEL, YPSS, YPSS 0 1 WDSEL, YPSS R2SEL YPSSES dr 5-stage Pipeline: D LU D MEM WD Fetch LU Data RD R/W Write ack Final Version Can annul instruction at each stage Can force instruction to NE(R31,0,XP) in each stage will save PC+4 in XP when it reaches W stage Can stall IF and RF stages while waiting for LD result to reach W Can bypass results from LU, MEM and W back to RF L17 Pipeline Issues 25
26 Pipeline Review Simple unpipelined eta: 1 cycle/instruction long cycle time: mem+regs+alu+mem 2-Stage pipeline: increased throughput (<2x) introduced branch delay slots Choice of executing or annulling inst. after branch 5-stage pipeline: increased throughput (3x???) branch delay slots delayed register writeback (3 cycles) dd bypass paths (10) to access correct value memory data available only in W stage Introduce s at IR LU, stall IF and RF stages until LD result ready handle RF/LU/MEM stage exceptions Save PC+4 in XP (fake a R) annul following insts. (those earlier in pipeline) implement interrupts Throw away IF inst., save PC+4 in XP, fix return extra HW due to pipelining s to hold values between stages Data bypass muxes in RF stage Inst. muxes for rewriting code to annul or save PC L17 Pipeline Issues 26
27 RISC = Simplicity??? The P.T. arnum World s Tallest Dwarf Competition World s Most Complex RISC? VLIWs,? Super-Scalars ddressing features, eg index registers Pipelines, ypasses, nnulment,,... Primitive Machines: direct implementations Generalization of registers and operand coding RISCs Complex instructions, addressing modes L17 Pipeline Issues 27
CPU Pipelining Issues
Spring 25 3/24 Lecture page 1 CPU Pipelining Issues What have you been beating your head against? This pipe stuff makes my head hurt! L17 Pipeline Issues 1 :J: T REG IRREG 4-Stage minimips
More informationPipelining the Beta. I don t think they mean the fish...
Pipelining the Beta bet ta ('be-t&) n. ny of various species of small, brightly colored, long-finned freshwater fishes of the genus Betta, found in southeast sia. be ta ( b-t&, be-) n. 1. The second letter
More informationMore CPU Pipelining Issues
More CPU Pipelining Issues What have you been beating your head against? This pipe stuff makes my head hurt! Important Stuff: Study Session for Problem Set 5 tomorrow night (11/11) 5:30-9:00pm Study Session
More informationCPU Pipelining Issues
CPU Pipelining Issues What have you been beating your head against? This pipe stuff makes my head hurt! Finishing up Chapter 6 L20 Pipeline Issues 1 Structural Data Hazard Consider LOADS: Can we fix all
More information6.004 Computation Structures Spring 2009
MIT OpenCourseWare http://ocw.mit.edu 6.4 Computation Structures Spring 29 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Pipelining the eta bet ta ('be-t&)
More informationBuilding the Beta. Handouts: Lecture Slides, PS 7, Lab 6. I wonder where this goes? Spring /5/01. L15- Building the Beta 1 A B
Building the Beta I wonder where this goes? B LU Beta Kit 0 1 Instruction Handouts: Lecture Slides, PS 7, Lab 6 L15- Building the Beta 1 CPU esign Tradeoffs Maximum Performance: measured by the numbers
More informationCPU Design Tradeoffs. Building the Beta. Performance Measure. The Beta ISA MIPS = C.P.I. Clock Frequency (MHz) PUSHING PERFORMANCE...
uilding the eta CPU esign Tradeoffs I wonder where this goes? Maximum Performance: measured by the numbers of instructions executed per second Minimum Cost : measured by the size of the circuit. Lab #5
More information13. Building the Beta
3. uilding the eta 6.4x Computation Structures Part 2 Computer rchitecture Copyright 25 MIT EECS 6.4 Computation Structures L3: uilding the eta, Slide # CPU esign Tradeoffs Maximum Performance: measured
More informationL19 Pipelined CPU I 1. Where are the registers? Study Chapter 6 of Text. Pipelined CPUs. Comp 411 Fall /07/07
Pipelined CPUs Where are the registers? Study Chapter 6 of Text L19 Pipelined CPU I 1 Review of CPU Performance MIPS = Millions of Instructions/Second MIPS = Freq CPI Freq = Clock Frequency, MHz CPI =
More informationPipelined CPUs. Study Chapter 4 of Text. Where are the registers?
Pipelined CPUs Where are the registers? Study Chapter 4 of Text Second Quiz on Friday. Covers lectures 8-14. Open book, open note, no computers or calculators. L17 Pipelined CPU I 1 Review of CPU Performance
More informationISTD 103 Computation Structures Prof. Tomas Lozano-Perez
ISTD 103 Computation Structures Prof. Tomas Lozano-Perez This file and its contents are provided under license from MIT and the named authors, under the terms of the MIT-SUTD Collaboration. The following
More informationD. Suppose the following code were running on a Beta implementation with a 5 -stage pipeline, full bypassing and 1 branch delay slot with annulment.
Page 1 of 18 Pipelined Beta indicates problems that have been selected for discussion in section, time permitting. Problem 1. Beta quickies. A. In a 5 -stage pipelined Beta, when does the hardware use
More informationCPU Pipelining Issues
CPU Pipelining Issues What have you been beating your head against? This pipe stuff makes my head hurt! L17 Pipeline Issues & Memory 1 Pipelining Improve performance by increasing instruction throughput
More informationEITF20: Computer Architecture Part2.2.1: Pipeline-1
EITF20: Computer Architecture Part2.2.1: Pipeline-1 Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Pipelining Harzards Structural hazards Data hazards Control hazards Implementation issues Multi-cycle
More informationPipeline Hazards. Midterm #2 on 11/29 5th and final problem set on 11/22 9th and final lab on 12/1. https://goo.gl/forms/hkuvwlhvuyzvdat42
Pipeline Hazards https://goo.gl/forms/hkuvwlhvuyzvdat42 Midterm #2 on 11/29 5th and final problem set on 11/22 9th and final lab on 12/1 1 ARM 3-stage pipeline Fetch,, and Execute Stages Instructions are
More informationData Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard
Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard Consider: a = b + c; d = e - f; Assume loads have a latency of one clock cycle:
More informationEITF20: Computer Architecture Part2.2.1: Pipeline-1
EITF20: Computer Architecture Part2.2.1: Pipeline-1 Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Pipelining Harzards Structural hazards Data hazards Control hazards Implementation issues Multi-cycle
More information17. Virtualizing the Processor
17. Virtualizing the Processor 6.004x Computation Structures Part 3 Computer Organization Copyright 2016 MIT EECS 6.004 Computation Structures L17: Virtualizing the Processor, Slide #1 Recap: Virtual Memory
More informationWhat is Pipelining? RISC remainder (our assumptions)
What is Pipelining? Is a key implementation techniques used to make fast CPUs Is an implementation techniques whereby multiple instructions are overlapped in execution It takes advantage of parallelism
More informationWhat is Pipelining? Time per instruction on unpipelined machine Number of pipe stages
What is Pipelining? Is a key implementation techniques used to make fast CPUs Is an implementation techniques whereby multiple instructions are overlapped in execution It takes advantage of parallelism
More informationEITF20: Computer Architecture Part2.2.1: Pipeline-1
EITF20: Computer Architecture Part2.2.1: Pipeline-1 Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Pipelining Harzards Structural hazards Data hazards Control hazards Implementation issues Multi-cycle
More informationCPE300: Digital System Architecture and Design
CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Pipelining 11142011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Review I/O Chapter 5 Overview Pipelining Pipelining
More informationPipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome
Thoai Nam Pipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome Reference: Computer Architecture: A Quantitative Approach, John L Hennessy & David a Patterson,
More informationInstruction Level Parallelism. Appendix C and Chapter 3, HP5e
Instruction Level Parallelism Appendix C and Chapter 3, HP5e Outline Pipelining, Hazards Branch prediction Static and Dynamic Scheduling Speculation Compiler techniques, VLIW Limits of ILP. Implementation
More informationPipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome
Pipeline Thoai Nam Outline Pipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome Reference: Computer Architecture: A Quantitative Approach, John L Hennessy
More informationAppendix C: Pipelining: Basic and Intermediate Concepts
Appendix C: Pipelining: Basic and Intermediate Concepts Key ideas and simple pipeline (Section C.1) Hazards (Sections C.2 and C.3) Structural hazards Data hazards Control hazards Exceptions (Section C.4)
More informationCS 152 Computer Architecture and Engineering Lecture 4 Pipelining
CS 152 Computer rchitecture and Engineering Lecture 4 Pipelining 2014-1-30 John Lazzaro (not a prof - John is always OK) T: Eric Love www-inst.eecs.berkeley.edu/~cs152/ Play: 1 otorola 68000 Next week
More informationPipelining. Principles of pipelining. Simple pipelining. Structural Hazards. Data Hazards. Control Hazards. Interrupts. Multicycle operations
Principles of pipelining Pipelining Simple pipelining Structural Hazards Data Hazards Control Hazards Interrupts Multicycle operations Pipeline clocking ECE D52 Lecture Notes: Chapter 3 1 Sequential Execution
More informationEECS Digital Design
EECS 150 -- Digital Design Lecture 11-- Processor Pipelining 2010-2-23 John Wawrzynek Today s lecture by John Lazzaro www-inst.eecs.berkeley.edu/~cs150 1 Today: Pipelining How to apply the performance
More informationInstruction Pipelining Review
Instruction Pipelining Review Instruction pipelining is CPU implementation technique where multiple operations on a number of instructions are overlapped. An instruction execution pipeline involves a number
More informationFour Steps of Speculative Tomasulo cycle 0
HW support for More ILP Hardware Speculative Execution Speculation: allow an instruction to issue that is dependent on branch, without any consequences (including exceptions) if branch is predicted incorrectly
More informationAppendix C. Instructor: Josep Torrellas CS433. Copyright Josep Torrellas 1999, 2001, 2002,
Appendix C Instructor: Josep Torrellas CS433 Copyright Josep Torrellas 1999, 2001, 2002, 2013 1 Pipelining Multiple instructions are overlapped in execution Each is in a different stage Each stage is called
More informationComputer Architecture
Lecture 3: Pipelining Iakovos Mavroidis Computer Science Department University of Crete 1 Previous Lecture Measurements and metrics : Performance, Cost, Dependability, Power Guidelines and principles in
More informationMulti-cycle Instructions in the Pipeline (Floating Point)
Lecture 6 Multi-cycle Instructions in the Pipeline (Floating Point) Introduction to instruction level parallelism Recap: Support of multi-cycle instructions in a pipeline (App A.5) Recap: Superpipelining
More informationMinimizing Data hazard Stalls by Forwarding Data Hazard Classification Data Hazards Present in Current MIPS Pipeline
Instruction Pipelining Review: MIPS In-Order Single-Issue Integer Pipeline Performance of Pipelines with Stalls Pipeline Hazards Structural hazards Data hazards Minimizing Data hazard Stalls by Forwarding
More informationPhoto David Wright STEVEN R. BAGLEY PIPELINES AND ILP
Photo David Wright https://www.flickr.com/photos/dhwright/3312563248 STEVEN R. BAGLEY PIPELINES AND ILP INTRODUCTION Been considering what makes the CPU run at a particular speed Spent the last two weeks
More informationPipeline Overview. Dr. Jiang Li. Adapted from the slides provided by the authors. Jiang Li, Ph.D. Department of Computer Science
Pipeline Overview Dr. Jiang Li Adapted from the slides provided by the authors Outline MIPS An ISA for Pipelining 5 stage pipelining Structural and Data Hazards Forwarding Branch Schemes Exceptions and
More informationAdvanced issues in pipelining
Advanced issues in pipelining 1 Outline Handling exceptions Supporting multi-cycle operations Pipeline evolution Examples of real pipelines 2 Handling exceptions 3 Exceptions In pipelined execution, one
More informationCS 110 Computer Architecture. Pipelining. Guest Lecture: Shu Yin. School of Information Science and Technology SIST
CS 110 Computer Architecture Pipelining Guest Lecture: Shu Yin http://shtech.org/courses/ca/ School of Information Science and Technology SIST ShanghaiTech University Slides based on UC Berkley's CS61C
More informationEI338: Computer Systems and Engineering (Computer Architecture & Operating Systems)
EI338: Computer Systems and Engineering (Computer Architecture & Operating Systems) Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building
More informationCOSC4201 Pipelining. Prof. Mokhtar Aboelaze York University
COSC4201 Pipelining Prof. Mokhtar Aboelaze York University 1 Instructions: Fetch Every instruction could be executed in 5 cycles, these 5 cycles are (MIPS like machine). Instruction fetch IR Mem[PC] NPC
More informationPipelining. Each step does a small fraction of the job All steps ideally operate concurrently
Pipelining Computational assembly line Each step does a small fraction of the job All steps ideally operate concurrently A form of vertical concurrency Stage/segment - responsible for 1 step 1 machine
More informationPIPELINING: HAZARDS. Mahdi Nazm Bojnordi. CS/ECE 6810: Computer Architecture. Assistant Professor School of Computing University of Utah
PIPELINING: HAZARDS Mahdi Nazm Bojnordi Assistant Professor School of Computing University of Utah CS/ECE 6810: Computer Architecture Overview Announcement Homework 1 submission deadline: Jan. 30 th This
More informationCSC 631: High-Performance Computer Architecture
CSC 631: High-Performance Computer Architecture Spring 2017 Lecture 4: Pipelining Last Time in Lecture 3 icrocoding, an effective technique to manage control unit complexity, invented in era when logic
More informationCS 61C: Great Ideas in Computer Architecture Pipelining and Hazards
CS 61C: Great Ideas in Computer Architecture Pipelining and Hazards Instructors: Vladimir Stojanovic and Nicholas Weaver http://inst.eecs.berkeley.edu/~cs61c/sp16 1 Pipelined Execution Representation Time
More informationLecture 3. Pipelining. Dr. Soner Onder CS 4431 Michigan Technological University 9/23/2009 1
Lecture 3 Pipelining Dr. Soner Onder CS 4431 Michigan Technological University 9/23/2009 1 A "Typical" RISC ISA 32-bit fixed format instruction (3 formats) 32 32-bit GPR (R0 contains zero, DP take pair)
More informationAppendix C. Abdullah Muzahid CS 5513
Appendix C Abdullah Muzahid CS 5513 1 A "Typical" RISC ISA 32-bit fixed format instruction (3 formats) 32 32-bit GPR (R0 contains zero) Single address mode for load/store: base + displacement no indirection
More informationBasic Pipelining Concepts
Basic ipelining oncepts Appendix A (recommended reading, not everything will be covered today) Basic pipelining ipeline hazards Data hazards ontrol hazards Structural hazards Multicycle operations Execution
More informationPage 1. Pipelining: Its Natural! Chapter 3. Pipelining. Pipelined Laundry Start work ASAP. Sequential Laundry A B C D. 6 PM Midnight
Pipelining: Its Natural! Chapter 3 Pipelining Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 30 minutes A B C D Dryer takes 40 minutes Folder
More informationInstruction Level Parallelism. ILP, Loop level Parallelism Dependences, Hazards Speculation, Branch prediction
Instruction Level Parallelism ILP, Loop level Parallelism Dependences, Hazards Speculation, Branch prediction Basic Block A straight line code sequence with no branches in except to the entry and no branches
More informationModern Computer Architecture
Modern Computer Architecture Lecture2 Pipelining: Basic and Intermediate Concepts Hongbin Sun 国家集成电路人才培养基地 Xi an Jiaotong University Pipelining: Its Natural! Laundry Example Ann, Brian, Cathy, Dave each
More informationA Key Theme of CIS 371: Parallelism. CIS 371 Computer Organization and Design. Readings. This Unit: (In-Order) Superscalar Pipelines
A Key Theme of CIS 371: arallelism CIS 371 Computer Organization and Design Unit 10: Superscalar ipelines reviously: pipeline-level parallelism Work on execute of one instruction in parallel with decode
More informationCS 61C: Great Ideas in Computer Architecture. Lecture 13: Pipelining. Krste Asanović & Randy Katz
CS 61C: Great Ideas in Computer Architecture Lecture 13: Pipelining Krste Asanović & Randy Katz http://inst.eecs.berkeley.edu/~cs61c/fa17 RISC-V Pipeline Pipeline Control Hazards Structural Data R-type
More informationAdvanced Parallel Architecture Lessons 5 and 6. Annalisa Massini /2017
Advanced Parallel Architecture Lessons 5 and 6 Annalisa Massini - Pipelining Hennessy, Patterson Computer architecture A quantitive approach Appendix C Sections C.1, C.2 Pipelining Pipelining is an implementation
More informationPipeline Review. Review
Pipeline Review Review Covered in EECS2021 (was CSE2021) Just a reminder of pipeline and hazards If you need more details, review 2021 materials 1 The basic MIPS Processor Pipeline 2 Performance of pipelining
More informationCISC 662 Graduate Computer Architecture Lecture 5 - Pipeline. Pipelining. Pipelining the Idea. Similar to assembly line in a factory:
CISC 662 Graduate Computer rchitecture Lecture 5 - Pipeline ichela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer rchitecture,
More informationCS 152 Computer Architecture and Engineering
CS 152 Computer rchitecture and Engineering Lecture 10 Pipelining III 2005-2-17 John Lazzaro (www.cs.berkeley.edu/~lazzaro) Ts: Ted Hong and David arquardt www-inst.eecs.berkeley.edu/~cs152/ Last time:
More informationThis course provides an overview of the SH-2 32-bit RISC CPU core used in the popular SH-2 series microcontrollers
Course Introduction Purpose: This course provides an overview of the SH-2 32-bit RISC CPU core used in the popular SH-2 series microcontrollers Objectives: Learn about error detection and address errors
More informationBackground: Pipelining Basics. Instruction Scheduling. Pipelining Details. Idealized Instruction Data-Path. Last week Register allocation
Instruction Scheduling Last week Register allocation Background: Pipelining Basics Idea Begin executing an instruction before completing the previous one Today Instruction scheduling The problem: Pipelined
More informationReview: Pipelining. Key to pipelining: smooth flow Making all instructions the same length can increase performance!
Review: Pipelining CS152 Computer Architecture and Engineering Lecture 15 Advanced pipelining/compiler Scheduling October 24, 2001 John Kubiatowicz (http.cs.berkeley.edu/~kubitron) lecture slides: http://www-inst.eecs.berkeley.edu/~cs152/
More informationLearning Outcomes. Spiral 3-3. Sorting: Software Implementation REVIEW
3-3. Learning Outcomes 3-3. Spiral 3-3 Single Cycle CPU I understand how the single-cycle CPU datapath supports each type of instruction I understand why each mux is needed to select appropriate inputs
More informationPipelining. Principles of pipelining. Simple pipelining. Structural Hazards. Data Hazards. Control Hazards. Interrupts. Multicycle operations
Principles of pipelining Pipelining Simple pipelining Structural Hazards Data Hazards Control Hazards Interrupts Multicycle operations Pipeline clocking ECE D52 Lecture Notes: Chapter 3 1 Sequential Execution
More informationstructural RTL for mov ra, rb Answer:- (Page 164) Virtualians Social Network Prepared by: Irfan Khan
Solved Subjective Midterm Papers For Preparation of Midterm Exam Two approaches for control unit. Answer:- (Page 150) Additionally, there are two different approaches to the control unit design; it can
More informationANEXA la Cursul CN2_2 Procesorul RISC (Beta, fara banda de asamblare) (
ANEXA la Cursul CN2_2 Procesorul RISC (Beta, fara banda de asamblare) (http://6004.csail.mit.edu/) 1 2 3 // Beta PC logic module pc(clk,reset,pcsel,offset,jump_addr,branch_addr,pc,pc_plus_4); input clk;
More informationLecture 7: Pipelining Contd. More pipelining complications: Interrupts and Exceptions
Lecture 7: Pipelining Contd. Kunle Olukotun Gates 302 kunle@ogun.stanford.edu http://www-leland.stanford.edu/class/ee282h/ 1 More pipelining complications: Interrupts and Exceptions Hard to handle in pipelined
More informationPipelined Processors. Ideal Pipelining. Example: FP Multiplier. 55:132/22C:160 Spring Jon Kuhl 1
55:3/C:60 Spring 00 Pipelined Design Motivation: Increase processor throughput with modest increase in hardware. Bandwidth or Throughput = Performance Pipelined Processors Chapter Bandwidth (BW) = no.
More informationComputer Systems Architecture I. CSE 560M Lecture 5 Prof. Patrick Crowley
Computer Systems Architecture I CSE 560M Lecture 5 Prof. Patrick Crowley Plan for Today Note HW1 was assigned Monday Commentary was due today Questions Pipelining discussion II 2 Course Tip Question 1:
More informationChapter 5 (a) Overview
Chapter 5 (a) Overview (a) The principles of pipelining (a) A pipelined design of SRC (b) Pipeline hazards (b) Instruction-level parallelism (ILP) Superscalar processors Very Long Instruction Word (VLIW)
More informationUnit 8: Superscalar Pipelines
A Key Theme: arallelism reviously: pipeline-level parallelism Work on execute of one instruction in parallel with decode of next CIS 501: Computer Architecture Unit 8: Superscalar ipelines Slides'developed'by'Milo'Mar0n'&'Amir'Roth'at'the'University'of'ennsylvania'
More informationTECH. CH14 Instruction Level Parallelism and Superscalar Processors. What is Superscalar? Why Superscalar? General Superscalar Organization
CH14 Instruction Level Parallelism and Superscalar Processors Decode and issue more and one instruction at a time Executing more than one instruction at a time More than one Execution Unit What is Superscalar?
More informationHardware Description Languages. Hardware Description Languages. Hardware Description Languages. Digital Design Using Verilog
4 3 2 0 + Z 0 If (done) $finish; Digital Design Using Verilog Hardware Description Languages always @(posedge clk) PCSEL Xdr OP ILL JT PC 00 +4 Instruction Memory D Ra: Rb: Rc: 0 R2SEL
More informationLecture 19: Instruction Level Parallelism
Lecture 19: Instruction Level Parallelism Administrative: Homework #5 due Homework #6 handed out today Last Time: DRAM organization and implementation Today Static and Dynamic ILP Instruction windows Register
More informationCISC 662 Graduate Computer Architecture Lecture 5 - Pipeline Pipelining
CISC 662 Graduate Computer rchitecture Lecture 5 - Pipeline Pipelining ichela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer
More informationComputer Architecture. Lecture 6.1: Fundamentals of
CS3350B Computer Architecture Winter 2015 Lecture 6.1: Fundamentals of Instructional Level Parallelism Marc Moreno Maza www.csd.uwo.ca/courses/cs3350b [Adapted from lectures on Computer Organization and
More informationBasic Instruction Timings. Pipelining 1. How long would it take to execute the following sequence of instructions?
Basic Instruction Timings Pipelining 1 Making some assumptions regarding the operation times for some of the basic hardware units in our datapath, we have the following timings: Instruction class Instruction
More informationThe Big Picture Problem Focus S re r g X r eg A d, M lt2 Sub u, Shi h ft Mac2 M l u t l 1 Mac1 Mac Performance Focus Gate Source Drain BOX
Appendix A - Pipelining 1 The Big Picture SPEC f2() { f3(s2, &j, &i); *s2->p = 10; i = *s2->q + i; } Requirements Algorithms Prog. Lang./OS ISA f1 f2 f5 f3 s q p fp j f3 f4 i1: ld r1, b i2: ld r2,
More informationECE/CS 552: Pipeline Hazards
ECE/CS 552: Pipeline Hazards Prof. Mikko Lipasti Lecture notes based in part on slides created by Mark Hill, David Wood, Guri Sohi, John Shen and Jim Smith Pipeline Hazards Forecast Program Dependences
More informationAnnouncements. ECE4750/CS4420 Computer Architecture L11: Speculative Execution I. Edward Suh Computer Systems Laboratory
ECE4750/CS4420 Computer Architecture L11: Speculative Execution I Edward Suh Computer Systems Laboratory suh@csl.cornell.edu Announcements Lab3 due today 2 1 Overview Branch penalties limit performance
More informationPipelining. Maurizio Palesi
* Pipelining * Adapted from David A. Patterson s CS252 lecture slides, http://www.cs.berkeley/~pattrsn/252s98/index.html Copyright 1998 UCB 1 References John L. Hennessy and David A. Patterson, Computer
More informationArchitectures & instruction sets R_B_T_C_. von Neumann architecture. Computer architecture taxonomy. Assembly language.
Architectures & instruction sets Computer architecture taxonomy. Assembly language. R_B_T_C_ 1. E E C E 2. I E U W 3. I S O O 4. E P O I von Neumann architecture Memory holds data and instructions. Central
More informationCentral Processing Unit
Central Processing Unit Networks and Embedded Software Module.. by Wolfgang Neff Components () lock diagram Execution Unit Control Unit Registers rithmetic logic unit DD, SU etc. NOT, ND etc. us Interface
More informationModern Processors. RISC Architectures
Modern Processors RISC Architectures Figures used from: Manolis Katevenis, RISC Architectures, Ch. 20 in Zomaya, A.Y.H. (ed), Parallel and Distributed Computing Handbook, McGraw-Hill, 1996 RISC Characteristics
More informationOutline Review: Basic Pipeline Scheduling and Loop Unrolling Multiple Issue: Superscalar, VLIW. CPE 631 Session 19 Exploiting ILP with SW Approaches
Session xploiting ILP with SW Approaches lectrical and Computer ngineering University of Alabama in Huntsville Outline Review: Basic Pipeline Scheduling and Loop Unrolling Multiple Issue: Superscalar,
More informationLecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1
Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1 Introduction Chapter 4.1 Chapter 4.2 Review: MIPS (RISC) Design Principles Simplicity favors regularity fixed size instructions small number
More informationLoad1 no Load2 no Add1 Y Sub Reg[F2] Reg[F6] Add2 Y Add Reg[F2] Add1 Add3 no Mult1 Y Mul Reg[F2] Reg[F4] Mult2 Y Div Reg[F6] Mult1
Instruction Issue Execute Write result L.D F6, 34(R2) L.D F2, 45(R3) MUL.D F0, F2, F4 SUB.D F8, F2, F6 DIV.D F10, F0, F6 ADD.D F6, F8, F2 Name Busy Op Vj Vk Qj Qk A Load1 no Load2 no Add1 Y Sub Reg[F2]
More informationReadings. H+P Appendix A, Chapter 2.3 This will be partly review for those who took ECE 152
Readings H+P Appendix A, Chapter 2.3 This will be partly review for those who took ECE 152 Recent Research Paper The Optimal Logic Depth Per Pipeline Stage is 6 to 8 FO4 Inverter Delays, Hrishikesh et
More informationChapter 4 The Processor 1. Chapter 4B. The Processor
Chapter 4 The Processor 1 Chapter 4B The Processor Chapter 4 The Processor 2 Control Hazards Branch determines flow of control Fetching next instruction depends on branch outcome Pipeline can t always
More informationIntroduction to Pipelining. Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T.
Introduction to Pipelining Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. L15-1 Performance Measures Two metrics of interest when designing a system: 1. Latency: The delay
More informationCOSC 6385 Computer Architecture - Pipelining
COSC 6385 Computer Architecture - Pipelining Fall 2006 Some of the slides are based on a lecture by David Culler, Instruction Set Architecture Relevant features for distinguishing ISA s Internal storage
More informationSome material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier
Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier Science Cases that affect instruction execution semantics
More informationECEC 355: Pipelining
ECEC 355: Pipelining November 8, 2007 What is Pipelining Pipelining is an implementation technique whereby multiple instructions are overlapped in execution. A pipeline is similar in concept to an assembly
More informationComputer Architecture ELEC3441
Computer Architecture ELEC3441 RISC vs CISC Iron Law CPUTime = # of instruction program # of cycle instruction cycle Lecture 5 Pipelining Dr. Hayden Kwok-Hay So Department of Electrical and Electronic
More informationInstr. execution impl. view
Pipelining Sangyeun Cho Computer Science Department Instr. execution impl. view Single (long) cycle implementation Multi-cycle implementation Pipelined implementation Processing an instruction Fetch instruction
More informationCS6290 Speculation Recovery
CS6290 Speculation Recovery Loose Ends Up to now: Techniques for handling register dependencies Register renaming for WR, WW Tomasulo s algorithm for scheduling RW ranch prediction for control dependencies
More informationT a s k B C D. O r d e r
an Jose tate University EE176 - Fall 1998 Computer rchitecture and Engineering Lecture 12: Introduction to Pipelining (Part II) Instructor: Christopher H. Pham http://www.engr.sjsu.edu/~cpham/ T a s k
More informationComputer Architecture and Engineering CS152 Quiz #3 March 22nd, 2012 Professor Krste Asanović
Computer Architecture and Engineering CS52 Quiz #3 March 22nd, 202 Professor Krste Asanović Name: This is a closed book, closed notes exam. 80 Minutes 0 Pages Notes: Not all questions are
More information6.004 Computation Structures Spring 2009
MIT OpenCourseWare http://ocw.mit.edu 6.004 Computation Structures Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. PCSEL ILL XAdr OP 4 3 JT
More informationSpring 2014 Midterm Exam Review
mr 1 When / Where Spring 2014 Midterm Exam Review mr 1 Monday, 31 March 2014, 9:30-10:40 CDT 1112 P. Taylor Hall (Here) Conditions Closed Book, Closed Notes Bring one sheet of notes (both sides), 216 mm
More informationPipeline design. Mehran Rezaei
Pipeline design Mehran Rezaei How Can We Improve the Performance? Exec Time = IC * CPI * CCT Optimization IC CPI CCT Source Level * Compiler * * ISA * * Organization * * Technology * With Pipelining We
More informationControl Hazards. Branch Recovery. Control Hazard Pipeline Diagram. Branch Performance
Control Hazards ranch Recovery D/
More information