CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Complex Pipelining I Steve Ko Computer Sciences and Engineering University at Buffalo.

Slides:



Advertisements
Similar presentations
Complex Pipelining Krste Asanovic Laboratory for Computer Science Massachusetts Institute of Technology Asanovic/Devadas Spring
Advertisements

© Krste Asanovic, 2014CS252, Spring 2014, Lecture 5 CS252 Graduate Computer Architecture Spring 2014 Lecture 5: Out-of-Order Processing Krste Asanovic.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture VLIW Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Cache III Steve Ko Computer Sciences and Engineering University at Buffalo.
2/28/2013 CS152, Spring 2013 CS 152 Computer Architecture and Engineering Lecture 11 - Out-of-Order Issue, Register Renaming, & Branch Prediction Krste.
ECE 552 / CPS 550 Advanced Computer Architecture I Lecture 8 Instruction-Level Parallelism – Part 1 Benjamin Lee Electrical and Computer Engineering Duke.
Lecture 6: ILP HW Case Study— CDC 6600 Scoreboard & Tomasulo’s Algorithm Professor Alvin R. Lebeck Computer Science 220 Fall 2001.
CSE 8383 Superscalar Processor 1 Abdullah A Alasmari & Eid S. Alharbi.
COMP 4211 Seminar Presentation Based On: Computer Architecture A Quantitative Approach by Hennessey and Patterson Presenter : Feri Danes.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Complex Pipelining II Steve Ko Computer Sciences and Engineering University at Buffalo.
February 28, 2011CS152, Spring 2011 CS 152 Computer Architecture and Engineering Lecture 10 - Complex Pipelines, Out-of-Order Issue, Register Renaming.
Lecture 6: Pipelining MIPS R4000 and More Kai Bu
Instruction-Level Parallelism (ILP)
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture ILP II Steve Ko Computer Sciences and Engineering University at Buffalo.
February 28, 2012CS152, Spring 2012 CS 152 Computer Architecture and Engineering Lecture 11 - Out-of-Order Issue, Register Renaming, & Branch Prediction.
CS 152 Computer Architecture and Engineering Lecture 13 - Out-of-Order Issue, Register Renaming, & Branch Prediction Krste Asanovic Electrical Engineering.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture ILP III Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Cache II Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Pipelining III Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture MIPS Review & Pipelining I Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Virtual Memory I Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Cache IV Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590 Computer Architecture Virtual Memory II
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture ILP I Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Synchronization and Consistency I Steve Ko Computer Sciences and Engineering University at Buffalo.
March 2, 2010CS152, Spring 2010 CS 152 Computer Architecture and Engineering Lecture 12 - Complex Pipelines Krste Asanovic Electrical Engineering and Computer.
CS 152 Computer Architecture and Engineering Lecture 15 - Advanced Superscalars Krste Asanovic Electrical Engineering and Computer Sciences University.
March 4, 2010CS152, Spring 2010 CS 152 Computer Architecture and Engineering Lecture 13 - Out-of-Order Issue, Register Renaming, & Branch Prediction Krste.
CS 152 Computer Architecture and Engineering Lecture 12 - Complex Pipelines Krste Asanovic Electrical Engineering and Computer Sciences University of California.
CS 152 Computer Architecture and Engineering Lecture 13 - Out-of-Order Issue and Register Renaming Krste Asanovic Electrical Engineering and Computer Sciences.
CS 152 Computer Architecture and Engineering Lecture 12 - Complex Pipelines Krste Asanovic Electrical Engineering and Computer Sciences University of California.
1 COMP541 Sequencing – III (Sequencing a Computer) Montek Singh April 9, 2007.
March 9, 2011CS152, Spring 2011 CS 152 Computer Architecture and Engineering Lecture 12 - Advanced Out-of-Order Superscalars Krste Asanovic Electrical.
1 IBM System 360. Common architecture for a set of machines. Robert Tomasulo worked on a high-end machine, the Model 91 (1967), on which they implemented.
COMP381 by M. Hamdi 1 Pipelining (Dynamic Scheduling Through Hardware Schemes)
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed, Oct 5, 2005 Topic: Instruction-Level Parallelism (Dynamic Scheduling: Scoreboarding)
CS 252 Graduate Computer Architecture Lecture 4: Instruction-Level Parallelism Krste Asanovic Electrical Engineering and Computer Sciences University of.
Appendix A Pipelining: Basic and Intermediate Concepts
EENG449b/Savvides Lec 5.1 1/27/04 January 27, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG Computer.
Nov. 9, Lecture 6: Dynamic Scheduling with Scoreboarding and Tomasulo Algorithm (Section 2.4)
1 Sixth Lecture: Chapter 3: CISC Processors (Tomasulo Scheduling and IBM System 360/91) Please recall:  Multicycle instructions lead to the requirement.
ECE 552 / CPS 550 Advanced Computer Architecture I Lecture 9 Instruction-Level Parallelism – Part 2 Benjamin Lee Electrical and Computer Engineering Duke.
1 Appendix A Pipeline implementation Pipeline hazards, detection and forwarding Multiple-cycle operations MIPS R4000 CDA5155 Spring, 2007, Peir / University.
1 Lecture 5 Overview of Superscalar Techniques CprE 581 Computer Systems Architecture, Fall 2009 Zhao Zhang Reading: Textbook, Ch. 2.1 “Complexity-Effective.
CS 152 Computer Architecture and Engineering Lecture 15 - Out-of-Order Memory, Complex Superscalars Review Krste Asanovic Electrical Engineering and Computer.
1 Lecture 5: Dependence Analysis and Superscalar Techniques Overview Instruction dependences, correctness, inst scheduling examples, renaming, speculation,
1 Images from Patterson-Hennessy Book Machines that introduced pipelining and instruction-level parallelism. Clockwise from top: IBM Stretch, IBM 360/91,
CSC 4250 Computer Architectures September 29, 2006 Appendix A. Pipelining.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
Jan. 5, 2000Systems Architecture II1 Machine Organization (CS 570) Lecture 1: Overview of High Performance Processors * Jeremy R. Johnson Wed. Sept. 27,
04/03/2016 slide 1 Dynamic instruction scheduling Key idea: allow subsequent independent instructions to proceed DIVDF0,F2,F4; takes long time ADDDF10,F0,F8;
High Performance Computing1 High Performance Computing (CS 680) Lecture 2a: Overview of High Performance Processors * Jeremy R. Johnson *This lecture was.
© Krste Asanovic, 2015CS252, Fall 2015, Lecture 6 CS252 Graduate Computer Architecture Fall 2015 Lecture 6: Out-of-Order Processors Krste Asanovic
March 1, 2012CS152, Spring 2012 CS 152 Computer Architecture and Engineering Lecture 12 - Advanced Out-of-Order Superscalars Krste Asanovic Electrical.
COMP25212 Advanced Pipelining Out of Order Processors.
IBM System 360. Common architecture for a set of machines
CS 152 Computer Architecture and Engineering Lecture 10 - Complex Pipelines, Out-of-Order Issue, Register Renaming John Wawrzynek Electrical Engineering.
CS252 Graduate Computer Architecture Fall 2015 Lecture 5: Out-of-Order Processing Krste Asanovic
CS 152 Computer Architecture and Engineering Lecture 11 - Out-of-Order Issue, Register Renaming, & Branch Prediction John Wawrzynek Electrical Engineering.
CS252 Graduate Computer Architecture Fall 2015 Lecture 4: Pipelining
Lecture 10 - Complex Pipelines, Out-of-Order Issue, Register Renaming
Out of Order Processors
Out of Order Processors
Pipelining Multicycle, MIPS R4000, and More
Electrical and Computer Engineering
Krste Asanovic Electrical Engineering and Computer Sciences
CS 704 Advanced Computer Architecture
Krste Asanovic Electrical Engineering and Computer Sciences
Krste Asanovic Electrical Engineering and Computer Sciences
CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture Lecture 4 – Pipelining Part II Krste Asanovic Electrical Engineering.
Presentation transcript:

CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Complex Pipelining I Steve Ko Computer Sciences and Engineering University at Buffalo

CSE 490/590, Spring Last time… Virtual address caches –Virtually-indexed, physically-tagged cache design Aliasing problem –No issue when cache size < page size Using physical address L2 cache –When cache size > page size –L2 cache keeps a pointer to L1 cache –Disallows aliasing

CSE 490/590, Spring Complex Pipelining: Motivation Pipelining becomes complex when we want high performance in the presence of: Long latency or partially pipelined floating- point units Memory systems with variable access time Multiple arithmetic and memory units

CSE 490/590, Spring Floating-Point Unit (FPU) Much more hardware than an integer unit Single-cycle FPU is a bad idea - why? it is common to have several FPU’s it is common to have different types of FPU’s Fadd, Fmul, Fdiv,... an FPU may be pipelined, partially pipelined or not pipelined To operate several FPU’s concurrently the FP register file needs to have more read and write ports

CSE 490/590, Spring Functional Unit Characteristics fully pipelined partially pipelined Functional units have internal pipeline registers  operands are latched when an instruction enters a functional unit  inputs to a functional unit (e.g., register file) can change during a long latency operation 1cyc 2 cyc

CSE 490/590, Spring Floating-Point ISA Interaction between the floating-point datapath and the integer datapath is determined largely by the ISA MIPS ISA separate register files for FP and Integer instructions the only interaction is via a set of move instructions (some ISA’s don’t even permit this) separate load/store for FPR’s and GPR’s but both use GPR’s for address calculation separate conditions for branches FP branches are defined in terms of condition codes

CSE 490/590, Spring Realistic Memory Systems Latency of access to the main memory is usually much greater than one cycle and often unpredictable Solving this problem is a central issue in computer architecture Common approaches to improving memory performance caches single cycle except in case of a miss stall interleaved memory multiple memory accesses  bank conflicts split-phase memory operations (separate memory request from response)  out-of-order responses

CSE 490/590, Spring Multiple Functional Units in Pipeline IF ID WB ALUMem Fadd Fmul Fdiv Issue GPR’s FPR’s

CSE 490/590, Spring Complex Pipeline Control Issues Structural conflicts at the execution stage if some FPU or memory unit is not pipelined and takes more than one cycle Structural conflicts at the write-back stage due to variable latencies of different functional units Out-of-order write hazards due to variable latencies of different functional units How to handle exceptions?

CSE 490/590, Spring Complex In-Order Pipeline Delay writeback so all operations have same latency to W stage –Write ports never oversubscribed (one inst. in & one inst. out every cycle) –Stall pipeline on long latency operations, e.g., divides, cache misses –Handle exceptions in-order at commit point Commit Point PC Inst. Mem D Decode X1X2 Data Mem W + GPRs X2W FAdd X3 FPRs X1 X2 FMul X3 X2 FDiv X3 Unpipelined divider How to prevent increased writeback latency from slowing down single cycle integer operations? Bypassin g

CSE 490/590, Spring In-Order Superscalar Pipeline Fetch two instructions per cycle; issue both simultaneously if one is integer/memory and other is floating point Inexpensive way of increasing throughput, examples include Alpha (1992) & MIPS R5000 series (1996) Same idea can be extended to wider issue by duplicating functional units (e.g. 4-issue UltraSPARC) but regfile ports and bypassing costs grow quickly Commit Point 2 PC Inst. Mem D Dual Decode X1X2 Data Mem W + GPRs X2W FAdd X3 FPRs X1 X2 FMul X3 X2 FDiv X3 Unpipelined divider

CSE 490/590, Spring Types of Data Hazards Consider executing a sequence of r k r i op r j type of instructions Data-dependence r 3  r 1 op r 2 Read-after-Write r 5  r 3 op r 4 (RAW) hazard Anti-dependence r 3  r 1 op r 2 Write-after-Read r 1  r 4 op r 5 (WAR) hazard Output-dependence r 3  r 1 op r 2 Write-after-Write r 3  r 6 op r 7 (WAW) hazard

CSE 490/590, Spring Register vs. Memory Dependence Data hazards due to register operands can be determined at the decode stage but data hazards due to memory operands can be determined only after computing the effective address storeM[r 1 + disp1]  r 2 loadr 3  M[r 4 + disp2] Does (r 1 + disp1) = (r 4 + disp2) ?

CSE 490/590, Spring Data Hazards: An Example I 1 DIVDf6, f6,f4 I 2 LDf2,45(r3) I 3 MULTDf0,f2,f4 I 4 DIVDf8,f6,f2 I 5 SUBDf10,f0,f6 I 6 ADDDf6,f8,f2 RAW Hazards WAR Hazards WAW Hazards

CSE 490/590, Spring Instruction Scheduling I6I6 I2I2 I4I4 I1I1 I5I5 I3I3 Valid orderings: in-orderI 1 I 2 I 3 I 4 I 5 I 6 out-of-order I 1 DIVDf6, f6,f4 I 2 LDf2,45(r3) I 3 MULTDf0,f2,f4 I 4 DIVDf8,f6,f2 I 5 SUBDf10,f0,f6 I 6 ADDDf6,f8,f2 I2 I1 I3 I4 I5I6I2 I1 I3 I4 I5I6 I1 I2I3 I5 I4I6I1 I2I3 I5 I4I6

CSE 490/590, Spring Out-of-order Completion In-order Issue Latency I 1 DIVDf6, f6,f4 4 I 2 LDf2,45(r3)1 I 3 MULTDf0,f2,f43 I 4 DIVDf8,f6,f24 I 5 SUBDf10,f0,f61 I 6 ADDDf6,f8,f21 in-order comp1 2 out-of-order comp

CSE 490/590, Spring CSE 490/590 Administrivia Midterm on Friday, 3/4 Review on Wednesday, 3/2 Project 1 deadline: Friday, 3/11 CSE machines are available for projects –Thin clients & SSH only for simulation –Linux & Windows 216 Bell for board Office hours will be posted again. –At least next week, it’ll be Wed after class until 2pm.

CSE 490/590, Spring /10/ CDC 6600 Seymour Cray, 1963 A fast pipelined machine with 60-bit words –128 Kword main memory capacity, 32 banks Ten functional units (parallel, unpipelined) –Floating Point: adder, 2 multipliers, divider –Integer: adder, 2 incrementers,... Hardwired control (no microcoding) Scoreboard for dynamic scheduling of instructions Ten Peripheral Processors for Input/Output –a fast multi-threaded 12-bit integer ALU Very fast clock, 10 MHz (FP add in 4 clocks) >400,000 transistors, 750 sq. ft., 5 tons, 150 kW, novel freon-based technology for cooling Fastest machine in world for 5 years (until 7600) –over 100 sold ($7-10M each)

CSE 490/590, Spring IBM Memo on CDC6600 Thomas Watson Jr., IBM CEO, August 1963: “Last week, Control Data... announced the 6600 system. I understand that in the laboratory developing the system there are only 34 people including the janitor. Of these, 14 are engineers and 4 are programmers... Contrasting this modest effort with our vast development activities, I fail to understand why we have lost our industry leadership position by letting someone else offer the world's most powerful computer.” To which Cray replied: “It seems like Mr. Watson has answered his own question.”

CSE 490/590, Spring Separate instructions to manipulate three types of reg bit data registers (X) 8 18-bit address registers (A) 8 18-bit index registers (B) All arithmetic and logic instructions are reg-to-reg Only Load and Store instructions refer to memory! Touching address registers 1 to 5 initiates a load 6 to 7 initiates a store - very useful for vector operations opcode i j k Ri   (Rj) op (Rk) CDC 6600: A Load/Store Architecture opcode i j disp Ri M[(Rj) + disp]

CSE 490/590, Spring CDC 6600: Datapath Address Regs Index Regs 8 x 18-bit 8 x 18-bit Operand Regs 8 x 60-bit Inst. Stack 8 x 60-bit IR 10 Functional Units Central Memory 128K words, 32 banks, 1  s cycle result addr result operand addr

CSE 490/590, Spring CDC6600 ISA designed to simplify high-performance implementation Use of three-address, register-register ALU instructions simplifies pipelined implementation –No implicit dependencies between inputs and outputs Decoupling setting of address register (Ar) from retrieving value from data register (Xr) simplifies providing multiple outstanding memory accesses –Software can schedule load of address register before use of value –Can interleave independent instructions inbetween CDC6600 has multiple parallel but unpipelined functional units –E.g., 2 separate multipliers Follow-on machine CDC7600 used pipelined functional units –Foreshadows later RISC designs

CSE 490/590, Spring Complex Pipeline IF ID WB ALUMem Fadd Fmul Fdiv Issue GPR’s FPR’s Can we solve write hazards without equalizing all pipeline depths and without bypassing?

CSE 490/590, Spring When is it Safe to Issue an Instruction? Suppose a data structure keeps track of all the instructions in all the functional units The following checks need to be made before the Issue stage can dispatch an instruction Is the required function unit available? Is the input data available?  RAW? Is it safe to write the destination? WAR? WAW? Is there a structural conflict at the WB stage?

CSE 490/590, Spring A Data Structure for Correct Issues Keeps track of the status of Functional Units The instruction i at the Issue stage consults this table FU available? check the busy column RAW?search the dest column for i’s sources WAR?search the source columns for i’s destination WAW?search the dest column for i’s destination An entry is added to the table if no hazard is detected; An entry is removed from the table after Write-Back NameBusyOpDestSrc1Src2 Int Mem Add1 Add2 Add3 Mult1 Mult2 Div

CSE 490/590, Spring Acknowledgements These slides heavily contain material developed and copyright by –Krste Asanovic (MIT/UCB) –David Patterson (UCB) And also by: –Arvind (MIT) –Joel Emer (Intel/MIT) –James Hoe (CMU) –John Kubiatowicz (UCB) MIT material derived from course UCB material derived from course CS252