Introduction to Computer Organization Pipelining.

Slides:



Advertisements
Similar presentations
Morgan Kaufmann Publishers The Processor
Advertisements

Pipeline Exceptions & ControlCSCE430/830 Pipelining in MIPS MIPS architecture was designed to be pipelined –Simple instruction format (makes IF, ID easy)
CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
The Pipelined CPU Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Revised 9/22/2013.
ELEN 468 Advanced Logic Design
CMPT 334 Computer Organization
Goal: Describe Pipelining
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Pipelined Processor.
Computer Organization
Pipelining II Andreas Klappenecker CPSC321 Computer Architecture.
1  1998 Morgan Kaufmann Publishers Chapter Six Enhancing Performance with Pipelining.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania Computer Organization Pipelined Processor Design 1.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
Chapter Six Enhancing Performance with Pipelining
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
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?
Pipelined Processor II CPSC 321 Andreas Klappenecker.
Appendix A Pipelining: Basic and Intermediate Concepts
1  1998 Morgan Kaufmann Publishers Chapter Six Enhancing Performance with Pipelining.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 17 - Pipelined.
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.
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.
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
Chapter 4 The Processor. Chapter 4 — The Processor — 2 Introduction We will examine two MIPS implementations A simplified version A more realistic pipelined.
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
Chapter 6 Pipelined CPU Design. Spring 2005 ELEC 5200/6200 From Patterson/Hennessey Slides Pipelined operation – laundry analogy Text Fig. 6.1.
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.
Pipelining Example Laundry Example: Three Stages
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
LECTURE 7 Pipelining. DATAPATH AND CONTROL We started with the single-cycle implementation, in which a single instruction is executed over a single cycle.
1. Convert the RISCEE 1 Architecture into a pipeline Architecture (like Figure 6.30) (showing the number data and control bits). 2. Build the control line.
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
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.
10/11: Lecture Topics Execution cycle Introduction to pipelining
Lecture 9. MIPS Processor Design – Pipelined Processor Design #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
CS203 – Advanced Computer Architecture Pipelining Review.
Chapter Six.
CDA3101 Recitation Section 8
Pipelining Chapter 6.
CSCI206 - Computer Organization & Programming
Morgan Kaufmann Publishers
ELEN 468 Advanced Logic Design
Single Clock Datapath With Control
Pipeline Implementation (4.6)
CDA 3101 Spring 2016 Introduction to Computer Organization
Processor Pipelining Yasser Mohammad.
Pipelining: Advanced ILP
Pipelining Chapter 6.
Computer Architecture
CSCI206 - Computer Organization & Programming
Chapter Six.
Chapter Six.
CS203 – Advanced Computer Architecture
Pipelining: Basic Concepts
Pipelining.
Pipelining Chapter 6.
Morgan Kaufmann Publishers The Processor
Introduction to Computer Organization and Architecture
Pipelining Chapter 6.
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:

Introduction to Computer Organization Pipelining

Overlapped execution of instructions Instruction level parallelism (concurrency) Example pipeline: assembly line (“T” Ford) Response time for any instruction is the same Instruction throughput increases Speedup = k x number of steps (stages) –Theory: k is a large constant –Reality: Pipelining introduces overhead

Pipelining Example Assume: One instruction format (easy) Assume: Each instruction has 3 steps S1..S3 Assume: Pipeline has 3 segments (one/step) Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 S1 S2 S3 S1 S2 S1 S2 S3 S1 S1 S2 S3 Time New Instruction Seg #1 Seg #2 Seg #3

MIPS Pipeline MIPS subset –Memory access: lw and sw –Arithmetic and logic: and, sub, and, or, slt –Branch: beq Steps (pipeline segments) –IF: fetch instruction from memory –ID: decode instruction and read registers –EX: execute the operation or calculate address –MEM: access an operand in data memory –WB: write the result into a register

Designing ISA for Pipelining Instructions are assumed to be same length –Easy IF and ID –Similar to multicycle datapath Few but consistent instruction formats –Register IDs in the same place (rd, rs, rt) –Decoding and register reading at the same time Memory operand only in lw and sw Operands are aligned in memory

Hazards (1/2) Structural –Different instructions trying to use the same functional unit (e.g. memory, register file) –Solution: duplicate hardware Control (branches) –Target address known only at the end of 3 rd cycle => STALLS –Solutions Prediction (static and dynamic): Loops Delayed branches

Hazards (2/2) Data hazards –Dependency: Instruction depends on the result of a previous instruction still in the pipeline Add $s0, $t0, $t1 Sub $t2, $s0, $t3 –Stall: add three bubbles (no-ops) to the pipeline –Solution: forwarding (send data to later stage) MEM => EX EX => EX –Code reordering to avoid stalls

Recall: Single-cycle Datapath

Pipeline Representation

Pipelined Datapath IF ID EX MEM WB

Conclusions Pipelining improves efficiency by: –Regularizing instruction format => simplicity –Partitioning each instruction into steps –Making each step have about the same work –Keeping the pipeline almost always full (occupied) to maximize processor throughput Pipeline control is complicated –Forwarding –Hazard detection and avoidance Next Time: Pipeline control design and operation