RTL Studio Open IDE

1.4 · RV SYS CLASS

ROM RAM CSR map

Classify memory addresses into RAM, MMIO, or unmapped holes using a memory map table and address decoder.

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

What you practice

ROM RAM CSR map (1.4). Classify memory addresses into RAM, MMIO, or unmapped holes using a memory map table and address decoder. It is in ROM/RAM/CSR region map — Part 1 · Core on Bus (MMIO) of the RISC-V on SoC & System Masterclass.

The core and the mini-SoC simulate as one workspace in the IDE. Follow MMIO, interrupts, and the program on the Verilator waveform, not only a pass line.

What you will learn

You will classify memory addresses into RAM, MMIO, or unmapped holes using a memory map table and address decoder. This classification is essential for building a correct SoC platform that handles peripheral accesses safely.

Learning objectives

  • Connect the addr signal to the memory_map_table instance.
  • Understand how addr_decoder identifies specific MMIO regions.
  • Verify RAM base address mapping and MMIO hit detection.
  • Detect unmapped address holes to prevent illegal bus transactions.

Theory

A System-on-Chip (SoC) uses a memory map to assign address ranges to specific hardware blocks. The memory_map_table module compares the incoming address against defined base addresses and sizes. It outputs a region index and permission bits to indicate which block owns the address. The addr_decoder module refines this by checking specific MMIO registers for exact hits. Addresses that fall outside all defined ranges are considered holes and should trigger a decode error.

SignalDirectionDescription
addrInput32-bit address from the bus master.
region_idxOutputIndex of the matched memory region.
in_mapOutputHigh if the address falls within any mapped region.
region_permOutputPermission bits (read/write/execute) for the region.
addr_hitOutputBitmask indicating which specific MMIO register matched.
decode_errOutputHigh if the address is unmapped or invalid.
is_ramOutputHigh if the address falls within the RAM region.
is_mmioOutputHigh if any MMIO bit in addr_hit is set.

Practice

Open student/rtl/design.sv in the editor. Locate the memory_map_table u_map instance. Replace the entire __TODO__[0] placeholder on the .addr port with addr. Replace the entire __TODO__[0] placeholder on the .region_idx port with region_idx. Replace the entire __TODO__[0] placeholder on the .in_map port with in_map. Save the file. Open student/tb/tb_top.sv in the editor. Navigate to the left sidebar and click Simulation. Click Run to start the simulation. Watch the Log panel for the INFO: lines as the testbench steps through the address checks.

Summary

You practiced connecting the memory map table and address decoder instances to classify bus addresses into RAM, MMIO, or unmapped regions. By correctly mapping the u_map ports, you enabled the design to distinguish between static RAM ranges and specific peripheral registers like GPIO and TIMER. This exercise demonstrated how address decoding signals drive the system's ability to route transactions and detect invalid access attempts.

© 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 system lesson in the IDE. The RV32I core and the mini-SoC fabric simulate together.
  2. Run Verilator and trace the program through MMIO: address, load/store data, and the peripheral response.
  3. Interrupts and DMA belong on the waveform next to the instruction stream, not only in a pass/fail line.
  4. Edit the integration RTL, resimulate, and run Yosys on the structural block when you want a netlist.

The lesson is done when the simulation matches ROM RAM CSR map. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.