Part 11 · Senior Prep · Intermediate

Config Failure Triage: config_db Path, Type, and Timing

Config-bucket playbook for config_db get failures, null virtual interfaces, and configuration timing bugs across build_phase hierarchy.

Config bucket first moves

Config failures mean a set/get mismatch — wrong path, wrong field name, wrong type, or set happened after get. Grep both sides before editing.

diagram
[DEBUG][SENIOR][UVM] config triage flow

1) copy exact get() failure string from log
2) grep entire TB for set() of same field name
3) compare inst_path: set "env*" vs get "env.agt.drv"
4) compare type: virtual interface vs concrete modport
5) confirm set ran in build_phase BEFORE get component exists
systemverilog
// canonical vif push from top module
initial begin
  uvm_config_db#(virtual bus_if)::set(null, "uvm_test_top.env.agt*", "vif", bus_if0);
end

// canonical vif get in driver build_phase
function void build_phase(uvm_phase phase);
  if (!uvm_config_db#(virtual bus_if)::get(this, "", "vif", vif))
    `uvm_fatal("CFG", "virtual interface not configured")
endfunction

Key takeaways

  • config_db failures are almost always path, name, or type mismatches.

  • Set must precede get in phase order — not just in simulation time.

  • Use wildcard paths deliberately; document the contract.

Common pitfalls

  • Changing get path without finding the matching set.

  • Type mismatch: virtual modport vs virtual interface.

  • Setting config in run_phase when get happens in build_phase.


Path and type debugging

Senior config triage uses a structured audit of every set/get pair for the failing field.

Audit template

diagram
[DEBUG][SENIOR][UVM] config_db audit sheet

field:     vif
type:      virtual bus_if
set path:  uvm_test_top.env.agt*
get path:  "" (relative to agt.drv)
set phase: top initial / test build_phase
get phase: driver build_phase

checklist:
  [ ] field name identical (case sensitive)
  [ ] type parameter identical
  [ ] set inst_path matches get hierarchy
  [ ] set ran before get component build
systemverilog
// debug helper: log every successful get
function bit cfg_get_vif(output virtual bus_if out);
  if (uvm_config_db#(virtual bus_if)::get(this, "", "vif", out)) begin
    `uvm_info("CFG_GET", $sformatf("%s got vif OK", get_full_name()), UVM_LOW)
    return 1;
  end
  `uvm_error("CFG_GET", $sformatf("%s vif get FAILED", get_full_name()))
  return 0;
endfunction

Common config failure patterns

  • Top sets vif on env but driver gets from agent — path too narrow.

  • Test pushes cfg object after env build_phase already ran.

  • Two agents share one vif name — second get overwrites or fails.

  • Generate block moved set from initial to run_phase.

bash
# find all set/get for a field
grep -rn 'config_db.*::set.*"vif"' tb/
grep -rn 'config_db.*::get.*"vif"' tb/
diagram
[DEBUG] config pass criteria

set and get paths documented in agent README
and
smoke test prints "got vif OK" for every agent
and
no get failure in elaboration log

Common pitfalls

  • Using absolute paths in get but relative in set without verifying match.

  • Config object randomize after set — child sees stale values.

  • Silent null vif: get returns 0 but code does not uvm_fatal.