Single Clock Datapath With Control

Slides:



Advertisements
Similar presentations
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Advertisements

Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
MIPS Pipelined Datapath
ECE 445 – Computer Organization
Pipelined Datapath and Control (Lecture #13) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
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.
CSCE 212 Quiz 9 – 3/30/11 1.What is the clock cycle time based on for single-cycle and for pipelining? 2.What two actions can be done to resolve data hazards?
1  1998 Morgan Kaufmann Publishers Chapter Six Enhancing Performance with Pipelining.
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.
Lecture 15: Pipelining and Hazards CS 2011 Fall 2014, Dr. Rozier.
Pipelined Datapath and Control
University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell CS352H: Computer Systems Architecture Topic 8: MIPS Pipelined.
Computer Organization CS224 Fall 2012 Lesson 28. Pipelining Analogy  Pipelined laundry: overlapping execution l Parallelism improves performance §4.5.
Morgan Kaufmann Publishers
Chapter 4 CSF 2009 The processor: Pipelining. Performance Issues Longest delay determines clock period – Critical path: load instruction – Instruction.
Chapter 4 The Processor CprE 381 Computer Organization and Assembly Level Programming, Fall 2012 Revised from original slides provided by MKP.
CMPE 421 Parallel Computer Architecture
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
1  1998 Morgan Kaufmann Publishers Chapter Six. 2  1998 Morgan Kaufmann Publishers Pipelining Improve perfomance by increasing instruction throughput.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
CSE431 L06 Basic MIPS Pipelining.1Irwin, PSU, 2005 MIPS Pipeline Datapath Modifications  What do we need to add/modify in our MIPS datapath? l State registers.
Introduction to Computer Organization Pipelining.
Lecture 9. MIPS Processor Design – Pipelined Processor Design #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
CPE432 Chapter 4B.1Dr. W. Abu-Sufah, UJ Chapter 4B: The Processor, Part B-1 Read Sections 4.7 Adapted from Slides by Prof. Mary Jane Irwin, Penn State.
CS203 – Advanced Computer Architecture Pipelining Review.
Pipeline Timing Issues
Stalling delays the entire pipeline
Pipelining Chapter 6.
CSCI206 - Computer Organization & Programming
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Pipeline Implementation (4.6)
Chapter 4 The Processor Part 4
CDA 3101 Spring 2016 Introduction to Computer Organization
ECE232: Hardware Organization and Design
Morgan Kaufmann Publishers The Processor
Processor Pipelining Yasser Mohammad.
Chapter 4 The Processor Part 3
Review: MIPS Pipeline Data and Control Paths
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Chapter 4 The Processor Part 2
Pipelining review.
Single-cycle datapath, slightly rearranged
Pipelining Chapter 6.
Current Design.
Morgan Kaufmann Publishers Enhancing Performance with Pipelining
Computer Organization CS224
Pipelining in more detail
CSCI206 - Computer Organization & Programming
CSCI206 - Computer Organization & Programming
Pipeline control unit (highly abstracted)
The Processor Lecture 3.6: Control Hazards
The Processor Lecture 3.5: Data Hazards
Pipeline control unit (highly abstracted)
CS203 – Advanced Computer Architecture
Pipelining: Basic Concepts
CSC3050 – Computer Architecture
Pipeline Control unit (highly abstracted)
Pipelining Chapter 6.
Morgan Kaufmann Publishers The Processor
Introduction to Computer Organization and Architecture
Pipelining Chapter 6.
Guest Lecturer: Justin Hsia
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:

Single Clock Datapath With Control Morgan Kaufmann Publishers 12 September, 2018 Single Clock Datapath With Control Chapter 4 — The Processor — 2 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 MIPS Pipeline Five stages, one step per stage IF: Instruction fetch from memory ID: Instruction decode & register read EX: Execute operation or calculate address MEM: Access memory operand WB: Write result back to register Chapter 4 — The Processor — 3 Chapter 4 — The Processor

MIPS Pipelined Datapath Morgan Kaufmann Publishers 12 September, 2018 MIPS Pipelined Datapath Chapter 4 — The Processor — 4 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 Pipeline registers Need registers between stages To hold information produced in previous cycle IF/ID ID/EX EX/MEM MEM/WB Chapter 4 — The Processor — 5 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 IF for Load, Store, … IF/ID ID/EX EX/MEM MEM/WB Chapter 4 — The Processor — 6 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 ID for Load, Store, … IF/ID ID/EX EX/MEM MEM/WB Chapter 4 — The Processor — 7 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 EX for Load IF/ID ID/EX EX/MEM MEM/WB Chapter 4 — The Processor — 8 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 MEM for Load IF/ID ID/EX EX/MEM MEM/WB Chapter 4 — The Processor — 9 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 WB for Load Wrong register number IF/ID ID/EX EX/MEM MEM/WB Chapter 4 — The Processor — 10 Chapter 4 — The Processor

Corrected Datapath for Load Morgan Kaufmann Publishers 12 September, 2018 Corrected Datapath for Load IF/ID ID/EX EX/MEM MEM/WB Chapter 4 — The Processor — 11 Chapter 4 — The Processor

Single-Cycle Pipeline Diagram Morgan Kaufmann Publishers 12 September, 2018 Single-Cycle Pipeline Diagram State of pipeline in a given cycle Chapter 4 — The Processor — 12 Chapter 4 — The Processor

Pipelining and ISA Design Morgan Kaufmann Publishers 12 September, 2018 Pipelining and ISA Design MIPS ISA designed for pipelining All instructions are 32-bits Easier to fetch and decode in one cycle c.f. x86: 1- to 17-byte instructions Few and regular instruction formats Can decode and read registers in one step Load/store addressing Can calculate address in 3rd stage, access memory in 4th stage Alignment of memory operands Memory access takes only one cycle Chapter 4 — The Processor — 13 Chapter 4 — The Processor

Pipeline Hazards Situations occur when the next instruction cannot be overlapped

Pipeline Hazards Situations occur when the next instruction cannot be overlapped Structural Hazards occur when the hardware cannot support the combination of instructions

Pipeline Hazards Situations occur when the next instruction cannot be overlapped Structural Hazards occur when the hardware cannot support the combination of instructions Control Hazards occur when a decision needs to be made while others are executing - a branch instruction

Pipeline Hazards Situations occur when the next instruction cannot be overlapped Structural Hazards occur when the hardware cannot support the combination of instructions Control Hazards occur when a decision needs to be made while others are executing - a branch instruction Data Hazards occur when an instruction depends on the results of a previous instruction still in the pipeline.

Structural Hazards occur when the hardware cannot support the combination of instructions 1. Design ISA for pipelining 2. Stall to clear - DELAY

Multi-Cycle Pipeline Diagram Morgan Kaufmann Publishers 12 September, 2018 Multi-Cycle Pipeline Diagram Form showing resource usage Write Reg first half – Read Reg second half Chapter 4 — The Processor

MIPS Pipelined Datapath Morgan Kaufmann Publishers 12 September, 2018 MIPS Pipelined Datapath MEM Right-to-left flow leads to hazards WB Chapter 4 — The Processor — 20 Chapter 4 — The Processor

Control Hazards occur when a decision needs to be made while others are executing - a branch instruction 1. Stall until branch can be resolved Some compilers can fill the delays with useful instructions.

Control Hazards occur when a decision needs to be made while others are executing - a branch instruction 1. Stall until branch can be resolved Some compilers can fill the delays with useful instructions. 2. Predict the branch decision. If correct, then full speed If wrong, nullify instructions following the wrong branch and restart the pipeline at the correct address

MIPS Pipelined Datapath Morgan Kaufmann Publishers 12 September, 2018 MIPS Pipelined Datapath MEM Right-to-left flow leads to hazards WB Chapter 4 — The Processor — 23 Chapter 4 — The Processor

Morgan Kaufmann Publishers 12 September, 2018 Data Hazards An instruction depends on completion of data access by a previous instruction add $s0, $t0, $t1 sub $t2, $s0, $t3 STALL Chapter 4 — The Processor — 24 Chapter 4 — The Processor

Data Hazards occur when an instruction depends on the results of a previous instruction still in the pipeline. 1. Stall 2. Reorder 3. Forwarding combined with stall and reorder

Forwarding (aka Bypassing) Morgan Kaufmann Publishers 12 September, 2018 Forwarding (aka Bypassing) Use result when it is computed Don’t wait for it to be stored in a register Requires extra connections in the datapath Chapter 4 — The Processor — 26 Chapter 4 — The Processor

Code Scheduling to Avoid Stalls Morgan Kaufmann Publishers 12 September, 2018 Code Scheduling to Avoid Stalls Reorder code to avoid use of load result in the next instruction C code for A = B + E; C = B + F; lw $t1, 0($t0) lw $t2, 4($t0) add $t3, $t1, $t2 sw $t3, 12($t0) lw $t4, 8($t0) add $t5, $t1, $t4 sw $t5, 16($t0) lw $t1, 0($t0) lw $t2, 4($t0) lw $t4, 8($t0) add $t3, $t1, $t2 sw $t3, 12($t0) add $t5, $t1, $t4 sw $t5, 16($t0) stall stall 13 cycles 11 cycles Chapter 4 — The Processor — 27 Chapter 4 — The Processor