Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

9.1.3.2.1. How the Hardware Works

The Nios® II processor can respond to exceptions including software exceptions and hardware interrupts. When the Nios® II processor responds to an exception, it performs the following tasks:

  • Saves the status register in estatus. This means that if hardware interrupts are enabled, the PIE bit of estatus is set.
  • Disables hardware interrupts.
  • Saves the next execution address in ea (r29).
  • Transfers control to the appropriate exception address, as follows:
    • Software exception or internal hardware interrupt— Nios® II processor general exception address
    • External hardware interrupt—Device-specific interrupt address

All Nios® II exception types are precise. This means that after an exception is handled, the Nios® II processor can re-execute the instruction that caused the exception.

The Nios® II processor always re-executes the instruction after the software exception handler or ISR has completed, when the exception processing system returns to the application context.

Several exception types, such as the advanced exceptions, are optional in the Nios® II processor core. The presence of these exception types depends on how the hardware designer configures the Nios® II core at the time of hardware generation.

The processor’s response to hardware interrupts depends on which interrupt controller is implemented. The following sections describe the hardware behavior with each interrupt controller.

For more information about the Nios® II processor exception controller and hardware interrupt controllers, including a list of optional exception types, refer to the "Processor Architecture" chapter of the Nios® II Processor Reference Handbook.