The following pseudocode describes a typical and simple workflow for ARP32 to service pending interrupts. This flow is not the only possible sequence and is not meant to represent a mandated software sequence:
- ARP32 enables and maps interrupts:
- Enable ARP32 global interrupt enable (ARP32.CSR.GIE).
- Enable ARP32 nonmaskable interrupts (ARP32.IER.NMIE).
- Enable ARP32 interrupt inputs (ARP32.IER[n]).
- Map EVE-level interrupts to the appropriate ARP32 interrupt input (ARP32_INTn_IRQENABLE_SET).
- When interrupt is asserted, ARP32 branches into interrupt vector code:
- ARP32 hardware clears the GIE bit, new interrupts are ignored
- ARP32 software reads ARP32_INTn_IRQSTATUS
- Clear to be serviced interrupts in ARP32_INTn_IRQSTATUS (by issuing write of 1)
- For each pending interrupt in ARP32_INTn_IRQSTATUS:
- ARP32 software reads IP interrupt status (<IP_INT>_IRQSTATUS)
- For each pending interrupt in <IP_INT>_IRQSTATUS:
- May not be necessary for pulsed or timer type interrupts.
- Perform functional operations necessary to service interrupt.
- Clear IP source interrupt status (by setting correct bit in <IP_INT>_IRQSTATUS to 1).
- Ideally, only exit loop after <IP_INT>_IRQSTATUS is all 0s.
- Only exit loop after <IP_INT>_IRQSTATUS is all 0s
- ARP32 software returns from interrupt through BIRP (branch interrupt return pointer) instruction: ARP32 hardware sets the GIE bit (by copy of SCSR to CSR, new interrupts are enabled) and clears IFRn.
For ARP32 register and state details (especially for CSR, GIE, and SCSR functionalities), see the ARP32 CPU and Instruction Set Reference Guide.