Fall 2014, Nov 19... ELEC 5200-001/6200-001 Lecture 12 1 ELEC 5200-001/6200-001 Computer Architecture and Design Fall 2014 Instruction-Level Parallelism.

Slides:



Advertisements
Similar presentations
Computer Organization and Architecture
Advertisements

Computer architecture
Chapter 14 Instruction Level Parallelism and Superscalar Processors
COMP4611 Tutorial 6 Instruction Level Parallelism
Advanced Pipelining Optimally Scheduling Code Optimally Programming Code Scheduling for Superscalars (6.9) Exceptions (5.6, 6.8)
Pipeline Optimization
1 Advanced Computer Architecture Limits to ILP Lecture 3.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
ELEN 468 Advanced Logic Design
1 Lecture 10: Static ILP Basics Topics: loop unrolling, static branch prediction, VLIW (Sections 4.1 – 4.4)
10/24/05 ELEC62001 Kasi L.K. Anbumony Department of Electrical and Computer Engineering Auburn University Auburn, AL Superscalar Processors.
Instruction Level Parallelism Chapter 4: CS465. Instruction-Level Parallelism (ILP) Pipelining: executing multiple instructions in parallel To increase.
Chapter 4 CSF 2009 The processor: Instruction-Level Parallelism.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
Spring 2008, Jan. 14 ELEC / Lecture 2 1 ELEC / Computer Architecture and Design Spring 2007 Introduction Vishwani D. Agrawal.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 19 - Pipelined.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
1 Lecture 5: Pipeline Wrap-up, Static ILP Basics Topics: loop unrolling, VLIW (Sections 2.1 – 2.2) Assignment 1 due at the start of class on Thursday.
Chapter 2 Instruction-Level Parallelism and Its Exploitation
Review of CS 203A Laxmi Narayan Bhuyan Lecture2.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania Computer Organization Pipelined Processor Design 3.
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.
RISC. Rational Behind RISC Few of the complex instructions were used –data movement – 45% –ALU ops – 25% –branching – 30% Cheaper memory VLSI technology.
1 CSE SUNY New Paltz Chapter Six Enhancing Performance with Pipelining.
Spring 07, Feb 22 ELEC 7770: Advanced VLSI Design (Agrawal) 1 ELEC 7770 Advanced VLSI Design Spring 2007 Power Aware Microprocessors Vishwani D. Agrawal.
ENGS 116 Lecture 51 Pipelining and Hazards Vincent H. Berk September 30, 2005 Reading for today: Chapter A.1 – A.3, article: Patterson&Ditzel Reading for.
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve performance by increasing instruction throughput.
Chapter 14 Instruction Level Parallelism and Superscalar Processors
Fall 2015, Aug 17 ELEC / Lecture 1 1 ELEC / Computer Architecture and Design Fall 2015 Introduction Vishwani D. Agrawal.
1 Sixth Lecture: Chapter 3: CISC Processors (Tomasulo Scheduling and IBM System 360/91) Please recall:  Multicycle instructions lead to the requirement.
1 Advanced Computer Architecture Dynamic Instruction Level Parallelism Lecture 2.
Chapter 8 Pipelining. A strategy for employing parallelism to achieve better performance Taking the “assembly line” approach to fetching and executing.
Computer Architecture Pipelines & Superscalars Sunset over the Pacific Ocean Taken from Iolanthe II about 100nm north of Cape Reanga.
Instruction Level Parallelism Pipeline with data forwarding and accelerated branch Loop Unrolling Multiple Issue -- Multiple functional Units Static vs.
CMPE 421 Parallel Computer Architecture
CSCE 614 Fall Hardware-Based Speculation As more instruction-level parallelism is exploited, maintaining control dependences becomes an increasing.
Pipelining and Parallelism Mark Staveley
Chapter 6 Pipelined CPU Design. Spring 2005 ELEC 5200/6200 From Patterson/Hennessey Slides Pipelined operation – laundry analogy Text Fig. 6.1.
1 Lecture 7: Speculative Execution and Recovery Branch prediction and speculative execution, precise interrupt, reorder buffer.
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve perfomance by increasing instruction throughput.
Recap Multicycle Operations –MIPS Floating Point Putting It All Together: the MIPS R4000 Pipeline.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
Spring 2016, Jan 13 ELEC / Lecture 1 1 ELEC / Computer Architecture and Design Spring 2016 Introduction Vishwani D. Agrawal.
PART 5: (1/2) Processor Internals CHAPTER 14: INSTRUCTION-LEVEL PARALLELISM AND SUPERSCALAR PROCESSORS 1.
Lecture 1: Introduction Instruction Level Parallelism & Processor Architectures.
LECTURE 10 Pipelining: Advanced ILP. EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls,
11/15/05ELEC / Lecture 191 ELEC / (Fall 2005) Special Topics in Electrical Engineering Low-Power Design of Electronic Circuits.
Csci 136 Computer Architecture II – Superscalar and Dynamic Pipelining Xiuzhen Cheng
Advanced Pipelining 7.1 – 7.5. Peer Instruction Lecture Materials for Computer Architecture by Dr. Leo Porter is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CS 352H: Computer Systems Architecture
Instruction Level Parallelism
William Stallings Computer Organization and Architecture 8th Edition
ELEN 468 Advanced Logic Design
Chapter 14 Instruction Level Parallelism and Superscalar Processors
Pipeline Implementation (4.6)
Lecture 12 Reorder Buffers
Pipelining: Advanced ILP
Instruction Level Parallelism and Superscalar Processors
Vishwani D. Agrawal James J. Danaher Professor
Lecture 11: Memory Data Flow Techniques
Vishwani D. Agrawal James J. Danaher Professor
CSC3050 – Computer Architecture
The University of Adelaide, School of Computer Science
Guest Lecturer: Justin Hsia
ELEC / Computer Architecture and Design Fall 2014 Introduction
Presentation transcript:

Fall 2014, Nov ELEC / Lecture 12 1 ELEC / Computer Architecture and Design Fall 2014 Instruction-Level Parallelism Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and Computer Engineering Auburn University, Auburn, AL

Fall 2014, Nov ELEC / Lecture 12 2 A Computer System Processor Cache Main memory I/O controller Disk Graphics output Network Memory – I/O bus Interrupts

Fall 2014, Nov ELEC / Lecture 12 3 Advanced Architectures – ILP Instruction level parallelism (ILP): multiple instructions fetched and executed simultaneously. ILP is used in addition to pipelining. Processors with ILP are called multiple-issue processors – multiple instructions launched in 1 clock cycle. Two ways: –MIMD: Multiple Instructions Multiple Data Superpipeline Superscalar – dynamic multiple issue Very long instruction word (VLIW) – static multiple issue –SIMD: Single Instruction Multiple Data Vector processor

Fall 2014, Nov ELEC / Lecture 12 4 Superpipeline and Superscalar IFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWBIFIDEXMEMWB System clock cycles Pipeline 1 instruction/cycle Superpipeline (Pipeline clock is twice as fast as the system clock) 2 instructions per cycle Superscalar 2 (or more) instructions/cycle

A Static Two-Issue MIPS Pipeline Read two instructions per cycle: An ALU or branch instruction, and A load or store instruction Insert one nop if above pair is not available Added hardware (Figure 4.69, page 336): A second instruction memory Additional input/output ports in register file Additional ALU in execute stage for address calculation Fall 2014, Nov ELEC / Lecture 12 5

An Example (Page 337) Fall 2014, Nov ELEC / Lecture 12 6 Loop:lw$t0, 0($s1) addu$t0, $t0, $s2 sw$t0, 0(s1) addi$s1, $s1, – 4 bne$s1, $0, Loop

Static Two-Issue Execution ALU or branch instruction Data transfer instruction Clock cycle Loop:noplw $t0, 0($s1)1 addi $s1, $s1, – 4nop2 addu $t0, $t0, $s2nop3 bne $s1, $0, Loopsw $t0, 4($s1)4 Fall 2014, Nov ELEC / Lecture 12 7 Note code reordering and change in sw argument. CPI=4/5=0.8<0.5 (ideal)

Loop Unrolling (Index Multiple of 4) ALU or branch instruction Data transfer instruction Clock cycle Loop:addi $s1, $s1, – 16lw $t0, 0($s1)1 noplw $t1, 12($s1)2 addu $t0, $t0, $s2lw $t2, 8($s1)3 addu $t1, $t1, $s2lw $t3, 4($s1)4 addu $t2, $t2, $s2sw $t0, 16($s1)5 addu $t3, $t3, $s2sw $t1, 12($s1)6 nopsw $t2, 8($s1)7 bne $s1, $0, Loopsw $t3, 4($s1)8 Fall 2014, Nov ELEC / Lecture 12 8 CPI=8/14=0.57<0.5 (ideal)

Fall 2014, Nov ELEC / Lecture 12 9 VLIW: Very Long Instruction Word Static multiple issue, ILP determined by compiler. Datapath contains multiple execution units. Compiler groups instructions that have no data or resource conflicts for parallel execution. Grouped instructions are packed in very long words of a wide instruction memory. Speedup benefit of VLIW is highly program dependent. J. A. Fisher, “Very Long Instruction Word Architecture and ELI-512,” Proc. 10 th Symp. on Computer Architecture, Stockholm, June 1983, pp J. A. Fisher, P. Faraboschi and C. Young, Embedded Computing: A VLIW Approach to Architecture, Compilers and Tools, Morgan Kaufmann.

Fall 2014, Nov ELEC / Lecture Superscalar: Dynamic Scheduling and Out-of-Order Execution Instruction fetch and decode unit Reservation station Reservation station Reservation station Reservation station Commit unit integer Floating point Load/ store Functional units In-order issue Out-of-order execution In-order commit Out-of-order issue

Out of Order Execution (OOE) A procedural programming language sequences instructions. Sequencing assumes an order of execution – no parallelism. OOE must preserve correctness of result. Principle: Two instructions can be executes in parallel if they do not have dependences. Fall 2014, Nov ELEC / Lecture 12 11

RAW Dependence Read after write (RAW): A dependent instruction reads from a register being written to by another instruction. Example: add$s1, $s2, $s3 sub$s2, $s1, $s3 sub has RAW dependence on add Fall 2014, Nov ELEC / Lecture 12 12

WAR Dependence Write after read (WAR): A dependent instruction writes to a register being read by another instruction. Example: add$s1, $s2, $s3 sub$s2, $s1, $s3 sub has WAR dependence on add Fall 2014, Nov ELEC / Lecture 12 13

WAW Dependence Read after write (RAW): One instruction writes to a register to being written to by another instruction. Example: add$s2, $s2, $s3 sub$s2, $s1, $s3 sub has WAW dependence on add Fall 2014, Nov ELEC / Lecture 12 14

Superscalar Instruction Issue Rules: RAW dependence – If any operand is being written, do not issue. WAR dependence – If the result register is being read, do not issue. WAW dependence – If the result register is being written, do not issue. Scoreboard: Cycle by cycle record of registers and execution units showing how many instructions are using them. Example 1: In-order issue (next 2 slides). Example 2: Out-of-order issue (3 rd slide). Fall 2014, Nov ELEC / Lecture 12 15

Dynamic Scheduling Consider an example: First with in-order issue Then with out-of-order issue Assume: Up to two instructions are fetched in a cycle Instruction register can hold two instructions An Instruction is issued in decode cycle, or must wait until there is no RAW, WAR or WAW dependence An instruction can retire two or three cycles after it is issued Fall 2014, Nov ELEC / Lecture 12 16

Fall 2014, Nov ELEC / Lecture Ck cycle Inst # Decoded Issue Inst# Retire Inst# Reg. to readReg. to write R3 = R0 * R1 R4 = R0 + R R5 = R0 + R1 R6 = R1 + R R7 = R1 * R R1 = R0 – R R3 = R3 * R

Fall 2014, Nov ELEC / Lecture Ck cycle Instr # Decoded Issue Inst# Retire Inst# Reg. to readReg. to write R1 = R4 + R In-order Issue scoreboard (Continued) Out-of-order scoreboard (Next 2 Slides)

Questions? RAW dependence: Inst# 4 (R6 = R1 + R4) could not be issued until cycle 5. Should Inst# 5 (R7 = R1 * R2) wait in queue? Answer: No. Inst# 5 can be issued in cycle 3 as there is no register conflict (out-of-order issue). WAR dependence: Must the issue of Inst#6 (R1 = R0 – R2) waits until cycle 9 when all instructions reading R1 have retired? Answer: No. Provided new result of Inst#6 does not affect R1 being used by previous instructions (register renaming). Fall 2014, Nov ELEC / Lecture 12 19

Fall 2014, Nov ELEC / Lecture Ck cycle Inst # Decoded Issue Inst# Retire Inst# Reg. to readReg. to write R3 = R0 * R1 R4 = R0 + R R5 = R0 + R1 R6 = R1 + R R7 = R1 * R2 S1 = R0 – R R3 = R3 * S1 S2 = R4 + R

References Previous example is from: A. S. Tanenbaum, Structured Computer Organization, Fifth Edition, Prentice-Hall, 2006, pp , Section Further reading: D. W. Anderson, F. J. Sparacio and R. M. Tomasulo, “The IBM 360 Model 91: Processor Philosophy and Instruction Handling,” IBM J. Res. & Dev., vol. 11, no. 1, pp. 8-24, Jan Fall 2014, Nov ELEC / Lecture 12 21

Fall 2014, Nov ELEC / Lecture Power Reduction by Slack Scheduling Application: Superscalar, out-of-order execution: An instruction is executed as soon as the required data and resources become available. A commit unit reorders the results. Delay the completion of instructions whose result is not immediately needed. Example of RISC instructions: addr0, r1, r2;(A) addr0, r1, r2;(A) sub r3, r4, r5;(B) sub r3, r4, r5;(B) and r9, r1, r9;(C) and r9, r1, r9;(C) or r5, r9, r10;(D) or r5, r9, r10;(D) xor r2, r10, r11;(E) xor r2, r10, r11;(E) J. Casmira and D. Grunwald, “Dynamic Instruction Scheduling Slack,” Proc. ACM Kool Chips Workshop, Dec

Fall 2014, Nov ELEC / Lecture Slack Scheduling Example Slack scheduling A BC D E Standard scheduling ABC D E

Fall 2014, Nov ELEC / Lecture Slack Scheduling Slack bit Low-power execution units (Reduced voltage) Re-order buffer Scheduling logic

Fall 2014, Nov ELEC / Lecture Superscalar Design of P4 (CISC) CISC shell: –Processor fetches instructions from memory in the order of static program. –Each instruction is translated into one or more fixed- length RISC instructions, known as micro-operations (micro-ops). RISC core: –Micro-ops are executed out-of-order in a dynamically scheduled pipeline. –Processor commits the result of each micro-op execution to register file in the order of original program flow.

Fall 2014, Nov ELEC / Lecture Superscalars 3 or more instruction issues per clock: Intel P6 AMD K5 Sun UltraSPARC Alpha MIPS R10000 PowerPC 604/620 HP 8000 References: D. W. Anderson, F. J. Sparacio and R. M. Tomasulo, “The IBM 360 Model 91: Processor Philosophy and Instruction Handling,” IBM J. Res. Dev., vol. 11, pp. 8-24, January T. Agerwala and J. Cocke, “Reduced Instruction Set Processors,” Technical Report RC12434 (#55845), Yorktown Heights, NY: IBM T. J. Watson Research Center, January T. Agerwala and J. Cocke, “Reduced Instruction Set Processors,” Technical Report RC12434 (#55845), Yorktown Heights, NY: IBM T. J. Watson Research Center, January 1987.

Fall 2014, Nov ELEC / Lecture Topics in Computer Architecture Instruction set Program execution through register transfer See Lectures Computer arithmetic (2’s complement, IEEE 754 floating point standard, addition, multiplication) Datapaths (single-cycle, multicycle, pipeline) Control (combinational logic, FSM, microcode) Pipelining (throughput, hazards, forwarding, stall, branch prediction) Memory organization (cache, virtual memory) Performance (benchmarks, energy efficiency, Amdal’s law) Advanced architectures (ILP, OOE, superscalar, etc.) Not discussed in this course: –Multiprocessors –Compiler and software techniques – loop unrolling, trace execution, etc. –Input and output –Power management

Fall 2014, Nov ELEC / Lecture One who claims to know much about computer architecture speaks from ignorance... because a lot is going to happen in the future, which is... Doris Day in Hitchcock’s 1956 Movie “The Man Who Knew Too Much”