RTL Studio Open IDE

5.4 · UVM CLASS

Mission: reg_model frontdoor write() one-liner

Control APB registers with a single RAL frontdoor write() instead of raw bus sequences.

Watch on YouTube

What you practice

Mission: reg_model frontdoor write() one-liner (5.4). Control APB registers with a single RAL frontdoor write() instead of raw bus sequences. It is in Frontdoor — 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

Today you will use UVM RAL’s frontdoor mechanism to write registers via high-level reg_model.ctrl_reg.write() calls instead of manually driving APB bus signals.

Learning objectives

  • Understand how UVM RAL’s frontdoor maps register operations to bus transactions.
  • Use reg_model.ctrl_reg.write(status, value, UVM_FRONTDOOR) to trigger APB writes.
  • Verify APB protocol signals (PSEL, PENABLE, PADDR, PWDATA) appear correctly.
  • Distinguish between direct (UVM_BACKDOOR) and frontdoor (UVM_FRONTDOOR) register access.

Theory

UVM RAL provides two ways to access registers: backdoor (direct HDL path) and frontdoor (via bus protocol). Frontdoor uses a registered adapter (apb_ral_adapter) to translate reg_item into apb_sequence_item, then drives the virtual interface. This mimics real software-driven register access.

Access TypePathUse Case
UVM_BACKDOORDirect memory read/write via reg_block::configure(..., .path("backdoor"))Debug, reset values
UVM_FRONTDOORadapter → sequencer → driver → vifRealistic bus protocol testing

The frontdoor path for a write() call is: reg_model.ctrl_reg.write(..., UVM_FRONTDOOR) → apb_ral_adapter::reg2bus() → apb_sequence → apb_driver → vif.psel, vif.penable, etc.

Practice

Open RtlStudio and select this chapter. Files appear in Explore — no manual setup needed.

  1. Open student/tb/tb_top.sv in the editor.
  2. In the initial block, after test.build_phase(phase);, add a call to reg_model.ctrl_reg.write(status, 32'h5, UVM_FRONTDOOR); to trigger a frontdoor write.
  3. Optionally add reg_model.data_reg.write(status, 32'hDEADBEEF, UVM_FRONTDOOR); after the first write.
  4. Run Simulation from the left sidebar.
  5. Check the Log panel for INFO: lines confirming APB transactions.
  6. Open the Waveform tab to verify PSEL, PENABLE, PADDR, PWDATA follow APB protocol.

Summary

You practiced controlling APB registers using a single high-level RAL write() call with UVM_FRONTDOOR, bypassing low-level bus sequences. This approach leverages the RAL adapter to automatically translate register operations into APB protocol signals like PSEL and PENABLE. The key takeaway is that frontdoor access enables clean, reusable register control without manual sequence coding.

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 Mission: reg_model frontdoor write() one-liner. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.