Pipeline: Introduction

Similar documents
Computer Architecture. Lecture 6.1: Fundamentals of

CPS104 Computer Organization and Programming Lecture 19: Pipelining. Robert Wagner

ELCT 501: Digital System Design

Outline Marquette University

Computer Systems Architecture Spring 2016

Pipelining. Maurizio Palesi

CS 110 Computer Architecture. Pipelining. Guest Lecture: Shu Yin. School of Information Science and Technology SIST

Lecture 6: Pipelining

Chapter 8. Pipelining

MIPS Pipelining. Computer Organization Architectures for Embedded Computing. Wednesday 8 October 14

Pipelining: Overview. CPSC 252 Computer Organization Ellen Walker, Hiram College

Page 1. Pipelining: Its Natural! Chapter 3. Pipelining. Pipelined Laundry Start work ASAP. Sequential Laundry A B C D. 6 PM Midnight

Chapter 3 & Appendix C Pipelining Part A: Basic and Intermediate Concepts

Pipeline Processors David Rye :: MTRX3700 Pipelining :: Slide 1 of 15

EITF20: Computer Architecture Part2.2.1: Pipeline-1

CS 61C: Great Ideas in Computer Architecture Control and Pipelining

EITF20: Computer Architecture Part2.2.1: Pipeline-1

Working on the Pipeline

CPE Computer Architecture. Appendix A: Pipelining: Basic and Intermediate Concepts

Pipelining, Instruction Level Parallelism and Memory in Processors. Advanced Topics ICOM 4215 Computer Architecture and Organization Fall 2010

EITF20: Computer Architecture Part2.2.1: Pipeline-1

Modern Computer Architecture

COMP2611: Computer Organization. The Pipelined Processor

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

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

Lecture 3. Pipelining. Dr. Soner Onder CS 4431 Michigan Technological University 9/23/2009 1

Module 4c: Pipelining

Typical DSP application

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

Chapter 5 (a) Overview

The Processor Pipeline. Chapter 4, Patterson and Hennessy, 4ed. Section 5.3, 5.4: J P Hayes.

ECE260: Fundamentals of Computer Engineering

Lecture 19 Introduction to Pipelining

Lecture 15: Pipelining. Spring 2018 Jason Tang

Overview. Appendix A. Pipelining: Its Natural! Sequential Laundry 6 PM Midnight. Pipelined Laundry: Start work ASAP

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content

Appendix A. Overview

CSE 141 Computer Architecture Spring Lectures 11 Exceptions and Introduction to Pipelining. Announcements

Pipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome

Pipelining concepts The DLX architecture A simple DLX pipeline Pipeline Hazards and Solution to overcome

ECE331: Hardware Organization and Design

Topics. Lecture 12: Pipelining. Introduction to pipelining. Pipelined datapath. Hazards in pipeline. Performance. Design issues.

EECS150 - Digital Design Lecture 09 - Parallelism

Midnight Laundry. IC220 Set #19: Laundry, Co-dependency, and other Hazards of Modern (Architecture) Life. Return to Chapter 4

ECEC 355: Pipelining

Pipelining Analogy. Pipelined laundry: overlapping execution. Parallelism improves performance. Four loads: Non-stop: Speedup = 8/3.5 = 2.3.

Introduction to Pipelining. Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T.

Pipelining: Hazards Ver. Jan 14, 2014

Pipelining: Basic and Intermediate Concepts

Pipeline Review. Review

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

CPE 335 Computer Organization. Basic MIPS Pipelining Part I

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 14 EE141

ECE 154A Introduction to. Fall 2012

Lecture 05: Pipelining: Basic/ Intermediate Concepts and Implementation

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

Outline. Pipelining basics The Basic Pipeline for DLX & MIPS Pipeline hazards. Handling exceptions Multi-cycle operations

Pipelining. CSC Friday, November 6, 2015

Processor Design CSCE Instructor: Saraju P. Mohanty, Ph. D. NOTE: The figures, text etc included in slides are borrowed

Design a MIPS Processor (2/2)

Chapter 4 (Part II) Sequential Laundry

ECE473 Computer Architecture and Organization. Pipeline: Control Hazard

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

What is Pipelining? Time per instruction on unpipelined machine Number of pipe stages

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

PIPELINING. Pipelining: Natural Phenomenon. Pipelining. Pipelining Lessons

The Pipelined MIPS Processor

Lecture 7 Pipelining. Peng Liu.

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Topics. Pipelining Lessons (Task, Resource) Pipelining Lessons (Time cycles) Pipelining is Natural! Laundry Example

Computer Architecture

Processor (II) - pipelining. Hwansoo Han

ECE331: Hardware Organization and Design

Lecture 8 Introduction to Pipelines Adapated from slides by David Patterson

EE 457 Unit 6a. Basic Pipelining Techniques

Advanced Parallel Architecture Lessons 5 and 6. Annalisa Massini /2017

Full Datapath. Chapter 4 The Processor 2

ECE232: Hardware Organization and Design

The Big Picture Problem Focus S re r g X r eg A d, M lt2 Sub u, Shi h ft Mac2 M l u t l 1 Mac1 Mac Performance Focus Gate Source Drain BOX

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Pipelining. Principles of pipelining Pipeline hazards Remedies. Pre-soak soak soap wash dry wipe. l Chapter 4.4 and 4.5

ENGN 2910A Homework 03 (140 points) Due Date: Oct 3rd 2013

Processor Architecture

Serial. Parallel. CIT 668: System Architecture 2/14/2011. Topics. Serial and Parallel Computation. Parallel Computing

MIPS ISA AND PIPELINING OVERVIEW Appendix A and C

CMSC Computer Architecture Lecture 4: Single-Cycle uarch and Pipelining. Prof. Yanjing Li University of Chicago

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

CSCI-564 Advanced Computer Architecture

Chapter 4. The Processor

Instr. execution impl. view

Instruction Level Parallelism. Appendix C and Chapter 3, HP5e

微算機系統第六章. Enhancing Performance with Pipelining 陳伯寧教授電信工程學系國立交通大學. Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold

Data Hazards Compiler Scheduling Pipeline scheduling or instruction scheduling: Compiler generates code to eliminate hazard

ECE260: Fundamentals of Computer Engineering

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining

CENG 3531 Computer Architecture Spring a. T / F A processor can have different CPIs for different programs.

SI232 Set #20: Laundry, Co-dependency, and other Hazards of Modern (Architecture) Life. Chapter 6 ADMIN. Reading for Chapter 6: 6.1,

COMPUTER ORGANIZATION AND DESIGN

MC9211Computer Organization. Unit 4 Lesson 1 Processor Design

Transcription:

Pipeline: Introduction These slides are derived from: CSCE430/830 Computer Architecture course by Prof. Hong Jiang and Dave Patterson UCB Some figures and tables have been derived from : Computer System Architecture by M. Morris Mano

Pipelining Outline Introduction Defining Pipelining Pipelining Instructions Hazards Structural hazards Data Hazards Control Hazards

What is Pipelining? A way of speeding up execution of instructions Key idea: overlap execution of multiple instructions

The Laundry Analogy Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold A B C D Washer takes 30 minutes Dryer takes 30 minutes Folder takes 30 minutes Stasher takes 30 minutes to put clothes into drawers

If we do laundry sequentially... 6 PM 7 8 9 10 11 12 1 2 AM 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 T a sk O rd e r A B C D Time

To Pipeline, We Overlap Tasks 12 2 AM 6 PM 7 8 9 10 11 1 T a sk O rd e r A B C D 30 30 30 30 30 30 30 Time Pipelining doesn t help latency of single task, it helps throughput of entire workload Pipeline rate limited by slowest pipeline stage Multiple tasks operating simultaneously Potential speedup = Number pipe stages Unbalanced lengths of pipe stages reduces speedup Time to fill pipeline and time to drain it reduces speedup 12

Pipelining a Digital System Key idea: break big computation up into pieces Separate each piece with a pipeline register 1ns 200ps 200ps 200ps 200ps 200ps Pipeline Register

Pipelining a Digital System Why do this? Because it's faster for repeated computations Non-pipelined: 1 operation finishes every 1ns 1ns Pipelined: 1 operation finishes every 200ps 200ps 200ps 200ps 200ps 200ps

Comments about pipelining Pipelining increases throughput, but not latency Answer available every 200ps, BUT -A single computation still takes 1ns Limitations: -Computations must be divisible into stage size -Pipeline registers add overhead

Suppose we need to perform multiply and add operation with a stream of numbers Each subinstruction is implemented in a segment within the pipeline. Each segment has one or two regsiters and a combinational circuit The sub operations performed in each segement are as follows

Example of Pipeline Processing

Content of Registers in Pipeline

Space Time Diagram of Pipeline

Speedup Speedup from pipeline = Average instruction time unpiplined/average instruction time pipelined Consider a case for k-segment pipeline with a clock cycle time tp to execute n tasks. The first task T1 requires a time equal to k*tp to complete its operation since there are k segments in pipeline. The remaining n-1 tasks emerge from the pipe at a rate of one task per clock cycle and they will be completed in k+n-1 clock cycles. Next, to concsider an unpipeline unit that performs the same operation and takes a time equal to tn to complete the task. The total time required fro n tasks is n*tn. The speed up of a pipeline processing over an equivalent non-pipeline processing is defined by the ratio

Speedup As the number of tasks increase n becomes much larger than k-1, and k+n-1 approaches the value of n. Under this condition, the speed up becomes If we assume the the time taken to process the task is the same as in the pipeline and nonpipeline circuits, we will have The speedup then reduces to numer of stages of pipeline

Pipelining a Processor Recall the 5 steps in instruction execution: 1. Instruction Fetch (IF) 2. Instruction Decode and Register Read (ID) 3. Execution operation or calculate address (EX) 4. Memory access (MEM) 5. Write result into register (WB) Review: Single-Cycle Processor All 5 steps done in a single clock cycle Dedicated hardware required for each step

Review - Single-Cycle Processor

The Basic Pipeline For MIPS Cycle 1Cycle 2 Cycle 3 Cycle 4Cycle 5 Cycle 6Cycle 7 I n s t r. Ifetch Reg Ifetch ALU Reg DMem ALU Reg DMem Reg O r d e r Ifetch Reg Ifetch ALU Reg DMem ALU Reg DMem Reg

Basic Pipelined Processor

Single-Cycle vs. Pipelined Execution Non-Pipelined Instruction Order lw $1, 100($0) lw $2, 200($0) lw $3, 300($0) 0 200 400 600 800 1000 1200 1400 1600 1800 Instruction Fetch REG RD ALU 800ps MEM REG WR Instruction Fetch REG RD ALU 800ps MEM REG WR Instruction Fetch Time Pipelined Instruction Order lw $1, 100($0) lw $2, 200($0) lw $3, 300($0) 0 200 400 600 800 1000 1200 1400 1600 Instruction Fetch 200ps REG RD Instruction Fetch 200ps ALU REG RD Instruction Fetch MEM ALU REG RD REG WR MEM ALU REG WR MEM REG WR 200ps 200ps 200ps 200ps 200ps 800ps Time

Comments about Pipelining The good news - Multiple instructions are being processed at same time - This works because stages are isolated by registers - Best case speedup of N The bad news - Instructions interfere with each other - hazards Example: different instructions may need the same piece of hardware (e.g., memory) in same clock cycle Example: instruction may require a result produced by an earlier instruction that is not yet complete

Pipeline Hazards Limits to pipelining: Hazards prevent next instruction from executing during its designated clock cycle Structural hazards: two different instructions use same h/w in same cycle Data hazards: Instruction depends on result of prior instruction still in the pipeline Control hazards: Pipelining of branches & other instructions that change the PC