RTL Studio Open IDE

2.4 · AXI CLASS

UVM RAL adapter for AXI: reg2bus and bus2reg

Translate register operations to AXI4-Lite bus transactions via reg2bus and bus2reg.

Watch on YouTube

What you practice

UVM RAL adapter for AXI: reg2bus and bus2reg (2.4). Translate register operations to AXI4-Lite bus transactions via reg2bus and bus2reg. It is in UVM RAL Adapter for AXI — Part 2 · AXI4-Lite UVM Verification of the AXI Masterclass. Verify the AXI4-Lite DUT with UVM and RAL.

AXI only counts when the handshake simulates. RTL Studio is the Verilog and SystemVerilog IDE where you edit the RTL and prove each beat on a VCD.

What you will learn

You will implement a UVM register adapter to bridge register-level operations (via uvm_reg) to AXI4-Lite bus transactions (axi_seq_item) using reg2bus and bus2reg methods.

Learning objectives

  • Understand the role of uvm_reg_adapter in UVM register layer integration.
  • Implement reg2bus to convert uvm_reg_bus_op to axi_seq_item for writes.
  • Implement bus2reg to extract read data from axi_seq_item into the register model.
  • Connect the adapter to a register block and verify via a frontdoor write/read.

Theory

UVM register adapters translate between high-level register operations and low-level bus protocol sequences.

MethodDirectionPurpose
reg2busRegister → BusConverts uvm_reg_bus_op (e.g., write to data_reg) into axi_seq_item with addr, data, is_write=1.
bus2regBus → RegisterExtracts data from axi_seq_item (e.g., read response) into uvm_reg.value.

The adapter is assigned to uvm_reg_block.adapter, enabling frontdoor access via blk.data_reg.write(...).

Practice

  1. Open RtlStudio and select Lesson 2.4 — confirm student/tb/env/axi_ral_adapter.sv and student/tb/tb_top.sv appear in Explore.
  2. Open student/tb/env/axi_ral_adapter.sv and implement reg2bus to return an axi_seq_item with correct addr (0x00/0x04/0x08) and data from rg.value.
  3. Implement bus2reg to assign bus.data to rg.value after $cast.
  4. Run Simulation — verify INFO: log lines appear, ending with INFO: PASS.

Summary

You implemented a UVM register adapter to bridge register-level operations with AXI4-Lite bus transactions. You customized the reg2bus and bus2reg methods to convert uvm_reg_bus_op structures to and from axi_seq_item transactions. The adapter enables seamless integration of the register model with the AXI driver and monitor in the testbench. This foundational step ensures register accesses are correctly translated to protocol-specific bus operations.

Run it in the Verilog IDE

  1. Open the lesson in the IDE and find the valid/ready or AXI channel ports in the editor.
  2. Simulate with Verilator. Confirm the beat on the VCD, not only in the transcript.
  3. Check that data moves only on the beats this lesson describes, and that backpressure holds the transfer.
  4. Synthesize the RTL master, slave, or buffer with Yosys. Leave the UVM bench out of synthesis.

The lesson is done when the simulation matches UVM RAL adapter for AXI: reg2bus and bus2reg. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.