The standard RISC-V interrupt and timer complex, dropped into your SoC
The Zen Interrupt Controller is the platform interrupt stack a RISC-V hart expects, delivered as two independent, composable sub-blocks: a PLIC that prioritizes and routes external device interrupts to one or more harts, and a CLINT that supplies the machine timer and per-hart software interrupts (IPIs). Standard memory maps keep existing PLIC/CLINT-aware firmware, bootloaders, and kernels broadly portable. Product / integrator view; every number is sourced from the as-built RTL or marked TBC with an owner.
1. The controller in one paragraph
The Zen Interrupt Controller gives a RISC-V design the two interrupt facilities every hart assumes. The PLIC (Platform-Level Interrupt Controller) aggregates external device lines — UART, SPI, I2C, Ethernet, DMA, and the rest — captures each on its rising edge, gates it by a per-source priority and a per-context enable + threshold, arbitrates the highest-priority eligible source, and presents it to a hart over an atomic claim/complete handshake. The CLINT (Core-Local Interruptor) supplies the other half: a single free-running 64-bit machine timer, a per-hart compare that fires the timer interrupt, and a per-hart software interrupt bit for inter-processor signalling. The two sub-blocks are independent and relocatable — instantiate one, the other, or both — and each ships with APB4 and AXI4-Lite frontends for direct SoC attach.
- PLIC + CLINT (the controller)
- device sources / harts
2. What it is, at a glance
| Element | Detail | Default | Status |
|---|---|---|---|
| PLIC interrupt sources | configurable, edge-captured device lines | 32 | exists |
| PLIC sources (max) | upper bound on source count | 1023 | exists |
| PLIC contexts (targets) | per-hart / per-privilege interrupt targets | 2 | exists |
| PLIC contexts (max) | upper bound on context count | 15872 | exists |
| Per-source priority | levels 1–7; 0 disables the source | — | exists |
| Claim / complete | atomic handshake: read claims, write completes | — | exists |
| CLINT machine timer | free-running 64-bit mtime, shared across harts | — | exists |
| CLINT timer compare | per-hart 64-bit compare; IRQ while mtime ≥ compare | — | exists |
| CLINT software interrupt | per-hart pending bit for inter-processor IPIs | — | exists |
| CLINT harts | configurable hart count | 1 (max 4095) | exists |
| Host frontends | APB4 and AXI4-Lite wrappers, both sub-blocks | — | exists |
Post-synthesis fmax / timing | functional sign-off shipped; timing closure downstream | TBC | TBC |
Sources: Zen Interrupt Controller product datasheet; as-built RTL.
3. How a client uses it
- Instantiate the PLIC, the CLINT, or both; pick an APB4 or AXI4-Lite frontend per sub-block and place each in its own SoC address window.
- Wire sources and harts — tie device interrupt lines into the PLIC inputs and route each sub-block's outputs onto the hart's external (
meip/seip), timer (mtip), and software (msip) lines. - Service external interrupts — set per-source priority and per-context enable + threshold; on the external line, read the context claim register to atomically claim the top pending source, service it, then write the same ID back to complete.
- Run the scheduler tick and IPIs — program
mtimecmp = mtime + intervalfor a periodic timer interrupt, re-arming each tick; raise a software interrupt on another hart by writing itsmsipbit, cleared by the target.
4. Verification & provenance
- Compliance suite: 12 of 12 assertion-based tests pass — PLIC 6/6 (reset, single-source claim, threshold gating, priority arbitration, disabled-source gating, claim/complete clears) and CLINT 6/6 (reset, software interrupt, timer free-run, 64-bit compare readback, timer-IRQ fires, timer gating).
- Method & tooling: assertion-based cocotb with a struct-typed peripheral-bus VIP; synthesis passes the mandatory Yosys synth-check (core). Formal / HVP coverage closure is open, pending DV tooling, with thresholds TBC (owner: verif).
- Compliance: re-expressed against the RISC-V Privileged specification for both the platform-level controller and the core-local timer/software-interrupt model; the one addressing deviation is disclosed above.
Sources: Zen Interrupt Controller product datasheet; as-built RTL.