Nios® V Processor Software Developer Handbook

ID 743810
Date 1/27/2025
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

9.2.1.2.2.1. Traps Occurs

When a trap occurs, and the processor control transfers to the trap handling code, it does the following:

  • Switches to the separate exception stack (if enabled)
  • Stores register values onto the stack
  • Determines the type of traps (either exceptions or interrupts)
  • Passes control to the correct dispatchers

The trap handling code looks at the Machine Cause (mcause) register to determine the trap type.

  • If the Interrupt bit is set, the trap handling code transfer control to the interrupt dispatcher.
  • Otherwise (Interrupt bit is not set), the trap handling code calls the exception dispatcher.