Nios® V Processor Reference Manual

ID 683632
Date 5/25/2025
Public
Document Table of Contents

4.3.11.1.1.2. CLIC Interrupt Input Control (clicintctl)

clicintctl[i] is an 8-bit control register to specify interrupt level and interrupt priority. The most significant bit specifies the interrupt level while the least significant bit specifies the interrupt priority. If fewer than 8 bits are needed to specify interrupt and priority, the least significant bits of clicintctl[i] are WARL 1.

The processor selects the interrupt with the highest level by adhering to this procedure:
  1. The CLIC hardware picks the global maximum across all pending-and-enabled interrupts based on clicintctl.
  2. The interrupt level of this selected interrupt is compared with the interrupt-level threshold (mintthresh.threshold) to determine whether:
    • The level is qualified (Accepts interrupt), or
    • The level is masked (Ignores interrupt).
Phase 1: Assume the following settings is made in the Nios V processor IP Parameter Editor.
Table 122.  Possible Interrupt Levels and Priorities based on Cases
Case # of Levels Supported # of Priorities Supported Possible Interrupt Levels Possible Interrupt Priorities
A 256 levels 1 priority 0, 1, 2, …, 253 , 254, 255 255
B 17 levels (16 levels + Level 0) 16 priorities 0, 15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255 15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255
C 3 levels (2 levels + Level 0) 128 priorities 0, 127, 255 1, 3, 5, …, 251, 253, 255
D 9 levels (8 levels + Level 0) 16 priorities 0, 31, 63, 95, 127, 159, 191, 223, 255 15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255
E 9 levels (8 levels + Level 0) 8 priorities 0, 31, 63, 95, 127, 159, 191, 223, 255 31, 63, 95, 127, 159, 191, 223, 255
F 2 levels (1 level + Level 0) 1 priority 0, 255 255

At any given time, the Nios® V processor CLIC implements the specified number of interrupt levels plus an additional level 0 for application code. With non-zero interrupt levels as the only options for interrupts, the application code is always at a lower level than any interrupts.

Note: In Case A, the interrupt level 0 corresponds to the execution of application code, and must not be assigned to an interrupt. Assigning the interrupt level 0 disables the interrupt.
Phase 2: Writing clicintctl register with 0x85 or binary value of 10000101,
Table 123.  Configuration Made from Same Binary Values per Cases
Case Valid bits in clicintctl WARL bits Configuration made for this interrupt
Level Priority Level Priority
A 8 bits 0 bit 0 133 (binary = 10000101 ) 255 (binary = 11111111)
B 4 bits 4 bits 0 143 (binary = 1000 1111) 95 (binary = 0101 1111)
C 1 bit 7 bits 0 255 (binary = 1 1111111) 11 (binary = 0000101 1)
D 3 bits 4 bits 1 bit 159 (binary = 100 11111) 47 (binary = 0010 1111)
E 3 bits 3 bits 2 bits 159 (binary = 100 11111) 63 (binary = 001 11111)
F 0 bit 0 bit 8 bits 255 (binary = 11111111) 255 (binary = 11111111)