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_adapterin UVM register layer integration. - Implement
reg2busto convertuvm_reg_bus_optoaxi_seq_itemfor writes. - Implement
bus2regto extract read data fromaxi_seq_iteminto 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.
| Method | Direction | Purpose |
|---|---|---|
reg2bus | Register → Bus | Converts uvm_reg_bus_op (e.g., write to data_reg) into axi_seq_item with addr, data, is_write=1. |
bus2reg | Bus → Register | Extracts 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
- Open RtlStudio and select Lesson 2.4 — confirm
student/tb/env/axi_ral_adapter.svandstudent/tb/tb_top.svappear in Explore. - Open
student/tb/env/axi_ral_adapter.svand implementreg2busto return anaxi_seq_itemwith correctaddr(0x00/0x04/0x08) anddatafromrg.value. - Implement
bus2regto assignbus.datatorg.valueafter$cast. - Run Simulation — verify
INFO:log lines appear, ending withINFO: 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
- Open the lesson in the IDE and find the valid/ready or AXI channel ports in the editor.
- Simulate with Verilator. Confirm the beat on the VCD, not only in the transcript.
- Check that data moves only on the beats this lesson describes, and that backpressure holds the transfer.
- 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.