previous
 next 
CS 3853 Computer Architecture Notes on Appendix C Section 4

Read Appendix C.4

Exceptions

The book uses the word exception to mean anything that interrupts the normal sequence of instruction execution.
Here are some examples:

Classification of exceptions

Some examples:

Stopping and restarting

The most difficult exceptions to handle are those that occur within instructions and must be restartable: e.g. page fault

Precise and imprecise exceptions

Precise: instruction before the faulting exception can be completed and those after can be restarted from scratch.
Imprecise: not precise
Imprecise exceptions occur with long pipelines and with non-RISC instructions.
Examples:
  1. For some floating point operations, the exception is not handled until after the result has been written.
    What if one of the source registers is the same as the destination register?
  2. Consider:
    LDIF  ID  EX  MEM WB
    DADDIFIDEXMEM WB
    The LD can have a page fault in MEM but the DADD can have a page fault in IF, before the page fault of LD.
    Solution: not handle the exception when it occurs, but when the instruction completes (inhibiting any state change)

MIPS 5-stage Pipeline Exceptions

pipeline stage   Exceptions
IFpage fault, misaligned memory access, memory protection violation
IDundefined or illegal opcode
EXarithmetic exception
MEMpage fault, misaligned memory access, memory protection violation
WBnone

Next Notes

Back to CS 3853 Notes Table of Contents