In reply to rajasravan:
The build-time behavior of uvm_config_db is explained in the Advanced UVM video course. If a test and an env both set a config_db value during build-time, the test’s value will be used because it is higher in the component hierarchy. This is what you would expect.
However, using the uvm_resource_db, since build_phase() is called top-down, the env’s build_phase is called after the test’s, so the env value would overwrite the test value.
Once start_of_simulation_phase is reached, a write using either the config_db or the resource_db will overwrite whatever is currently in the database for that specific parameter. This is what we mean by “last write wins.”