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.1. How the Hardware Works

The Nios® V processor can respond to traps including platform interrupts, timer interrupt, software interrupts and software exceptions. When the Nios® V processor responds to a trap, it performs the following tasks:

  • Disables interrupts by clearing mstatus.mie and saves the previous value to mstatus.mpie.
  • Saves the next execution address in Machine Exception Program Counter (mepc).
  • Transfers control to the trap handling system (exception address), held in the Machine Trap-Vector Base-Address (mtvec) register.
  • The same transfer of control is applied to all types of traps – interrupts and exceptions.

Nios® V traps are not vectored. Therefore, the same exception address receives control for all types of traps. At the exception address, the trap handling code must determine the type of trap (i.e. software exception, platform interrupt, timer interrupt or software interrupt), and assign the relevant handler.

All Nios® V processor trap types are precise. This means that after a trap is handled, the Nios® V processor can re-execute the instruction that caused the trap.