ECE/CS 552: Pipelining and Exceptions

Slides:



Advertisements
Similar presentations
Chapter 6 Limited Direct Execution
Advertisements

Chapter 12 Interrupts STOP!!! Do this!!!. Interrupts Have device tell OS it is ready OS can then interrupt what it is doing to: Determine what device.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
ECE 232 L15.Microprog.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 15 Microprogrammed.
Interrupts STOP!!! Do this!!!. CMPE12cGabriel Hugh Elkaim 2 Interrupts Have device tell OS/CPU it is ready Requires hardware to support. OS/CPU can then.
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
Computer System Organization S H Srinivasan
EENG449b/Savvides Lec 4.1 1/22/04 January 22, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG Computer.
The Processor Data Path & Control Chapter 5 Part 4 – Exception Handling N. Guydosh 3/1/04+
ECE 232 L23.Exceptions.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 23 Exceptions.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
Protection and the Kernel: Mode, Space, and Context.
Chapter 10 And, Finally... The Stack. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Stacks A LIFO.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
ECE/CS 552: Microprogramming and Exceptions Instructor: Mikko H Lipasti Fall 2010 University of Wisconsin-Madison Lecture notes based on set created by.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Multi-Cycle Processor.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
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.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Microprogramming and Exceptions Spring 2005 Ilam University.
Constructive Computer Architecture Interrupts/Exceptions/Faults Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology.
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
CS152 Lec12.1 CS 152 Computer Architecture and Engineering Lecture 12 Multicycle Controller Design Exceptions.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Interrupts STOP!!! Do this!!!. Interrupts Have device tell OS it is ready OS can then interrupt what it is doing to: Determine what device wants service.
Lecture 2 Page 1 CS 111 Summer 2013 Hardware, Modularity, and Virtualization CS 111 Operating System Principles Peter Reiher.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 16 - Multi-Cycle.
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.
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.
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.
Of Privilege, Traps, Interrupts & Exceptions Prof. Sirer CS 316 Cornell University.
ECE/CS 552: Single Cycle Control Path
Introduction to Operating Systems
Interrupts and exceptions
Digital Logic Design Alex Bronstein
Exceptions Another form of control hazard Could be caused by…
Handling Exceptions In MIPS, exceptions managed by a System Control Coprocessor (CP0) Save PC of offending (or interrupted) instruction In MIPS: Exception.
Interrupts and signals
Operating Systems CMPSC 473
Protection and OS Structure
Anton Burtsev February, 2017
the Operating System (OS)
Day 08 Processes.
Day 09 Processes.
Chapter 10 And, Finally... The Stack
Chapter 10 The Stack.
ECE/CS 552: Single Cycle Datapath
The processor: Exceptions and Interrupts
ECE/CS 552: Arithmetic and Logic
CSCE 212 Chapter 5 The Processor: Datapath and Control
Processor: Finite State Machine & Microprogramming
ECE/CS 552: Microprogramming and Exceptions
Outline Computer Organization Devices Interrupts Computer architecture
Interrupts/Exceptions
Architectural Support for OS
Computer Organization
Chapter 10 And, Finally... The Stack
Interrupts and Exception Handling
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Winter 2007 Module 2 Architectural Support for Operating Systems Brian Bershad 562 Allen Center 1.
Control Hazards Branches (conditional, unconditional, call-return)
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
Interrupts and exceptions
Interrupts and Exception Handling
CMSC 611: Advanced Computer Architecture
Interrupts & Syscalls.
Presentation transcript:

ECE/CS 552: Pipelining and Exceptions © Prof. Mikko Lipasti Lecture notes based in part on slides created by Mark Hill, David Wood, Guri Sohi, John Shen and Jim Smith

Exceptions What happens? Instruction fetch page fault Illegal opcode Privileged opcode Arithmetic overflow Data page fault I/O device status change Power-on/reset

Exceptions For some, we could test for the condition Arithmetic overflow I/O device ready (polling) But most tests uselessly say “no” Solution: Surprise “procedure call” Called an exception

Exceptions: Big Picture Two types: Interrupt (asynchronous) or Trap (synchronous) Hardware handles initial reaction Then invokes a software exception handler By convention, at e.g. 0xC00 O/S kernel provides code at the handler address

Exceptions: Hardware Sets state that identifies cause of exception MIPS: in exception_code field of Cause register Changes to kernel mode for dangerous work ahead Disables interrupts MIPS: recorded in status register Saves current PC (MIPS: exception PC) Jumps to specific address (MIPS: 0x80000080) Like a surprise JAL – so can’t clobber $31

Exceptions: Software Exception handler: MIPS: .ktext at 0x80000080 Set flag to detect incorrect entry Nested exception while in handler Save some registers Find exception type E.g. I/O interrupt or syscall Jump to specific exception handler

Exceptions: Software, cont’d Handle specific exception Jump to clean-up to resume user program Restore registers Reset flag that detects incorrect entry Atomically Restore previous mode (user vs. supervisor) Enable interrupts Jump back to program (using EPC)

Implementing Exceptions We worry only about hardware, not s/w IntCause 0 undefined instruction 1 arithmetic overflow Changes to the datapath Detect exception Additional source for next PC Storage for exception cause, return address, spare register Additional complexity in control logic

Pipeline With Exceptions (Fig 4.66)

Summary and Review Exceptions Handling exceptions in a pipelined design