Hardware interview practice
Config_db build-time precedence
During build, the test sets mode=1 for env.*. Later, in agent a0's build_phase, a0 sets mode=2 for itself and then gets mode. Both settings match. Under mainstream UVM build-time precedence, which value wins?
Starting point
Question code
// In test::build_phase
uvm_config_db#(int)::set(this, "env.*", "mode", 1);
// Later, in a0::build_phase
uvm_config_db#(int)::set(this, "", "mode", 2);
void'(uvm_config_db#(int)::get(this, "", "mode", mode));Choose one
Answer choices
- A. 2, because the most recent set always wins regardless of phase or hierarchy
- B. 1, because build-time settings from higher hierarchy levels have higher precedence
- C. 2, because an exact path always outranks any wildcard
- D. The get must fail because two resources match
