Part 3 · Factory & Configuration · Intermediate

config_db Debug: Triage Silent Failures and Path Mismatches

A systematic debug workflow for missing config, type mismatches, path errors, and timing mistakes — with instrumentation patterns.

The silent failure problem

config_db get() returns 0 on failure without error by default. The consumer continues with uninitialized or default values. Most config bugs are silent until run_phase when null vifs or wrong timeouts cause cryptic failures.

diagram
[CONFIG] debug triage order

  1. Print consumer get_full_name()
  2. Compare to set path — does uvm_test_top prefix + set path match?
  3. Verify field name string identical on set and get
  4. Verify #(T) identical on set and get
  5. Confirm set() ran BEFORE consumer build_phase get()
  6. Run uvm_config_db::dump() and search for field name

Diagnostic code patterns

systemverilog
function void build_phase(uvm_phase phase);
  super.build_phase(phase);
  `uvm_info("CFG_DBG", $sformatf("full_name=%s", get_full_name()), UVM_LOW)

  if (!uvm_config_db#(virtual apb_if)::get(this, "", "vif", vif))
    `uvm_fatal("NOVIF", $sformatf("vif not set for %s", get_full_name()))
endfunction
systemverilog
// Trace wrapper for project-wide visibility
function bit cfg_get_int(uvm_component ctx, string field, output int val);
  bit ok;
  ok = uvm_config_db#(int)::get(ctx, "", field, val);
  `uvm_info("CFG_GET",
    $sformatf("inst=%s field=%s ok=%0d val=%0d",
      ctx.get_full_name(), field, ok, val), UVM_LOW)
  return ok;
endfunction

Common failure signatures

Failure matrix

diagram
[CONFIG] symptom  likely cause

  get returns 0, vif is null:
     path mismatch OR set after build_phase OR type mismatch

  wrong timeout value (not default):
     competing set with higher-precedence path

  works in directed test, fails in random test:
     test build_phase ordering (set after super.build_phase)

  works for agt0, fails for agt1:
     path set to env.apb0.* but not env.apb1.*

Fix verification checklist

  1. Reproduce with CFG_DBG verbosity enabled.

  2. Confirm set path matches get_full_name() hierarchy.

  3. Run uvm_config_db::dump() — entry visible with correct type.

  4. Verify get() return is 1 with uvm_info log.

  5. Run smoke test on all agents/components that consume the field.

diagram
[UVM] closure evidence

  before: get ok=0, vif=null at env.apb1.drv
  after:  get ok=1, set path env.apb1.* added in top.sv
  proof:  same seed passes, dump shows entry at correct scope

Key takeaways

  • Treat unchecked get() as a bug — always verify return for required fields.

  • get_full_name() + dump() resolves 90% of path mismatches.

  • Add low-cost trace wrappers in debug/nightly simulation profiles.

Common pitfalls

  • Debugging sequence behavior before proving config propagation.

  • Disabling config trace after first fix without regression proof.

  • Using uvm_warning for missing vif then dereferencing in run_phase.