RTL Studio Open IDE

2.4 · SOC CLASS

IRQ status / enable / clear

Implement sticky IRQ status, enable, and clear CSRs using AXI-Lite interface logic.

Video coming soon. This lesson page stays at the same URL when the lecture publishes.

What you practice

IRQ status / enable / clear (2.4). Implement sticky IRQ status, enable, and clear CSRs using AXI-Lite interface logic. It is in IRQ Status Enable Clear — Part 2 · Peripheral Islands of the SoC Masterclass. Build GPIO, timer, UART, and IRQ islands, then wrap them as a peripheral subsystem.

SoC lessons simulate the fabric and the peripheral together in the IDE. Verilator is the simulator; the waveform is where address and response show up.

What you will learn

You will implement sticky interrupt request (IRQ) status, enable, and clear Control and Status Registers (CSRs). This logic allows the system to track pending interrupts and selectively enable or clear them via AXI-Lite writes.

Learning objectives

  • Define register addresses for status, enable, and clear operations.
  • Implement a sticky status register that captures interrupt lines.
  • Implement a clear mechanism that allows software to acknowledge and remove pending interrupts.

Theory

The IRQ controller uses three main registers to manage interrupt state. The status register is sticky, meaning it retains the interrupt flag until explicitly cleared. The enable register acts as a mask to allow or block specific interrupt lines. The clear register is a write-only or write-clear register that resets specific bits in the status register. This pattern is common in embedded systems to handle asynchronous events reliably.

RegisterAddressAccessDescription
Status0x00ReadSticky flags for pending IRQs.
Enable0x04Read/WriteMask bits to enable specific IRQs.
Clear0x08WriteWrite 1 to clear corresponding status bits.

Practice

  1. Open RtlStudio and select this chapter in the Examples list.
  2. Open student/rtl/ip/soc/irq_csr.sv in the editor.
  3. Define the REG_STATUS, REG_ENABLE, and REG_CLEAR localparam values based on the table above.
  4. Implement the clr_pending logic to detect when a write occurs to the Clear register address.
  5. Open student/tb/tb_top.sv and run the simulation.
  6. Check the Log panel for the INFO lines and verify the PASS status.

Summary

You implemented sticky interrupt status, enable, and clear control registers to manage hardware interrupt signaling. This practice demonstrated how to latch IRQ events and use a write-only clear register to acknowledge them. The key takeaway is understanding the standard pattern for preventing missed interrupt pulses in peripheral designs.

© 2026 RtlStudio. Licensed under CC BY-NC-ND 4.0. Commercial use and modifications by third parties are not permitted.

Run it in the Verilog IDE

  1. Open the lesson workspace in the IDE. The fabric and the peripheral are one simulation.
  2. Run Verilator and follow the address, write data, and read response on the waveform.
  3. A passing log is not enough when decode or an IRQ line is the point of the lesson — those show up on the VCD.
  4. Run Yosys on the RTL island you just integrated when you want the mapped cells.

The lesson is done when the simulation matches IRQ status / enable / clear. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.