Nios® V Processor Reference Manual

ID 683632
Date 1/27/2025
Public
Document Table of Contents

3.3.6.3.1. Hardware Implementation

In Vectored Mode, synchronous exceptions and asynchronous interrupts implement different address calculations. The Nios® V processor determines whether the traps are exceptions or interrupts from the Interrupt field of mcause register.

For synchronous exceptions, such as illegal instructions, the hardware assigns the pc to the address provided in the BASE field of the mtvec register. This base address serves as a fixed entry point for the generic exception handler routine.

When an interrupt occurs, the system computes the next pc address to the base address from the BASE field plus four times the interrupt cause number, which is acquired from Exception Code in the mcause register. This calculation determines the address of the dedicated interrupt handler in the vector table.

Note: The effective range for jump instructions is limited to within 1 MiB from the current instruction's address.
Table 36.  Address Computation in Vectored Nios® V Trap Controller
Trap Address Computation Description Exception Code Results
Exceptions pc <= BASE << 2 All exceptions Starting from 0 (Instruction address misaligned), up to 19 (Hardware error) pc <= 0x80
Interrupts pc <= BASE << 2 + 4*Exception Code Machine software interrupt 3 pc <= 0x8C
Machine timer interrupt 7 pc <= 0x9C
Platform interrupt 0 16 pc <= 0xC0
Platform interrupt 15 32 pc <= 0x100
Note: Assume the BASE field in mtvec register is 0x20.