The Processor Data Path & Control Chapter 5 Part 4 – Exception Handling N. Guydosh 3/1/04+

Slides:



Advertisements
Similar presentations
PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
Advertisements

1 Chapter Five The Processor: Datapath and Control.
The Processor Data Path & Control Chapter 5 Part 3 - Microprogrammed Control Unit N. Guydosh 3/1/04+
1 5.5 A Multicycle Implementation A single memory unit is used for both instructions and data. There is a single ALU, rather than an ALU and two adders.
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.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Advanced Computer Architecture 5MD00 / 5Z033 MIPS Design data path and control Henk Corporaal TUEindhoven 2007.
1 The Processor: Datapath and Control We will design a microprocessor that includes a subset of the MIPS instruction set: –Memory access: load/store word.
The Processor Data Path & Control Chapter 5 Part 1 - Introduction and Single Clock Cycle Design N. Guydosh 2/29/04.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
MICROPROCESSOR INPUT/OUTPUT
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 part 4 Exceptions.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Multi-Cycle Processor.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
C HAPTER 5 T HE PROCESSOR : D ATAPATH AND C ONTROL M ULTICYCLE D ESIGN.
Gary MarsdenSlide 1University of Cape Town Stages.
Microprogramming and Exceptions Spring 2005 Ilam University.
Exceptions and Interrputs CS 321 – Introduction to Computer Architecture and Machine-Level Programming Barry Britt, Systems Analyst II Department of Computer.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Chapter 6: Computer Components Dr Mohamed Menacer Taibah University
Multicycle Implementation
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
GROUP 2 CHAPTER 16 CONTROL UNIT Group Members ๏ Evelio L. Hernandez ๏ Ashwin Soerdien ๏ Andrew Keiper ๏ Hermes Andino.
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 16 - Multi-Cycle.
9/20/6Lecture 3 - Instruction Set - Al1 Exception Handling.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
LECTURE 10 Pipelining: Advanced ILP. EXCEPTIONS An exception, or interrupt, is an event other than regular transfers of control (branches, jumps, calls,
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
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.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Exceptions and Interrupts “Unexpected” events requiring change in flow of control – Different ISAs use the terms differently Exception – Arises within.
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.
Basic Processor Structure/design
Chapter 5 The Processor: Datapath and Control
Extensions to the Multicycle CPU
William Stallings Computer Organization and Architecture 7th Edition
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Multiple Cycle Implementation of MIPS-Lite CPU
Pipelining: Advanced ILP
The processor: Exceptions and Interrupts
CSCE 212 Chapter 5 The Processor: Datapath and Control
Processor: Finite State Machine & Microprogramming
Computer Architecture
The processor: Pipelining and Branching
William Stallings Computer Organization and Architecture 7th Edition
Vishwani D. Agrawal James J. Danaher Professor
Branch instructions We’ll implement branch instructions for the eight different conditions shown here. Bits 11-9 of the opcode field will indicate the.
Computer Architecture
Processor: Multi-Cycle Datapath & Control
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
Chapter Four The Processor: Datapath and Control
ECE 445 – Computer Organization
Datapath and Control Exceptions
Review: The whole processor
Interrupts and exceptions
Presentation transcript:

The Processor Data Path & Control Chapter 5 Part 4 – Exception Handling N. Guydosh 3/1/04+

Introduction Exceptions vs. Interrupts –Meaning of terms depends on system and manufacturer. –Both terms imply events other that branches or jumps that change the normal flow of execution –Typically an exception is an unexpected event within the processor such as overflow and an interrupt is from outside the processor such as an I/O request –Sometimes either term is used for both conditions –MIP convention (used here): An exception is refers to any unexpected change in control flow without distinguishing whether the cause is internal or external. Requires immediate response from the processor - a hardware branch or “trap” to an exception handling routine Detecting and responding to exceptions may be on the performance critical path and could impact clock cycle time and performance. Two type of exceptions will be considered here: –Undefined instructions –Arithmetic overflow

Exception Handling Approach Basic exception handling approach –Save the address of the offending instruction in an “Exception Program Counter” (EPC) and transfer control to the exception handling entry point in the OS. Two methods handling exceptions: –Single entry point for all exceptions (above) and put the “cause” of the problem in a status register (cause register). Used by MIPS. –Vectored interrupts: the address to which control is transferred is a function of the cause of the exception. This is the approach used in the PC (Intel). Uses the interrupt vector table at the start of ram to branch to the correct interrupt handling routine (DOS or bios). No need for cause register.

Implementation Add two new 32 bit registers: EPC and “Cause Register” –For our example the low bit of cause will have a 1 or 0 indicating undefined instruction or overflow. –EPC Will be the address of the offending instruction. Note that the current PC will not be correct for the EPC because it was incremented early in the cycle. 4 must be subtracted from it, but this is ease because 4 is already an input to ALU and exception state simply has to assert ALUOP = 01 (subtract). See final state diagram. Additions to the data path: –Control line EPCWrite - Write (the address of the offending inst) to the EPC when asserted –Control line CauseWrite - Write(the cause code) to the cause register –Modify control lines PCSource to use the previously unused value of 11 – This will select a constant value for the PC (0xC ) which is the single entry point address of the exception handler. Add an extension to the state diagram (FSM) to handle exceptions –Bad opcode will branch off state 1 (instruction decode) –Overflow will branch off state 7 (last state of R - type after arithmetic is done

Mult-cycle Data Path With Exception Handling Support Cause and EPC registers added and expanded MUX for PC selection along with associated control lines.

Mult-Cycle FSM With Exception Handling Support States 10 and 11 added – note ALUOp is set to 01 (subtract) to correct PC before writing to EPC. Ignore the small “” at the ends of text lines – some kind of graphics glitch.