Part 3 · Factory & Configuration · Intermediate

Config Resolution Order: Precedence When Sets Compete

How config_db resolves multiple sets for the same consumer — path specificity, hierarchy position, and set timing.

Resolution model

When multiple sets target the same field for the same consumer, config_db applies path specificity first , then considers hierarchy position. Sets from higher in the tree (test, top) typically override VIP defaults set lower.

diagram
[CONFIG] precedence (consumer at uvm_test_top.env.apb.drv)

  Priority 1: Exact path match
    uvm_test_top.env.apb.drv + "timeout"

  Priority 2: Wildcard path match (most specific wildcard wins)
    uvm_test_top.env.apb.*   + "timeout"
    uvm_test_top.env.*       + "timeout"

  Priority 3: Global fallback
    *                        + "timeout"

  Higher hierarchy set typically beats lower VIP default set

Competing sets example

systemverilog
// VIP agent default (set in agent package init or agent build)
uvm_config_db#(int)::set(this, "*", "timeout", 500);

// Test override — wins for all agents under env
uvm_config_db#(int)::set(this, "env.*", "timeout", 2000);

// Surgical override — wins only for apb0 driver
uvm_config_db#(int)::set(this, "env.apb0.drv", "timeout", 50);
diagram
[UVM] effective timeout per component

  env.apb0.drv    50     (exact path wins)
  env.apb0.mon    2000   (env.* wildcard)
  env.apb1.drv    2000   (env.* wildcard)
  env.i2c.drv     2000   (env.* beats agent * default of 500)

exists() and introspection

Use exists() to probe whether a field is set without retrieving the value:

systemverilog
if (uvm_config_db#(int)::exists(this, "", "timeout"))
  `uvm_info("CFG", "timeout is set", UVM_LOW)

// Dump all config entries (verbose — use during debug)
uvm_config_db::dump();
  • exists() is useful for optional config with documented defaults.

  • dump() shows all entries — essential for path mismatch triage.

  • Print get_full_name() alongside dump output to correlate paths.

Key takeaways

  • More-specific paths win over broader wildcards.

  • Test-level sets typically override VIP package defaults.

  • Use exists() and dump() when resolution behavior is unclear.

Common pitfalls

  • Assuming last-set-wins globally — specificity rules apply, not order alone.

  • VIP default * set shadowing test intent due to wrong path specificity.

  • Not dumping config when two teams set the same field name differently.