Nios® V Processor Reference Manual

ID 683632
Date 5/25/2025
Public

Visible to Intel only — GUID: rfs1741142989529

Ixiasoft

Document Table of Contents

4.3.11.2.4. Uninterruptible Critical Section in an Interrupt Handlers

In CLIC mode, an interrupt with lower level is subjected to pre-emption by a higher interrupt level. Any uninterruptible critical section in the interrupt handler with lower level are vulnerable to CLIC’s pre-emption, putting the system at risk.

To support uninterruptible critical section in CLIC, Altera recommends either one of the following three software implementations.

Table 141.  Software Implementation for Uninterruptible Critical Section
Approach Description
Non-preemptive
  • Synonymous with CLINT.
  • Without pre-emption, the remaining feature in CLIC is the selective hardware vectoring. All interrupts in CLIC are software vectored because selective hardware vectoring is not supported.
  • If selective hardware vectoring is not required too, it is recommended to implement CLINT for simplicity, unless more than 16 platform interrupts are required.
Preemptive with global interrupt enable (mstatus.mie) disabled
  • Utilizes the mstatus.mie to temporary disable interrupt.
  • This prevents any new interrupt from being taken, ensuring the execution of critical section to completion.
  • Once the critical section is completed, return the mstatus.mie back to normal.
Preemptive with interrupt-level threshold (mintthresh.th) management
  • Temporarily raise mintthresh.th to mask a subset of levels.
  • You may raise the threshold,
    • Either to the highest level to temporary disable pre-emption, or
    • A higher level to allow smaller subset of higher interrupt levels to pre-empt.
  • Once the critical section is completed, return the mintthresh.th back to normal.