Pipelining III Andreas Klappenecker CPSC321 Computer Architecture.

Slides:



Advertisements
Similar presentations
Morgan Kaufmann Publishers The Processor
Advertisements

1 Pipelining Part 2 CS Data Hazards Data hazards occur when the pipeline changes the order of read/write accesses to operands that differs from.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Pipelined Processor II (cont’d) CPSC 321
11/1/2005Comp 120 Fall November Exam Postmortem 11 Classes to go! Read Sections 7.1 and 7.2 You read 6.1 for this time. Right? Pipelining then.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Pipeline Hazards See: P&H Chapter 4.7.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Pipelined Processor.
Pipelining II Andreas Klappenecker CPSC321 Computer Architecture.
1  1998 Morgan Kaufmann Publishers Chapter Six Enhancing Performance with Pipelining.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
©UCB CS 162 Computer Architecture Lecture 3: Pipelining Contd. Instructor: L.N. Bhuyan
Chapter Six Enhancing Performance with Pipelining
Pipelining Andreas Klappenecker CPSC321 Computer Architecture.
1 Chapter Six - 2nd Half Pipelined Processor Forwarding, Hazards, Branching EE3055 Web:
1 Stalling  The easiest solution is to stall the pipeline  We could delay the AND instruction by introducing a one-cycle delay into the pipeline, sometimes.
L18 – Pipeline Issues 1 Comp 411 – Spring /03/08 CPU Pipelining Issues Finishing up Chapter 6 This pipe stuff makes my head hurt! What have you.
L17 – Pipeline Issues 1 Comp 411 – Fall /1308 CPU Pipelining Issues Finishing up Chapter 6 This pipe stuff makes my head hurt! What have you been.
Pipelined Processor II CPSC 321 Andreas Klappenecker.
1 CSE SUNY New Paltz Chapter Six Enhancing Performance with Pipelining.
The Datapath Andreas Klappenecker CPSC321 Computer Architecture.
7/2/ _23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering.
Pipelined Datapath and Control (Lecture #15) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
Computer Architecture - A Pipelined Datapath A Pipelined Datapath  Resisters are used to save data between stages. 1/14.
1  1998 Morgan Kaufmann Publishers Chapter Six Enhancing Performance with Pipelining.
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve performance by increasing instruction throughput.
1 Pipelining Reconsider the data path we just did Each instruction takes from 3 to 5 clock cycles However, there are parts of hardware that are idle many.
Automobile Manufacturing 1. Build frame. 60 min. 2. Add engine. 50 min. 3. Build body. 80 min. 4. Paint. 40 min. 5. Finish.45 min. 275 min. Latency: Time.
Chapter 4 CSF 2009 The processor: Pipelining. Performance Issues Longest delay determines clock period – Critical path: load instruction – Instruction.
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
11/13/2015 8:57 AM 1 of 86 Pipelining Chapter 6. 11/13/2015 8:57 AM 2 of 86 Overview of Pipelining Pipelining is an implementation technique in which.
CMPE 421 Parallel Computer Architecture
Electrical and Computer Engineering University of Cyprus LAB3: IMPROVING MIPS PERFORMANCE WITH PIPELINING.
Chapter 6 Pipelined CPU Design. Spring 2005 ELEC 5200/6200 From Patterson/Hennessey Slides Pipelined operation – laundry analogy Text Fig. 6.1.
Chap 6.1 Computer Architecture Chapter 6 Enhancing Performance with Pipelining.
Chapter 6: Pipelining Instructor: Mozafar Bag Mohammadi University of Ilam.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
Computing Systems Pipelining: enhancing performance.
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve perfomance by increasing instruction throughput.
1/24/ :00 PM 1 of 86 Pipelining Chapter 6. 1/24/ :00 PM 2 of 86 Overview of Pipelining Pipelining is an implementation technique in which.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Csci 136 Computer Architecture II – Superscalar and Dynamic Pipelining Xiuzhen Cheng
L17 – Pipeline Issues 1 Comp 411 – Fall /23/09 CPU Pipelining Issues Read Chapter This pipe stuff makes my head hurt! What have you been.
Pipelining: Implementation CPSC 252 Computer Organization Ellen Walker, Hiram College.
Chapter Six.
Stalling delays the entire pipeline
Computer Architecture
Single Clock Datapath With Control
Pipeline Implementation (4.6)
ECS 154B Computer Architecture II Spring 2009
ECS 154B Computer Architecture II Spring 2009
\course\cpeg323-08F\Topic6b-323
Chapter 4 The Processor Part 3
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Pipelining review.
Pipelining Chapter 6.
Current Design.
Lecture 9. MIPS Processor Design – Pipelined Processor Design #2
Pipelining in more detail
\course\cpeg323-05F\Topic6b-323
Lecture 5. MIPS Processor Design
Chapter Six.
Chapter Six.
Control unit extension for data hazards
November 5 No exam results today. 9 Classes to go!
Control unit extension for data hazards
Introduction to Computer Organization and Architecture
Control unit extension for data hazards
Spring 2010 Ilam University
ELEC / Computer Architecture and Design Spring 2015 Pipeline Control and Performance (Chapter 6) Vishwani D. Agrawal James J. Danaher.
Presentation transcript:

Pipelining III Andreas Klappenecker CPSC321 Computer Architecture

Administrative Issues Talk by Laszlo Kish Quantum Computing Seminar, Thursday 10:00am-11:00am, HRBB 302 Projects: Get started!!!

Pipelined Datapath Pipeline separation registers, width varies

Control Lines Instruction fetch: control signal to read instruction memory and to write PC are always asserted - nothing special here Instruction decode/register file read: same thing happens every clock cycle, so no optional control lines to set Execution/address calculation RegDst selects the result register, ALUOp selects the ALU operation ALUSrc selects Read data 2 or sign-extd. immediate

Pipelined Datapath w/ Controls Signals

Control Lines Memory access Branch set by branch equal MemRead set by load instructions MemWrite set by store instructions Write back MemtoReg send ALU result or memory value RegWrite selects register

Pipelined Datapath w/ Controls Signals

Pass control signals along just like the data Pipeline Control

Datapath with Control

Assume that the compiler has to guarantee that no hazards occur Where do we insert the “nops” ? sub$2, $1, $3 and $12, $2, $5 or$13, $6, $2 add$14, $2, $2 sw$15, 100($2) Data Hazards

Data hazard: a dependency that “goes backward in time” Dependencies

Solution sub$2, $1, $3 nop and $12, $2, $5 or$13, $6, $2 add$14, $2, $2 sw$15, 100($2) Problem: this slows us down! Resolution of Data Hazards

Forwarding Do not wait until result have been written Use temporary results! Use register file forwarding to handle read/write to same register ALU forwarding

Forwarding

Load word can still cause a hazard: an instruction trying to read a register following a load instruction writing to the same register. Need a hazard detection unit to “stall” pipeline Obstructions to Forwarding

Stalling We can stall the pipeline by keeping an instruction in the same stage

Hazard Detection Unit Stall by letting an instruction that won’t write anything go forward

When we decide to branch, other instructions are in the pipeline! We are predicting “branch not taken” need to add hardware for flushing instructions if we are wrong Branch Hazards

Flushing Move branch decision from 4th pipeline stage to the second only one instruction following the branch will be in the pipeline IF.Flush turns fetched instruction into a nop by zeroing the IF/ID pipeline register

Flushing Instructions

Improving Performance Try and avoid stalls by reordering instructions Add a “branch delay slot” the next instruction after a branch is always executed rely on compiler to “fill” the slot with something useful Superscalar: start more than one instruction in the same cycle

Dynamic Scheduling The hardware performs the “scheduling” hardware tries to find instructions to execute out of order execution is possible speculative execution and dynamic branch prediction All modern processors are very complicated DEC Alpha 21264: 9 stage pipeline, 6 instruction issue PowerPC and Pentium: branch history table Compiler technology important This class has given you the background you need to learn more - read Chapter 6! More material will be posted!