RTL Studio Open IDE

1.2 · SOC CLASS

Combinational address hit

Implement combinational address hit detection and decode error logic for a simple SoC address map.

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

What you practice

Combinational address hit (1.2). Implement combinational address hit detection and decode error logic for a simple SoC address map. It is in Address Hit — Part 1 · Address Map & Decode of the SoC Masterclass. Turn a memory map into combinational decode, one-hot selects, and an AXI-Lite fabric.

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 combinational logic to detect valid memory-mapped I/O addresses and flag decode errors. This skill is essential for building address decoders in system-on-chip designs.

Learning objectives

  • Implement range-checking logic for specific peripheral addresses.
  • Generate a decode error signal when an address does not match any slave or RAM.
  • Verify the decoder behavior using a simple testbench with static stimulus.

Theory

Address decoding maps a 32-bit address to specific hardware peripherals. Each peripheral occupies a defined memory region with a base address and size. A valid hit occurs when the input address falls within any defined region. A decode error occurs when the address matches no known region. Combinational logic evaluates these conditions in a single clock cycle.

Practice

Open the 1.2: Combinational address hit chapter in RtlStudio. Files appear automatically in the Explore panel. Open student/rtl/ip/soc/addr_decoder.sv to implement the decoder logic. Fill in the __TODO__ comments to define address ranges for GPIO and Timer. Use the pattern from the UART example for range checking. Define decode_err as true when no slave is hit and RAM is not hit. Open student/tb/tb_top.sv to review the testbench stimulus. The testbench drives two addresses and checks the output signals. Run Simulation from the sidebar and check the Log panel.

Summary

You implemented combinational logic to decode memory-mapped I/O addresses for GPIO and Timer peripherals. You generated a decode error signal to detect invalid accesses outside of known slave regions. The testbench verified that valid addresses trigger specific hits while invalid addresses raise errors. This practice ensures that address decoding correctly identifies peripheral regions and flags errors early.

© 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 Combinational address hit. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.