Visible to Intel only — GUID: umt1733359984589
Ixiasoft
Visible to Intel only — GUID: umt1733359984589
Ixiasoft
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).
- Saves the cause of the trap in Machine Cause register (mcause).
- Switch to shadow register set through Shadow Register File Status register (msrfstatus) if enabled.
- Transfers control to the trap handling system (vector base 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 vector base address receives control for all types of traps. At the vector base 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.