RTL Studio Open IDE

5.2 · UVM CLASS

Why UVM RAL maps registers to objects

Map APB registers (CTRL/STAT/DATA) to uvm_reg objects in a register block.

Watch on YouTube

What you practice

Why UVM RAL maps registers to objects (5.2). Map APB registers (CTRL/STAT/DATA) to uvm_reg objects in a register block. It is in RAL concept — Part 5 · AMBA APB and UVM RAL of the UVM Masterclass. APB protocol, register abstraction, and the roadmap to AXI.

The UVM bench compiles in that same browser SystemVerilog simulator. You edit the test in the IDE, run Verilator, and read the log beside the waveform.

What you will learn

This lesson explains how hardware registers (CTRL, STAT, DATA) are abstracted as UVM register objects, enabling software-like register access in verification environments.

Learning objectives

  • Understand the purpose of UVM RAL (Register Abstraction Layer) in verification.
  • Recognize how register addresses, access types, and fields map to uvm_reg objects.
  • See how a register block (uvm_reg_block) ties together registers and memory maps.
  • Connect the register model to an APB driver via a virtual interface.

Theory

UVM RAL maps hardware registers to software objects so verification components can read/write registers using high-level APIs instead of raw protocol transactions.

Hardware ConceptUVM RAL Equivalent
Register addressuvm_reg::get_address()
Read/Write accessuvm_reg_field::access (e.g., "RW", "RO")
Register blockuvm_reg_block containing multiple uvm_reg instances
Memory mapuvm_reg_map associated with a bus agent (e.g., APB)

A register model (apb_reg_block) is built once and reused across tests to perform register-level stimulus (e.g., reg_model.ctrl_reg.write(status, 0xABCD)), decoupling test logic from protocol details.

Practice

Open RtlStudio and select this chapter. Files appear automatically in Explore.

  1. Open student/tb/tb_top.sv in the editor.
  2. Add register model declarations and build logic using uvm_reg APIs.
  3. Declare apb_reg_block, uvm_reg ctrl_reg, uvm_reg stat_reg, and uvm_reg data_reg with correct addresses (0x00, 0x04, 0x08) and access types (RW, RO, RW).
  4. In the build() method, create the register map, instantiate each register, add fields (e.g., uvm_reg_field for ctrl_reg[7:0]), and connect the map to the APB agent via uvm_config_db.
  5. Run Simulation and verify log output matches Expected Results below.

Summary

You practiced building an APB register model using UVM RAL, declaring three registers—ctrl_reg, stat_reg, and data_reg—aligned with the hardware memory map. You configured each register’s access type, address offset, and field policies to match the physical register behavior. The key takeaway is that UVM RAL transforms hardware registers into software-accessible objects, enabling structured, reusable verification of register-level functionality. This abstraction bridges hardware design and verification, making register access predictable and testable.

Run it in the Verilog IDE

  1. Open the UVM workspace in the IDE. The DUT and the testbench compile together in the browser.
  2. Run the SystemVerilog simulation with Verilator and read the phase and scoreboard lines in the log.
  3. When the check is on pins rather than a print, open the VCD next to that log.
  4. Edit the sequence, driver, or scoreboard in the IDE and rerun. You stay in the same simulator.

The lesson is done when the simulation matches Why UVM RAL maps registers to objects. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.