Memory/Storage Architecture Lab Computer Architecture Pipelining Basics.

Slides:



Advertisements
Similar presentations
SE-292 High Performance Computing
Advertisements

Lecture 4: CPU Performance
1 ECE369 ECE369 Pipelining. 2 ECE369 addm (rs), rt # Memory[R[rs]] = R[rt] + Memory[R[rs]]; Assume that we can read and write the memory in the same cycle.
COMP381 by M. Hamdi 1 (Recap) Pipeline Hazards. COMP381 by M. Hamdi 2 I n s t r. O r d e r add r1,r2,r3 sub r4,r1,r3 and r6,r1,r7 or r8,r1,r9 xor r10,r1,r11.
Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
1 Pipelining Part 2 CS Data Hazards Data hazards occur when the pipeline changes the order of read/write accesses to operands that differs from.
CMSC 611: Advanced Computer Architecture Pipelining Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted.
COMP25212 Further Pipeline Issues. Cray 1 COMP25212 Designed in 1976 Cost $8,800,000 8MB Main Memory Max performance 160 MFLOPS Weight 5.5 Tons Power.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
Pipelining Hwanmo Sung CS147 Presentation Professor Sin-Min Lee.
Pipelining - Hazards.
Instruction-Level Parallelism (ILP)
CIS429/529 Winter 2007 Pipelining-1 1 Pipeling RISC/MIPS64 five stage pipeline Basic pipeline performance Pipeline hazards Branch hazards More pipeline.
Pipelining Andreas Klappenecker CPSC321 Computer Architecture.
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.
CIS629 Fall 2002 Pipelining 2- 1 Control Hazards Created by branch statements BEQZLOC ADDR1,R2,R3. LOCSUBR1,R2,R3 PC needs to be computed but it happens.
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?
King Fahd University of Petroleum and Minerals King Fahd University of Petroleum and Minerals Computer Engineering Department Computer Engineering Department.
Appendix A Pipelining: Basic and Intermediate Concepts
Pipelined Datapath and Control (Lecture #15) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
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.
-1.1- PIPELINING 2 nd week. -2- Khoa Coâng Ngheä Thoâng Tin – Ñaïi Hoïc Baùch Khoa Tp.HCM PIPELINING 2 nd week References Pipelining concepts The DLX.
Pipeline Hazard CT101 – Computing Systems. Content Introduction to pipeline hazard Structural Hazard Data Hazard Control Hazard.
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
1 Appendix A Pipeline implementation Pipeline hazards, detection and forwarding Multiple-cycle operations MIPS R4000 CDA5155 Spring, 2007, Peir / University.
University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell CS352H: Computer Systems Architecture Topic 8: MIPS Pipelined.
Pipelining Enhancing Performance. Datapath as Designed in Ch. 5 Consider execution of: lw $t1,100($t0) lw $t2,200($t0) lw $t3,300($t0) Datapath segments.
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
Pipeline Hazards. CS5513 Fall Pipeline Hazards Situations that prevent the next instructions in the instruction stream from executing during its.
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.
CS 1104 Help Session IV Five Issues in Pipelining Colin Tan, S
5/13/99 Ashish Sabharwal1 Pipelining and Hazards n Hazards occur because –Don’t have enough resources (ALU’s, memory,…) Structural Hazard –Need a value.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
1 Seoul National University Pipelining Basics. 2 Sequential Processing Seoul National University.
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
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.
PROCESSOR PIPELINING YASSER MOHAMMAD. SINGLE DATAPATH DESIGN.
CSCE 212 Chapter 6 Enhancing Performance with Pipelining Instructor: Jason D. Bakos.
CS203 – Advanced Computer Architecture Pipelining Review.
CS2100 Computer Organization
CDA3101 Recitation Section 8
Pipelining Chapter 6.
CSCI206 - Computer Organization & Programming
Morgan Kaufmann Publishers
Basic Pipeline Datapath
Single Clock Datapath With Control
Pipeline Implementation (4.6)
CDA 3101 Spring 2016 Introduction to Computer Organization
Morgan Kaufmann Publishers The Processor
Computer Architecture Lecture 3 – Part 1 11th May, 2006
Pipelining review.
Pipelining in more detail
CSC 4250 Computer Architectures
Computer Architecture
CSCI206 - Computer Organization & Programming
Pipeline control unit (highly abstracted)
The Processor Lecture 3.6: Control Hazards
Overview What are pipeline hazards? Types of hazards
Pipeline control unit (highly abstracted)
CS203 – Advanced Computer Architecture
Pipelining: Basic Concepts
CS 286 Computer Architecture & Organization
Pipeline Control unit (highly abstracted)
Reducing pipeline hazards – three techniques
Seoul National University
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,
Pipelining Hazards.
Presentation transcript:

Memory/Storage Architecture Lab Computer Architecture Pipelining Basics

2 Memory/Storage Architecture Lab 2 Sequential Processing

3 Memory/Storage Architecture Lab 3 Pipelined Processing

4 Memory/Storage Architecture Lab 4 Basic Steps of Execution 1. Instruction fetch step (IF) 2. Instruction decode/register fetch step (ID) 3. Execution/effective address step (EX) 4. Memory access (MEM) 5. Register write-back step (WB)

5 Memory/Storage Architecture Lab 5 Pipelined Instruction Execution  Sequential Execution  Pipelined Execution ADD $3, $1, $2 SUB $4, $5, $6 AND $7, $8, $9

6 Memory/Storage Architecture Lab 6 Basic Pipeline

7 Memory/Storage Architecture Lab 7 Major Hurdles of Pipelining  Structural Hazard  Data Hazard  Control Hazard

8 Memory/Storage Architecture Lab 8 Structural Hazard IFIDEXMEMWB IFIDEXMEMWB IFIDEXMEMWB IFIDEXMEMWB

9 Memory/Storage Architecture Lab 9 Solutions to Structural Hazard  Resource Duplication example − Separate I and D caches for memory access conflict − Time-multiplexed or multi-port register file for register file access conflict

10 Memory/Storage Architecture Lab 10 Data Hazard (RAW hazard) ADD $1, $2, $3 SUB $4, $1, $5 R IFMEMEX ID W WB R IFMEMEX ID W WB Time

11 Memory/Storage Architecture Lab 11 Solutions to Data Hazard  Freezing the pipeline  (Internal) Forwarding  Compiler scheduling

12 Memory/Storage Architecture Lab 12 Freezing The Pipeline  ALU result to next instruction  Load result to next instruction R IFMEMEX ID W WB ADD $1, $2, $3 SUB $4, $1, $5 stallIF R ID stallEX R IFMEMEX ID W WB LW $1, 32($6) SUB $4, $1, $5 stallIF R ID stallEX

13 Memory/Storage Architecture Lab 13 (Internal) Forwarding  ALU result to next instruction (Stall X)  Load result to next instruction (Stall 1) R IFMEMEX ID W WB ADD $1, $2, $3 SUB $4, $1, $5 R IFMEMEX ID W WB LW $1, 32($6) SUB $4, $1, $5 R IFMEMEX ID W WB stall R IFMEMEX ID

14 Memory/Storage Architecture Lab 14 Control Hazard  Caused by PC-changing instructions (Branch, Jump, Call/Return) For 5-stage pipeline, 3 cycle penalty 15% branch frequency. CPI = 1.45

15 Memory/Storage Architecture Lab 15 Solutions to Control Hazard  Optimized branch processing  Branch prediction  Delayed branch

16 Memory/Storage Architecture Lab 16 Optimized Branch Processing 1. Find out branch taken or not early → simplified branch condition 2. Compute branch target address early → extra hardware

17 Memory/Storage Architecture Lab 17 Branch Prediction  Predict-not-taken

18 Memory/Storage Architecture Lab 18 Delayed Branch  Semantics of delayed branch

19 Memory/Storage Architecture Lab 19 Delayed Branch