RTL Studio Open IDE

2.5 · SOC CLASS

IRQ aggregator (OR tree)

Implement an IRQ aggregator using a reduction OR operator to combine multiple interrupt lines into a single output.

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

What you practice

IRQ aggregator (OR tree) (2.5). Implement an IRQ aggregator using a reduction OR operator to combine multiple interrupt lines into a single output. It is in IRQ Aggregator — 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 combine multiple peripheral interrupt request lines into a single output signal. This technique is essential for simplifying interrupt handling in complex System-on-Chip designs.

Learning objectives

  • Understand the purpose of an IRQ aggregator in a peripheral island.
  • Implement a reduction operator to combine multiple boolean signals.
  • Verify the logic using a simple testbench with stimulus and assertions.

Theory

An IRQ aggregator reduces multiple interrupt lines into one active-high signal. This allows a central interrupt controller to service any active peripheral with a single line. The most common implementation is a logical OR tree. In SystemVerilog, the reduction OR operator | efficiently implements this logic. The operator takes a vector and returns a single bit that is high if any bit in the vector is high. This is more concise than writing out individual OR gates for each line.

OperatorTypeDescription
``ReductionReturns 1 if any bit in the operand is 1.
&ReductionReturns 1 if all bits in the operand are 1.
^ReductionReturns 1 if an odd number of bits are 1.

Practice

  1. Open RtlStudio and select this chapter.
  2. Navigate to the Explore panel.
  3. Open student/rtl/ip/soc/irq_aggregator.sv.
  4. Replace the __TODO__ comment with the correct reduction OR assignment.
  5. Open student/tb/tb_top.sv to review the testbench stimulus.
  6. Run Simulation from the sidebar.
  7. Check the Log panel for INFO: PASS.

Summary

You implemented an IRQ aggregator module to combine multiple peripheral interrupt requests into a single output line. This exercise reinforced the use of the reduction OR operator to efficiently create an OR tree in SystemVerilog. The testbench verified that the aggregated signal correctly reflects any active interrupt from the input vector.

© 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 aggregator (OR tree). Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.