I have looked at different environments, and they use the method in different ways, for ex:
// 1: allowing access to all testbench components
// I understand this isn't best practice as it would increase searching time, when using get().
uvm_config_db #(virtual intf)::set(null,"*","inf0",inf0); // @ tb_top
// 2: sending to driver and monitor directly
// I understand this isn't best practice, as a config class could be sent to agent, and
// depending on some of its values, the agent makes different tweaks to the driver and monitor?
uvm_config_db #(virtual intf)::set(null,"uvm_test_top.m_env.m_agent_0.m_driver","inf0",inf0); // @ tb_top
uvm_config_db #(virtual intf)::set(null,"uvm_test_top.m_env.m_agent_0.m_monitor","inf0",inf0);// @ tb_top
// 3: sending to env, then to agent.
// How about this? is it really needed to pass by env?
uvm_config_db #(virtual intf)::set(null,"uvm_test_top.m_env","inf0",inf0); // @ tb_top
uvm_config_db #(virtual intf)::set(this,"m_agent_0","inf0",inf0); // @ env
// 4: sending directly to required agents without passing by env.
// I think this is the best practice?
uvm_config_db #(virtual intf)::set(null,"uvm_test_top.m_env.m_agent_0","inf0",inf0); // @ tb_top
So, what is the best practice, that I can generalize in any environment?
I am grateful for any extra insights or corrections. Thank you.