CS 286 Computer Architecture & Organization

Slides:



Advertisements
Similar presentations
Lecture 4: CPU Performance
Advertisements

RISC and Pipelining Prof. Sin-Min Lee Department of Computer Science.
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.
CMPT 334 Computer Organization
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Pipeline Hazards See: P&H Chapter 4.7.
1 Lecture 17: Basic Pipelining Today’s topics:  5-stage pipeline  Hazards and instruction scheduling Mid-term exam stats:  Highest: 90, Mean: 58.
Part 4 - Exception Hazards – one last kicker 3/24/04 Similar problem as the conditional branch An exception is an involuntary branch from a non-branching.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania Computer Organization Pipelined Processor Design 1.
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?
Lec 8: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
Computer ArchitectureFall 2007 © October 31, CS-447– Computer Architecture M,W 10-11:20am Lecture 17 Review.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 17 - Pipelined.
First Programming Assignment For MIPS R3000 Processor Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki.
MIPS R3000 Subroutine Calls and Stack Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki
Datapath Architecture Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki
Memory/Storage Architecture Lab Computer Architecture Pipelining Basics.
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
Pipelined Datapath and Control
Pipeline Hazards. CS5513 Fall Pipeline Hazards Situations that prevent the next instructions in the instruction stream from executing during its.
Instruction Rescheduling and Loop-Unroll Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki
10/11: Lecture Topics Execution cycle Introduction to pipelining
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.
CS 312 Computer Architecture & Organization
Computer Organization CS224
CS2100 Computer Organization
CS 286 Computer Architecture & Organization
CSCI206 - Computer Organization & Programming
CS 286 Computer Organization and Architecture
Basic Pipeline Datapath
CS 286 Computer Organization and Architecture
Single Clock Datapath With Control
Pipeline Implementation (4.6)
CS 286: Memory Paging and Virtual Memory
Morgan Kaufmann Publishers The Processor
Pipelining review.
The processor: Pipelining and Branching
Current Design.
Computer Organization CS224
CSCI206 - Computer Organization & Programming
CSC 4250 Computer Architectures
Computer Architecture
CSCI206 - Computer Organization & Programming
Instruction Execution Cycle
Data Hazard Example (stall).
CS203 – Advanced Computer Architecture
Pipelining: Basic Concepts
CS 286 Computer Organization and Architecture
CS 286 Computer Organization and Architecture
Pipelining: critical path, pipeline hazards Prof. Eric Rotenberg
CS 286 Computer Organization and Architecture
Instruction Rescheduling and Loop-Unroll
Pipeline Control unit (highly abstracted)
Reducing pipeline hazards – three techniques
CS 286 Computer Organization and Architecture
Pipelining Chapter 6.
Process Synchronization
Department of Computer Science
OS Boot Sequence and File System
Department of Computer Science
Guest Lecturer: Justin Hsia
Threads: Light-Weight Processes
Process Synchronization
OS Boot Sequence and File System
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,
CS 286 Computer Architecture & Organization
MIPS R3000 Subroutine Calls and Stack
Need to stall for one cycle.
Presentation transcript:

CS 286 Computer Architecture & Organization Pipeline Hazards Department of Computer Science Southern Illinois University Edwardsville Fall, 2018 Dr. Hiroshi Fujinoki E-mail: hfujino@siue.edu Pipeline_Hazards/000

CS 286 Computer Architecture & Organization Pipeline Hazards Any anomalies that prevent a pipeline datapath from functioning without pipeline stalls or flashes Pipeline_Hazards/001

CS 286 Computer Architecture & Organization Three Major Pipeline Hazards 1. Structural Hazards 2. Data Hazards 3. Control Hazards Pipeline_Hazards/002

CS 286 Computer Architecture & Organization 1. Structural Hazards: = pipeline hazards due to hardware resource conflicts Example Instruction fetch and data access A processor instruction = [operator] + [parameters]  instruction fetch processor instruction: sw $t1, 0($t2)  save register to memory // $t1  Mem[$t2+0] Execution of this instruction requires two memory accesses Pipeline_Hazards/003

CS 286 Computer Architecture & Organization 1. Structural Hazards (continued) Main Memory CPU Core Unified Cache Architecture Cache Memory CPU Main Memory CPU Core Split Cache Architecture Instruction Cache Data CPU Instruction code and data need to take the same path (i486) Instruction code and data take its own path (Pentium and later) Instruction code Data Pipeline_Hazards/004

CS 286 Computer Architecture & Organization Unified Cache Architecture Main Memory CPU Core Cache Memory CPU Instruction code Data Memory address is accessed and its content is loaded to this processor lw $t1, 0($t2) IF ID EX ME WB // Mem[$t2+0]  $t1 instruction1 instruction2 instruction3 IF ID EX ME WB IF ID EX ME WB IF ID EX ME WB These two memory-access operations can not happen at the same time Instruction3 is now “fetched” from memory IF ID EX ME WB Pipeline_Hazards/005

CS 286 Computer Architecture & Organization Resource Conflict IF ID EX ME WB IF ID EX ME WB 3 cycle stalls IF ID EX ME WB IF ID EX ME WB IF ID EX ME WB Benefits from pipeline execution is lost Pipeline_Hazards/006

CS 286 Computer Architecture & Organization Worst case structural pipeline hazards IF ID EX ME WB n-2 pipeline stalls IF ID EX ME WB IF ID EX ME WB IF ID EX ME WB Pipeline Stalls Pipeline_Hazards/007

CS 286 Computer Architecture & Organization 2. Data Hazards: = pipeline hazards due data-dependency between instructions Example move $t1, $t2 // t1  t2 add $t3, $t1, 5 // t3  t1 + 5   The same registers are used in more than one instruction Data Dependency This can not be done IF ID EX ME WB move $t1, $t2: IF ID EX ME WB add $t3, $t1, 5: Time Pipeline_Hazards/008

CS 286 Computer Architecture & Organization Data Dependency move $t1, $t2: IF ID EX ME WB add $t3, $t1, 5: IF ID EX ME WB Resolve data dependency by stalls move $t1, $t2: IF ID EX ME WB IF ID EX ME WB add $t3, $t1, 5: Pipeline stalls Pipeline_Hazards/009

WB for “bne” instruction CS 286 Computer Architecture & Organization 3. Control Hazards: = pipeline hazards due to branch and jump instructions Example: jump instructions bne $s0, $s1, Next instruction 1    Next: instruction 2 Pipeline flashes for control hazards PC is set at the end of WB for “bne” instruction bne $s0, $s1, NEXT IF ID EX WB ME instruction 1 IF ID EX ME WB We can not start this instruction here Pipeline_Hazards/010

CS 286 Computer Architecture & Organization 3. Control Hazards: = pipeline hazards due to branch and jump instructions Example: jump instructions bne $s0, $s1, Next instruction 1    Next: instruction 2 Pipeline flashes for control hazards PC is set at the end of WB for “bne” instruction bne $s0, $s1, Next IF ID EX WB ME instruction 2 IF ID EX IF ID Start fetching instruction 1 Pipeline Flashes Pipeline_Hazards/010