Visible to Intel only — GUID: exu1734333753713
Ixiasoft
Visible to Intel only — GUID: exu1734333753713
Ixiasoft
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.
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 |