An Introduction to pipelining

Slides:



Advertisements
Similar presentations
PipelineCSCE430/830 Pipeline: Introduction CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Prof. Yifeng Zhu, U of Maine Fall,
Advertisements

CMPT 334 Computer Organization
Introduction to PipelineCS510 Computer ArchitecturesLecture Lecture 6 Introduction to Pipelining.
Review: Pipelining. Pipelining Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 30 minutes Dryer.
Pipelining I (1) Fall 2005 Lecture 18: Pipelining I.
Pipelining Hwanmo Sung CS147 Presentation Professor Sin-Min Lee.
EECS 318 CAD Computer Aided Design LECTURE 2: DSP Architectures Instructor: Francis G. Wolff Case Western Reserve University This presentation.
ENGS 116 Lecture 41 Instruction Set Design Part II Introduction to Pipelining Vincent H. Berk September 28, 2005 Reading for today: Chapter 2.1 – 2.12,
CS252/Patterson Lec 1.1 1/17/01 Pipelining: Its Natural! Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer.
CIS429/529 Winter 2007 Pipelining-1 1 Pipeling RISC/MIPS64 five stage pipeline Basic pipeline performance Pipeline hazards Branch hazards More pipeline.
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
Computer ArchitectureFall 2007 © October 22nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
DLX Instruction Format
Pipelining Datapath Adapted from the lecture notes of Dr. John Kubiatowicz (UC Berkeley) and Hank Walker (TAMU)
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Sep 9, 2002 Topic: Pipelining Basics.
1 Atanasoff–Berry Computer, built by Professor John Vincent Atanasoff and grad student Clifford Berry in the basement of the physics building at Iowa State.
CS 61C L30 Introduction to Pipelined Execution (1) Garcia, Fall 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Computer ArchitectureFall 2008 © October 6th, 2008 Majd F. Sakr CS-447– Computer Architecture.
Pipelining Basics Assembly line concept An instruction is executed in multiple steps Multiple instructions overlap in execution A step in a pipeline is.
Introduction to Pipelining Rabi Mahapatra Adapted from the lecture notes of Dr. John Kubiatowicz (UC Berkeley)
9.2 Pipelining Suppose we want to perform the combined multiply and add operations with a stream of numbers: A i * B i + C i for i =1,2,3,…,7.
CSC 4250 Computer Architectures September 15, 2006 Appendix A. Pipelining.
Lecture 7: Pipelining Review Kai Bu
COMP381 by M. Hamdi 1 Pipelining Improving Processor Performance with Pipelining.
Lecture 5: Pipelining Implementation Kai Bu
Computer Science Education
Integrated Circuits Costs
B 0000 Pipelining ENGR xD52 Eric VanWyk Fall
EEL5708 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Pipelining.
Analogy: Gotta Do Laundry
1 Designing a Pipelined Processor In this Chapter, we will study 1. Pipelined datapath 2. Pipelined control 3. Data Hazards 4. Forwarding 5. Branch Hazards.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
1 Pipelining Part I CS What is Pipelining? Like an Automobile Assembly Line for Instructions –Each step does a little job of processing the instruction.
ECE 232 L18.Pipeline.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 18 Pipelining.

CSIE30300 Computer Architecture Unit 04: Basic MIPS Pipelining Hsin-Chou Chi [Adapted from material by and
Processor Design CT101 – Computing Systems. Content GPR processor – non pipeline implementation Pipeline GPR processor – pipeline implementation Performance.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
Pipelining Example Laundry Example: Three Stages
CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
CS252/Patterson Lec 1.1 1/17/01 معماري کامپيوتر - درس نهم pipeline برگرفته از درس : Prof. David A. Patterson.
EE524/CptS561 Jose G. Delgado-Frias 1 Processor Basic steps to process an instruction IFID/OFEXMEMWB Instruction Fetch Instruction Decode / Operand Fetch.
Lecture 9. MIPS Processor Design – Pipelined Processor Design #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Advanced Computer Architecture CS 704 Advanced Computer Architecture Lecture 10 Computer Hardware Design (Pipeline Datapath and Control Design) Prof. Dr.
Lecture 5. MIPS Processor Design Pipelined MIPS #1 Prof. Taeweon Suh Computer Science & Engineering Korea University COSE222, COMP212 Computer Architecture.
Lecture 18: Pipelining I.
Computer Organization
Pipelines An overview of pipelining
Review: Instruction Set Evolution
Pipelining concepts, datapath and hazards
CMSC 611: Advanced Computer Architecture
ECE232: Hardware Organization and Design
School of Computing and Informatics Arizona State University
Chapter 3: Pipelining 순천향대학교 컴퓨터학부 이 상 정 Adapted from
CPE 631 Lecture 03: Review: Pipelining, Memory Hierarchy
Chapter 4 The Processor Part 2
CMSC 611: Advanced Computer Architecture
Morgan Kaufmann Publishers Enhancing Performance with Pipelining
Lecturer: Alan Christopher
Serial versus Pipelined Execution
The Processor Lecture 3.4: Pipelining Datapath and Control
Chapter 8. Pipelining.
Pipelining Appendix A and Chapter 3.
Introduction to Computer Organization and Architecture
Lecture 06: Pipelining Implementation
A relevant question Assuming you’ve got: One washer (takes 30 minutes)
Recall: Performance Evaluation
Pipelining.
Presentation transcript:

An Introduction to pipelining Lecture 7 An Introduction to pipelining

Pipelining: Its Natural! Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 30 minutes Dryer takes 40 minutes “Folder” takes 20 minutes A B C D

Sequential Laundry Sequential laundry takes 6 hours for 4 loads 6 PM 7 8 9 10 11 Midnight Time 30 40 20 30 40 20 30 40 20 30 40 20 T a s k O r d e A B C D Sequential laundry takes 6 hours for 4 loads If they learned pipelining, how long would laundry take?

Pipelined Laundry Start work ASAP 6 PM 7 8 9 10 11 Midnight Time 30 40 20 T a s k O r d e A B C D Pipelined laundry takes 3.5 hours for 4 loads

Pipelining Lessons 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 6 PM 7 8 9 Time T a s k O r d e 30 40 20 A B C D

Definitions Pipe stage or pipe segment Pipeline depth Machine cycle Latency Throughput

Design Issues Balance the length of each pipeline stage Problems Depth of the pipeline Throughput = Time per instruction on unpipelined machine Problems Usually, stages are not balanced Pipelining overhead Hazards (conflicts) Performance (throughput CPU performance equation) Decrease of the CPI Decrease of cycle time

DLX Implementation Integer subset of DLX Unpipelined implementation load/store word branch integer ALU NO jumps, NO FP Unpipelined implementation maximum five cycles per instruction

Instruction Formats I opcode rs1 rd immediate R opcode rs1 rs2 rd 5 6 10 11 15 16 31 R opcode rs1 rs2 rd function 5 6 10 11 15 16 20 21 31 J opcode name 5 6 31 Fixed-field decoding

1st and 2nd Instruction cycles Instruction fetch (IF) IR Mem[PC]; NPC PC + 4 Instruction decode & register fetch (ID) A Regs[IR6..10]; B Regs[IR11..15]; Imm ((IR16)16 # # IR16..31)

3rd Instruction cycle Execution & effective address (EX) Memory reference ALUOutput A + Imm Register - Register ALU instruction ALUOutput A func B Register - Immediate ALU instruction ALUOutput A op Imm Branch ALUOutput NPC + Imm; Cond (A op 0)

4th Instruction cycle Memory access & branch completion (MEM) Memory reference PC NPC LMD Mem[ALUOutput] (load) Mem[ALUOutput] B (store) Branch if (cond) PC ALUOutput; else PC NPC

5th Instruction cycle Write-back (WB) Register - register ALU instruction Regs[IR16..20] ALUOutput Register - immediate ALU instruction Regs[IR11..15] ALUOutput Load instruction Regs[IR11..15] LMD

Datapath IF ID EX MEM WB Mux Zero? Cond Add 4 Mux Mux A PC ALU Output NPC 4 Mux Mux A PC ALU Output LMD Instr. Cache ALU IR Regs Data Cache Mux B Sign extend Imm IF ID EX MEM WB

Control Step 1 Step 2 Step 3 Step 3 Step 3 Step 3 Step 4 Step 4 Step 4 Load RR ALU Store Imm Step 3 Step 3 Step 3 Step 3 Step 4 Step 4 Step 4 Step 4 Step 5

Basic Pipeline Clock number 1 2 3 4 5 6 7 8 9 Instr # i i +1 i +2 i +3 1 2 3 4 5 6 7 8 9 Instr # IF ID EX MEM WB i i +1 IF ID EX MEM WB i +2 IF ID EX MEM WB i +3 IF ID EX MEM WB i +4 IF ID EX MEM WB

Pipeline Resources Reg IM DM Reg Reg IM DM Reg Reg IM DM Reg Reg IM DM ALU Reg IM DM Reg ALU Reg IM DM Reg ALU Reg IM DM Reg ALU Reg IM DM Reg ALU

Pipelined Datapath MEM/WB IF/ID ID/EX EX/MEM Mux 4 Zero? Add Mux Mux PC Instr. Cache ALU Regs Data Cache Mux Sign extend

Performance limitations Imbalance among pipe stages limits cycle time to slowest stage Pipelining overhead Pipeline register delay Clock skew Clock cycle > clock skew + latch overhead