lec11_Exceptions_Pipeline_Basics

lec11_Exceptions_Pipeline_Basics - Lecture 11: Exceptions...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 11: Exceptions and Pipelining Basics Computer Architecture Csc 205
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Exceptions ° Exception = unprogrammed control transfer system takes action to handle the exception - must record the address of the offending instruction - record any other information necessary to return afterwards returns control to user must save & restore user state user program normal control flow: sequential, jumps, branches, calls, returns System Exception Handler Exception: return from exception
Background image of page 2
Two Types of Exceptions ° Interrupts caused by external events asynchronous to program execution may be handled between instructions simply suspend and resume user program ° Traps (or Exceptions) caused by internal events - exceptional conditions (overflow) - invalid instruction - faults (non-resident page in memory) - internal hardware error synchronous to program execution condition must be remedied by the handler instruction may be retried or simulated and program continued or program may be aborted
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MIPS convention ° Exception means any unexpected change in control flow, without distinguishing internal or external; ° Use the term interrupt only when the event is externally caused. Type of event From where? MIPS terminology I/O device request External Interrupt Invoke OS from user program Internal Exception Arithmetic overflow Internal Exception Using an undefined instruction Internal Exception Hardware malfunctions Either Exception or Interrupt
Background image of page 4
Additions to MIPS ISA to support Exceptions? ° EPC –a 32-bit register used to hold the address of the affected instruction. ° Cause –a register used to record the cause of the exception. To simplify the discussion, assume undefined instruction=0 arithmetic overflow=1 ° Status - interrupt mask and enable bits and determines what exceptions can occur. ° Control signals to write EPC , Cause, and Status ° Be able to write exception address into PC, increase mux set PC to exception address (C000 0000 hex ). ° May have to undo PC = PC + 4, since want EPC to point to offending instruction (not its successor); PC = PC - 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Big Picture: user / system modes ° By providing two modes of execution (user/system) it is possible for the computer to manage itself operating system is a special program that runs in the priviledged mode and has access to all of the resources of the computer presents “virtual resources” to each user that are more convenient that the physical resurces - files vs. disk sectors - virtual memory vs physical memory protects each user program from others ° Exceptions allow the system to taken action in response to events that occur while user program is executing O/S begins at the handler
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/12/2009 for the course CS 205 taught by Professor H.shaban during the Spring '07 term at Northern Virginia.

Page1 / 28

lec11_Exceptions_Pipeline_Basics - Lecture 11: Exceptions...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online