PROCESSOR PIPELINING YASSER MOHAMMAD. SINGLE DATAPATH DESIGN.

Slides:



Advertisements
Similar presentations
Pipelining and Control Hazards Oct
Advertisements

Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
MIPS Pipelined Datapath
Pipeline Hazards CS365 Lecture 10. D. Barbara Pipeline Hazards CS465 2 Review  Pipelined CPU  Overlapped execution of multiple instructions  Each on.
ECE 445 – Computer Organization
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Pipelined Processor.
Part 2 - Data Hazards and Forwarding 3/24/04++
Review: MIPS Pipeline Data and Control Paths
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 18 - Pipelined.
Chapter Six Enhancing Performance with Pipelining
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.
Computer Organization Lecture Set – 06 Chapter 6 Huei-Yung Lin.
Pipelined Datapath and Control (Lecture #15) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
Lecture 28: Chapter 4 Today’s topic –Data Hazards –Forwarding 1.
Lecture 15: Pipelining and Hazards CS 2011 Fall 2014, Dr. Rozier.
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.
Memory/Storage Architecture Lab Computer Architecture Pipelining Basics.
Pipeline Data Hazards: Detection and Circumvention Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly.
Pipelined Datapath and Control
Chapter 4 CSF 2009 The processor: Pipelining. Performance Issues Longest delay determines clock period – Critical path: load instruction – Instruction.
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.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
2/15/02CSE Data Hazzards Data Hazards in the Pipelined Implementation.
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.
University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell CS352H: Computer Systems Architecture Topic 9: MIPS Pipeline.
CSIE30300 Computer Architecture Unit 05: Overcoming Data Hazards Hsin-Chou Chi [Adapted from material by and
Introduction to Computer Organization Pipelining.
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.
Pipelining: Implementation CPSC 252 Computer Organization Ellen Walker, Hiram College.
CSE 340 Computer Architecture Spring 2016 Overcoming Data Hazards.
Interstage Buffers 1 Computer Organization II © McQuain Pipeline Timing Issues Consider executing: add $t2, $t1, $t0 sub $t3, $t1, $t0 or.
Pipeline Timing Issues
Computer Organization CS224
Stalling delays the entire pipeline
Pipelining Chapter 6.
Morgan Kaufmann Publishers The Processor
Single Clock Datapath With Control
Pipeline Implementation (4.6)
Appendix C Pipeline implementation
Morgan Kaufmann Publishers The Processor
ECS 154B Computer Architecture II Spring 2009
ECE232: Hardware Organization and Design
Morgan Kaufmann Publishers The Processor
Pipelining: Advanced ILP
Chapter 4 The Processor Part 3
Review: MIPS Pipeline Data and Control Paths
Csci 136 Computer Architecture II – Data Hazard, Forwarding, Stall
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Pipelining Chapter 6.
The processor: Pipelining and Branching
Current Design.
Computer Organization CS224
Computer Architecture
Pipelined Control (Simplified)
The Processor Lecture 3.6: Control Hazards
Control unit extension for data hazards
The Processor Lecture 3.5: Data Hazards
Pipelining: Basic Concepts
CSC3050 – Computer Architecture
Pipelining (II).
Control unit extension for data hazards
Morgan Kaufmann Publishers The Processor
Control unit extension for data hazards
Pipelined Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Systems Architecture II
MIPS Pipelined Datapath
Problem ??: (?? marks) Consider executing the following code on the MIPS pipelined datapath: add $t5, $t6, $t8 add $t9, $t5, $t4 lw $t3, 100($t9) sub $t2,
Presentation transcript:

PROCESSOR PIPELINING YASSER MOHAMMAD

SINGLE DATAPATH DESIGN

ELEMENT USAGE DURING EXECUTION

ENTER STAGE REGISTERS

SEQUENCE OF OPERATION OF A LW INSTRUCTION

CORRECTED WB IN LW

LW

THIRD STAGE OF SW

KEY POINTS  Each component can be used in at most one stage to avoid structural hazards  Data needed in later stages can be passed through stage registered from the generating stage  Always check where current addresses are coming from

DRAWING PIPELINES

DESIGNING A CONTROLLER FOR THE PIPELINE  Take as much as you can from the single clock cycle design  See the world using rose-colored glasses  Steps:  Label the lines  Divide control lines per stage (remember one component one stage)  Design a control circuit for each

THE LINES

ALU CONTROL

CONTROL LINES

CONTROL SIGNAL PASSING

THE COMPLETE BEAST

HAZARDS  sub $2, $1,$3  and $12,$2,$5  or $13,$6,$2  add $14,$2,$2  sw $15,100($2)

IN THE PIPELINE 1a. EX/MEM.RegisterRd = ID/EX.RegisterRs 1b. EX/MEM.RegisterRd = ID/EX.RegisterRt 2a. MEM/WB.RegisterRd = ID/EX.RegisterRs 2b. MEM/WB.RegisterRd = ID/EX.RegisterRt

FORWARDING HARDWARE  Ignores forwarding to a store

LOOK CAREFULLY. ANY HAZARDS?

THE DATAPATH WITH FORWARDING AND ITS CONTROL

Lw $s0, 0($s1) Sw $s0,4($s1)

DEALING WITH THE IMMEDIATE

WHEN STALLING IS A MUST …. How many stalls will we need: Without forwarding? With Forwarding?

NOTES ON STALLING  When stalling in ID, we must stall in IF. Why?  How? Freeze PC and IF/ID

SRALLING + FORWARDING HARDWARE

CONTROL HAZARDS

RESOLUTION 1: PREDICT BRANCH TAKEN  Continue fetching  If the branch is taken (known in the MEM stage of the branch)  Set all control signals in IF/ID, ID/EX,EX/MEM to unasserted (0)  DONE

RESOLUTION 2: DECIDE EARLIER  Most branches use simple tests that do not require a complete ALU  What do we need?  Calculate the address of the branch early  Add an ADDER in the ID stage  Compute the decision to branch early  More involved but can be done in ID(for equality at least)  Another source of data hazards. What is it?  New logic is needed to forward to ID from EX/MEM or MEM/WB  Extra sources of stalling:  R-instruction followed by branch  Load followed by branch Forwarding TO the barnch in ID One stall Two stalls

DYNAMIC BRANCH PREDICTION  Branch prediction buffer  Branch history table  Indexed by LSBs of the branch address  Prediction helps in decision calculation but not address calculation  Use Delayed branch  Branch target buffer  Global branch behavior  Tournament predictors

DELAYED BRANCH  Only effective for short pipelines  The compiler/assembler is responsible of rescheduling.

PUTTING IT ALL TOGETHER

EXCEPTIONS AND INTERRUPTS  Arithmetic overflow  Undefined instruction  Basic action  Save PC to EPC and Cause to Cause  call the OS (by jumping to 0x )  How does the OS know the reason of the exception:  Cause register (MIPS)  Vectored interrupts (x86)

PIPELINED IMPLEMENTATION  Exceptions are control hazards