UVM Config DB Interview Questions
Deep dive into Configuration Database usage, debugging, and best practices.
Beginner Level
It acts as a global lookup table to pass data (configurations, virtual interfaces) from higher levels (Test/Env) to lower levels (Driver/Monitor) without connecting them via ports.
uvm_config_db#(type)::set(context, "inst_path", "field_name", value); uvm_config_db#(type)::get(context, "inst_path", "field_name", value);
Intermediate Level
1. Hierarchy Wins: A `set()` from `uvm_test` (Top) overrides a `set()` from `uvm_env` (Lower).
2. Time Wins: If two components at the same level call set(), the last one executes wins.
Advanced Level
`uvm_config_db` is actually a wrapper around `uvm_resource_db`.
- config_db: Hierarchical lookup (Scoping). Best for parent-child config.
- resource_db: Global pool (Name based). Best for shared resources anywhere.
Config DB is preferred 99% of the time due to hierarchy support.
Run simulation with `+UVM_CONFIG_DB_TRACE`. This prints all set/get operations to the log, allowing you to see typos in paths or types.