ECE 445 – Computer Organization

Slides:



Advertisements
Similar presentations
Chapter 4 The Processor. Chapter 4 — The Processor — 2 The Main Control Unit Control signals derived from instruction 0rsrtrdshamtfunct 31:265:025:2120:1615:1110:6.
Advertisements

COMP 4211 Seminar Presentation Based On: Computer Architecture A Quantitative Approach by Hennessey and Patterson Presenter : Feri Danes.
CMPT 334 Computer Organization
Chapter 4 The Processor CprE 381 Computer Organization and Assembly Level Programming, Fall 2013 Zhao Zhang Iowa State University Revised from original.
Instruction Level Parallelism Chapter 4: CS465. Instruction-Level Parallelism (ILP) Pipelining: executing multiple instructions in parallel To increase.
Computer Organization and Architecture
The Memory Hierarchy (Lectures #24) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer Organization.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics Instructor: Dan Garcia
Pipelined Datapath and Control (Lecture #13) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
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.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
Pipelined Datapath and Control (Lecture #15) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
The Processor Data Path & Control Chapter 5 Part 4 – Exception Handling N. Guydosh 3/1/04+
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
Lecture 15: Pipelining and Hazards CS 2011 Fall 2014, Dr. Rozier.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Multi-Cycle Processor.
ECE 445 – Computer Organization
Chapter 6 Pipelined CPU Design. Spring 2005 ELEC 5200/6200 From Patterson/Hennessey Slides Pipelined operation – laundry analogy Text Fig. 6.1.
Spring 2003CSE P5481 Precise Interrupts Precise interrupts preserve the model that instructions execute in program-generated order, one at a time If an.
University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell CS352H: Computer Systems Architecture Topic 9: MIPS Pipeline.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 16 - Multi-Cycle.
C OMPUTER O RGANIZATION AND D ESIGN The Hardware/Software Interface 5 th Edition Chapter 4 The Processor.
LECTURE 10 Pipelining: Advanced ILP. EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls,
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
CDA 3101 Spring 2016 Introduction to Computer Organization Microprogramming and Exceptions 08 March 2016.
ECE/CS 552: Pipeline Hazards © Prof. Mikko Lipasti Lecture notes based in part on slides created by Mark Hill, David Wood, Guri Sohi, John Shen and Jim.
Exceptions and Interrupts “Unexpected” events requiring change in flow of control – Different ISAs use the terms differently Exception – Arises within.
Use of Pipelining to Achieve CPI < 1
CS 352H: Computer Systems Architecture
Exceptions Another form of control hazard Could be caused by…
Computer Organization CS224
Handling Exceptions In MIPS, exceptions managed by a System Control Coprocessor (CP0) Save PC of offending (or interrupted) instruction In MIPS: Exception.
Morgan Kaufmann Publishers The Processor Dr. Hussein Al-Zoubi
Lecture 15: Pipelining: Branching & Complications
William Stallings Computer Organization and Architecture 8th Edition
Morgan Kaufmann Publishers
Morgan Kaufmann Publishers The Processor
Pipeline Implementation (4.6)
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers The Processor
Pipelining: Advanced ILP
The processor: Exceptions and Interrupts
Morgan Kaufmann Publishers The Processor
CSCE 212 Chapter 5 The Processor: Datapath and Control
Processor: Finite State Machine & Microprogramming
The processor: Pipelining and Branching
Computer Organization and ASSEMBLY LANGUAGE
Lecture 9. MIPS Processor Design – Pipelined Processor Design #2
Lecture 5. MIPS Processor Design
Morgan Kaufmann Publishers The Processor
Computer Architecture
CS203 – Advanced Computer Architecture
CSC3050 – Computer Architecture
Morgan Kaufmann Publishers The Processor
Chapter Four The Processor: Datapath and Control
Control Hazards Branches (conditional, unconditional, call-return)
Morgan Kaufmann Publishers The Processor
Pipelined Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Systems Architecture II
Chapter 11 Processor Structure and function
Interrupts and exceptions
Morgan Kaufmann Publishers The Processor
CMSC 611: Advanced Computer Architecture
Morgan Kaufmann Publishers The Processor
Presentation transcript:

ECE 445 – Computer Organization Pipelined Datapath and Control (Lecture #16) The slides included herein were taken from the materials accompanying Computer Organization and Design, 4th Edition, by Patterson and Hennessey, and were used with permission from Morgan Kaufmann Publishers.

ECE 445 - Computer Organization Material to be covered ... Chapter 4: Sections 5 – 9, 13 – 14 Fall 2010 ECE 445 - Computer Organization

Exceptions and Interrupts “Unexpected” events requiring a change in flow of control Different ISAs use the terms differently Exception Arises within the CPU e.g., undefined opcode, overflow, system call, etc. Interrupt From an external I/O controller Dealing with them without sacrificing performance is hard Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Handling Exceptions Save PC of offending (or interrupted) instruction In MIPS: Exception Program Counter (EPC) Save indication of the problem In MIPS: Cause register We’ll assume 1-bit 0 for undefined opcode, 1 for overflow Jump to exception handler routine at 8000 00180 MIPS – exceptions managed by a System Control Coprocessor (CP0). Fall 2010 ECE 445 - Computer Organization

An Alternate Mechanism Vectored Interrupts Handler address determined by the cause Example: Undefined opcode : C000 0000 Overflow : C000 0020 … : C000 0040 Instructions either Deal with the interrupt, or Jump to real handler Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Handler Actions Read cause, and transfer to relevant handler Determine action required If restartable Take corrective action use EPC to return to program Otherwise Terminate program Report error using EPC, cause, … Fall 2010 ECE 445 - Computer Organization

Exceptions in a Pipeline Another form of control hazard Consider overflow on add in EX stage add $1, $2, $1 Prevent $1 from being overwritten Complete previous instructions Flush add and subsequent instructions Set Cause and EPC register values Transfer control to handler Similar to mispredicted branch Use much of the same hardware Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization MIPS Pipeline Fall 2010 ECE 445 - Computer Organization

Pipeline with Hazard Detection Fall 2010 ECE 445 - Computer Organization

Pipeline with Exceptions Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Exception Properties Restartable exceptions Pipeline can flush the instruction Handler executes, then returns to the instruction Refetched and executed from scratch PC saved in EPC register Identifies “causing” instruction Actually PC + 4 is saved Handler must adjust i.e. subtract 4 before copying EPC back to PC Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Exception Example Exception on add in 40 sub $11, $2, $4 44 and $12, $2, $5 48 or $13, $2, $6 4C add $1, $2, $1 50 slt $15, $6, $7 54 lw $16, 50($7) … Handler 80000180 sw $25, 1000($0) 80000184 sw $26, 1004($0) … Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Exception Example Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Exception Example Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Multiple Exceptions Pipelining overlaps multiple instructions Could have multiple exceptions at once Simple approach: deal with exception from earliest instruction Flush subsequent instructions “Precise” exceptions In complex pipelines Multiple instructions issued per cycle Out-of-order completion Maintaining precise exceptions is difficult! Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Imprecise Exceptions Just stop pipeline and save state Including exception cause(s) Let the handler work out Which instruction(s) had exceptions Which to complete or flush May require “manual” completion Simplifies hardware, but more complex handler software Not feasible for complex multiple-issue out-of-order pipelines Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Fallacies Pipelining is easy (!) The basic idea is easy The devil is in the details e.g., detecting data hazards Pipelining is independent of technology So why haven’t we always done pipelining? More transistors make more advanced techniques feasible Pipeline-related ISA design needs to take account of technology trends e.g., predicated instructions §4.13 Fallacies and Pitfalls Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Pitfalls Poor ISA design can make pipelining harder e.g., complex instruction sets (VAX, IA-32) Significant overhead to make pipelining work IA-32 micro-op approach e.g., complex addressing modes Register update side effects Memory indirection e.g., delayed branches Advanced pipelines have long delay slots Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Concluding Remarks §4.14 Concluding Remarks ISA influences design of datapath and control Datapath and control influence design of ISA Pipelining improves instruction throughput using parallelism More instructions completed per second Latency for each instruction not reduced Hazards: structural, data, control Fall 2010 ECE 445 - Computer Organization

ECE 445 - Computer Organization Questions? Fall 2010 ECE 445 - Computer Organization