C 1. Last time. CSE 490/590 Computer Architecture. Complex Pipelining I. Complex Pipelining: Motivation. Floating-Point Unit (FPU) Floating-Point ISA

Similar documents
ECE 252 / CPS 220 Advanced Computer Architecture I. Lecture 8 Instruction-Level Parallelism Part 1

Complex Pipelining. Motivation

CS 152 Computer Architecture and Engineering. Lecture 10 - Complex Pipelines, Out-of-Order Issue, Register Renaming

Lecture 4 Pipelining Part II

CS 152 Computer Architecture and Engineering. Lecture 13 - Out-of-Order Issue and Register Renaming

EC 513 Computer Architecture

CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture. Lecture 4 Pipelining Part II

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 9 Instruction-Level Parallelism Part 2

CS 252 Graduate Computer Architecture. Lecture 4: Instruction-Level Parallelism

CSC 631: High-Performance Computer Architecture

CS 152 Computer Architecture and Engineering. Lecture 12 - Advanced Out-of-Order Superscalars

Complex Pipelining: Out-of-order Execution & Register Renaming. Multiple Function Units

C 1. Last Time. CSE 490/590 Computer Architecture. ISAs and MIPS. Instruction Set Architecture (ISA) ISA to Microarchitecture Mapping

Announcement. ECE475/ECE4420 Computer Architecture L4: Advanced Issues in Pipelining. Edward Suh Computer Systems Laboratory

Processor: Superscalars Dynamic Scheduling

CS252 Graduate Computer Architecture Lecture 8. Review: Scoreboard (CDC 6600) Explicit Renaming Precise Interrupts February 13 th, 2010

CS 152, Spring 2011 Section 8

CS252 Graduate Computer Architecture Lecture 6. Recall: Software Pipelining Example

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 4 Reduced Instruction Set Computers

CISC 662 Graduate Computer Architecture. Lecture 10 - ILP 3

CS 152 Computer Architecture and Engineering. Lecture 16: Vector Computers

CS 152 Computer Architecture and Engineering. Lecture 13 - VLIW Machines and Statically Scheduled ILP

Review: Compiler techniques for parallelism Loop unrolling Ÿ Multiple iterations of loop in software:

CS425 Computer Systems Architecture

CS252 Spring 2017 Graduate Computer Architecture. Lecture 8: Advanced Out-of-Order Superscalar Designs Part II

Lecture 13 - VLIW Machines and Statically Scheduled ILP

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 6 Pipelining Part 1

Lecture 4 - Pipelining

CS152 Computer Architecture and Engineering. Complex Pipelines

Reduction of Data Hazards Stalls with Dynamic Scheduling So far we have dealt with data hazards in instruction pipelines by:

Instruction-Level Parallelism and Its Exploitation

CS 152 Computer Architecture and Engineering. Lecture 16 - VLIW Machines and Statically Scheduled ILP

Chapter 3 Instruction-Level Parallelism and its Exploitation (Part 1)

Good luck and have fun!

ESE 545 Computer Architecture Instruction-Level Parallelism (ILP) and Static & Dynamic Instruction Scheduling Instruction level parallelism

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

Complex Pipelining COE 501. Computer Architecture Prof. Muhamed Mudawar

COSC 6385 Computer Architecture - Pipelining (II)

Lecture 14: Multithreading

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 15 Very Long Instruction Word Machines

Lecture 12 Branch Prediction and Advanced Out-of-Order Superscalars

Lecture 9: Multiple Issue (Superscalar and VLIW)

Slide Set 8. for ENCM 501 in Winter Steve Norman, PhD, PEng

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Page 1. Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls

CS 152 Computer Architecture and Engineering. Lecture 11 - Virtual Memory and Caches

Recall from Pipelining Review. Lecture 16: Instruction Level Parallelism and Dynamic Execution #1: Ideas to Reduce Stalls

CS152 Computer Architecture and Engineering March 13, 2008 Out of Order Execution and Branch Prediction Assigned March 13 Problem Set #4 Due March 25

Multiple Instruction Issue. Superscalars

Lecture-13 (ROB and Multi-threading) CS422-Spring

COSC4201 Instruction Level Parallelism Dynamic Scheduling

CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation

Static vs. Dynamic Scheduling

CS 152 Computer Architecture and Engineering. Lecture 7 - Memory Hierarchy-II

ECE 252 / CPS 220 Advanced Computer Architecture I. Lecture 14 Very Long Instruction Word Machines

CS 152 Computer Architecture and Engineering. Lecture 14: Multithreading

CS 152 Computer Architecture and Engineering. Lecture 18: Multithreading

What is ILP? Instruction Level Parallelism. Where do we find ILP? How do we expose ILP?

Computer Architecture ELEC3441

Scoreboard information (3 tables) Four stages of scoreboard control

CPE 631 Lecture 11: Instruction Level Parallelism and Its Dynamic Exploitation

DYNAMIC INSTRUCTION SCHEDULING WITH SCOREBOARD

CS 152 Computer Architecture and Engineering

Detailed Scoreboard Pipeline Control. Three Parts of the Scoreboard. Scoreboard Example Cycle 1. Scoreboard Example. Scoreboard Example Cycle 3

CS 152 Computer Architecture and Engineering. Lecture 8 - Memory Hierarchy-III

Metodologie di Progettazione Hardware-Software

Chapter 4 The Processor 1. Chapter 4D. The Processor

ESE 545 Computer Architecture Instruction-Level Parallelism (ILP): Speculation, Reorder Buffer, Exceptions, Superscalar Processors, VLIW

CPE 631 Lecture 10: Instruction Level Parallelism and Its Dynamic Exploitation

Pipelining: Issue instructions in every cycle (CPI 1) Compiler scheduling (static scheduling) reduces impact of dependences

Lecture 3 - Pipelining

Hardware-based speculation (2.6) Multiple-issue plus static scheduling = VLIW (2.7) Multiple-issue, dynamic scheduling, and speculation (2.

CS 423 Computer Architecture Spring Lecture 04: A Superscalar Pipeline

CS152 Computer Architecture and Engineering CS252 Graduate Computer Architecture. VLIW, Vector, and Multithreaded Machines

Advanced issues in pipelining

MIPS ISA AND PIPELINING OVERVIEW Appendix A and C

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

CS252 Spring 2017 Graduate Computer Architecture. Lecture 6: Out-of-Order Processors

In-order vs. Out-of-order Execution. In-order vs. Out-of-order Execution

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles. Interrupts and Exceptions. Device Interrupt (Say, arrival of network message)

Hardware-based Speculation

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles

Page 1. Recall from Pipelining Review. Lecture 15: Instruction Level Parallelism and Dynamic Execution

CS 152 Computer Architecture and Engineering. Lecture 5 - Pipelining II (Branches, Exceptions)

CS152 Computer Architecture and Engineering VLIW, Vector, and Multithreaded Machines

Case Study IBM PowerPC 620

Computer Systems Architecture I. CSE 560M Lecture 5 Prof. Patrick Crowley

Computer Architecture

CS 152 Computer Architecture and Engineering. Lecture 9 - Virtual Memory

CPE 631 Lecture 09: Instruction Level Parallelism and Its Dynamic Exploitation

CS252 Spring 2017 Graduate Computer Architecture. Lecture 17: Virtual Memory and Caches

Minimizing Data hazard Stalls by Forwarding Data Hazard Classification Data Hazards Present in Current MIPS Pipeline

Compiler Optimizations. Lecture 7 Overview of Superscalar Techniques. Memory Allocation by Compilers. Compiler Structure. Register allocation

Four Steps of Speculative Tomasulo cycle 0

Advantages of Dynamic Scheduling

CSE 820 Graduate Computer Architecture. week 6 Instruction Level Parallelism. Review from Last Time #1

ECE 552 / CPS 550 Advanced Computer Architecture I. Lecture 13 Memory Part 2

吳俊興高雄大學資訊工程學系. October Example to eleminate WAR and WAW by register renaming. Tomasulo Algorithm. A Dynamic Algorithm: Tomasulo s Algorithm

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle?

Tomasulo s Algorithm

Transcription:

CSE 490/590 Computer Architecture Complex Pipelining I Steve Ko Computer Sciences and Engineering University at Buffalo 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 hen cache size > page size L2 cache keeps a pointer to L1 cache Disallows aliasing CSE 490/590, Spring 2011 CSE 490/590, Spring 2011 2 Complex Pipelining: Motivation Pipelining becomes complex when we want high performance in the presence of: Long latency or partially pipelined floatingpoint units ory systems with variable access time Multiple arithmetic and memory units 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 2011 3 CSE 490/590, Spring 2011 4 Functional Unit Characteristics fully pipelined partially pipelined 1cyc 1cyc 1cyc 2 cyc 2 cyc 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 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 2011 5 CSE 490/590, Spring 2011 6 C 1

Realistic ory Systems 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 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 Multiple Functional Units in Pipeline ALU IF ID Issue B GPR s FPR s Fadd Fmul Fdiv CSE 490/590, Spring 2011 7 CSE 490/590, Spring 2011 8 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? Complex In-Order Pipeline PC Inst. D Decode GPRs X1 + X2 Delay writeback so all operations have same latency to stage rite ports never oversubscribed (one inst. in & one inst. out every cycle) Stall pipeline on long latency FPRs X1 operations, e.g., divides, cache misses Handle exceptions in-order at commit point How to prevent increased writeback latency from slowing down single cycle integer operations? Bypassing Data X2 FAdd X2 FMul Unpipelined divider FDiv X2 Commit Point CSE 490/590, Spring 2011 9 CSE 490/590, Spring 2011 10 In-Order Superscalar Pipeline PC Inst. 2 D Dual Decode 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 21064 (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 GPRs FPRs X1 X1 + X2 Data X2 FAdd X2 FMul Unpipelined FDiv X2 divider Commit Point 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-rite r 5 r 3 op r 4 (RA) hazard Anti-dependence r 3 r 1 op r 2 rite-after-read r 1 r 4 op r 5 (AR) hazard Output-dependence r 3 r 1 op r 2 r 3 r 6 op r 7 rite-after-rite (A) hazard CSE 490/590, Spring 2011 11 CSE 490/590, Spring 2011 12 C 2

Register vs. ory 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 store M[r 1 + disp1] r 2 load r 3 M[r 4 + disp2] Does (r 1 + disp1) = (r 4 + disp2)? Data Hazards: An Example I 1 DIVD f6, f6, f4 I 2 LD f2, 45(r3) I 3 MULTD f0, f2, f4 I 4 DIVD f8, f6, f2 I 5 SUBD f10, f0, f6 I 6 ADDD f6, f8, f2 RA Hazards AR Hazards A Hazards CSE 490/590, Spring 2011 13 CSE 490/590, Spring 2011 14 Instruction Scheduling Out-of-order Completion In-order Issue I 1 DIVD f6, f6, f4 I 2 LD f2, 45(r3) I 3 MULTD f0, f2, f4 I 4 DIVD f8, f6, f2 I 5 SUBD f10, f0, f6 I 6 ADDD f6, f8, f2 Valid orderings: in-order I 1 I 2 I 3 I 4 I 5 I 6 out-of-order out-of-order I 2 I 1 I 3 I 4 I 5 I 6 I 1 I 2 I 3 I 5 I 4 I 6 I 1 I 2 I 3 I 4 I 5 I 6 Latency I 1 DIVD f6, f6, f4 4 I 2 LD f2, 45(r3) 1 I 3 MULTD f0, f2, f4 3 I 4 DIVD f8, f6, f2 4 I 5 SUBD f10, f0, f6 1 I 6 ADDD f6, f8, f2 1 in-order comp 1 2 out-of-order comp 1 2 1 2 3 4 3 5 4 6 5 6 2 3 1 4 3 5 5 4 6 6 CSE 490/590, Spring 2011 15 CSE 490/590, Spring 2011 16 CSE 490/590 Administrivia Midterm on Friday, 3/4 Review on ednesday, 3/2 Project 1 deadline: Friday, 3/11 CSE machines are available for projects Thin clients & SSH only for simulation Linux & indows machines @ 216 Bell for board Office hours will be posted again. At least next week, it ll be ed after class until 2pm. 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 k, 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 2011 17 3/10/2009 CSE 490/590, Spring 2011 18 C 3

IBM o on CDC6600 Thomas atson 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. atson has answered his own question. CDC 6600: A Load/Store Architecture Separate instructions to manipulate three types of reg. 8 60-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 6 3 3 3 opcode i j k Ri (Rj) op (Rk) Only Load and Store instructions refer to memory! 6 3 3 18 opcode i j disp Ri M[(Rj) + disp] Touching address registers 1 to 5 initiates a load 6 to 7 initiates a store - very useful for vector operations CSE 490/590, Spring 2011 19 CSE 490/590, Spring 2011 20 CDC 6600: Datapath Central ory 128K words, 32 banks, 1µs cycle Operand Regs 8 x 60-bit Address Regs Index Regs 8 x 18-bit 8 x 18-bit operand addr result addr operand result 10 Functional Units IR Inst. Stack 8 x 60-bit 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 2011 21 CSE 490/590, Spring 2011 22 Complex Pipeline IF ID Issue B GPR s FPR s Can we solve write hazards without equalizing all pipeline depths and without bypassing? ALU Fadd Fmul Fdiv hen 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? RA? Is it safe to write the destination? AR? A? Is there a structural conflict at the B stage? CSE 490/590, Spring 2011 23 CSE 490/590, Spring 2011 24 C 4

A Data Structure for Correct Issues Keeps track of the status of Functional Units Name Busy Op Dest Src1 Src2 Int Add1 Add2 Add3 Mult1 Mult2 Div The instruction i at the Issue stage consults this table FU available? check the busy column RA? search the dest column for i s sources AR? search the source columns for i s destination A? 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 rite-back CSE 490/590, Spring 2011 25 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 6.823 UCB material derived from course CS252 CSE 490/590, Spring 2011 26 C 5