Visible to Intel only — GUID: iga1409336736276
Ixiasoft
Visible to Intel only — GUID: iga1409336736276
Ixiasoft
3.7.11.2. Nested Exceptions with an External Interrupt Controller
When individual external interrupts have dedicated shadow register sets, the Nios® II processor supports fast interrupt handling with no overhead for saving register contents. To take full advantage of fast interrupt handling, system software must set up certain conditions. With the following conditions satisfied, ISRs need not save and restore register contents on entry and exit:
- Automatic nested interrupts are enabled.
- Each interrupt is assigned to a dedicated shadow register set.
- All interrupts with the same RIL are assigned to dedicated shadow register sets.
- Multiple interrupts with different RILs can be assigned to a single shadow register set. However, with multiple register sets, you must not allow the RILs assigned to one shadow register set to overlap the RILs assigned to another register set.
The following tables demonstrate the validity of register set assignments when preemption within a register set is enabled.
RIL | Register Set 1 | Register Set 2 |
---|---|---|
1 | IRQ0 | |
2 | IRQ1 | |
3 | IRQ2 | |
4 | IRQ3 | |
5 | IRQ4 | |
6 | IRQ5 | |
7 | IRQ6 |
RIL | Register Set 1 | Register Set 2 |
---|---|---|
1 | IRQ0 | |
2 | IRQ1 | |
3 | IRQ3 | |
4 | IRQ2 | |
5 | IRQ4 | |
6 | IRQ5 | |
7 | IRQ6 |
Multiple interrupts can share a register set, with some loss of performance. There are two techniques for sharing register sets:
- Set status.RSIE to 0. When an ISR is running in a given register set, the processor does not take any maskable interrupt assigned to the same register set. Such interrupts must wait for the running ISR to complete, regardless of their interrupt level.
- Ensure that each ISR saves and restores registers on entry and exit, and set status.RSIE to 1 after registers are saved. When an ISR is running in a given register set, the processor takes an interrupt in the same register set if it has a higher interrupt level.
The Nios® II processor disables interrupts when taking a maskable interrupt (nonmaskable interrupts always disable maskable interrupts). Individual ISRs can re-enable nested interrupts by setting status.PIE to 1, as described in the Nested "Exceptions with Internal Interrupt Controller" section of this chapter.