Part 3 · Factory & Configuration · Intermediate
Virtual Interface Distribution Hub: HDL-to-UVM Bridge
Hub — static-to-UVM bridge, single and multi-instance vif patterns, config_db wiring, vif debug, and distribution checklists.
Overview
DUT pins live in static module/interface space; UVM components are dynamic class objects created during build_phase. Classes cannot instantiate interfaces directly — they need a virtual interface handle. config_db is the standard bridge that carries that handle from static top into dynamic driver, monitor, and env components.
This topic covers the full distribution pipeline: defining interfaces, publishing from top before run_test(), fan-out through env and agent, single vs multi-instance scoping, modport-specific handles, and systematic debug when vif is null.
Sub-lessons in this topic
vif-static-to-uvm-bridge — why virtual interfaces exist and the HDL/UVM boundary.
single-instance-vif-pattern — canonical top → env → agent → driver flow.
multi-instance-vif-pattern — distinct vifs per agent in multi-port SoCs.
config-db-vif-wiring — set/get paths, forwarding, and modport types.
vif-distribution-debug — null vif triage and timing mistakes.
vif-distribution-checklist — bring-up and regression verification checklist.
Distribution architecture map
Legend: [HDL] [CONFIG] [UVM]
[HDL] static world [UVM] dynamic world
───────────────── ───────────────────
module top class apb_driver
apb_if apb_if_i ──set()──► [CONFIG] ──get()──► virtual apb_if vif
dut (.apb(apb_if_i)) vif.psel <= 1;
endmodule endclass
interface = elaborated hardware construct
virtual if = pointer/handle to interface instance[HDL][CONFIG][UVM] distribution pipeline
top initial:
1. config_db.set(null, path, "vif", if_instance) [HDL publish]
2. run_test() [UVM start]
test.build_phase
env.build_phase
agent.build_phase
drv.build_phase
config_db.get(vif) [UVM consume] ✓
WRONG: run_test() before set → build_phase get fails → null vifKey takeaways
Virtual interface + config_db is the standard pin-access pattern in UVM.
Publish from static top before run_test(); get in build_phase with fatal on failure.
Scope distinct vifs per agent path for multi-instance environments.
Never defer first vif get to run_phase — fail fast in build_phase.
Common pitfalls
Getting vif lazily in run_phase — hides config bugs until stimulus time.
Same vif path for all agents when each needs a different interface instance.
Parameterized interface type mismatch — silent get failure.
Setting vif after run_test() — build_phase already ran, get returns 0.