Hello,
I would like to ask a question which could be more philosophical or religious than technical, I am not really sure.
Here is the point:
- we set a virtual interface in the
config_db
in the physical test bench - in the agent config class, we have a virtual interface pointer
Traditionally, I get the virtual interface in the base test class, in which I have agent configs (because I potentially configure agents from the test), and I do the assignment of the agent config VIF to that object retrieved from the config_db
inside that base test class build phase, like:
if (!uvm_config_db #(virtual power_if)::get(this, "" , "m_power_vif", this.m_power_config.vif)) begin
`uvm_fatal(get_type_name(), "Power virtual interface not set for m_power_config")
end
this.m_env_config.m_power_config = this.m_power_config;
However, it is also possible not to do that, and do the get of the VIF from the config_db
inside the agent build phase.
So, is there a good reason to choose one method rather than the other? Any advantages? Caveats? I also assume that commercial VIPs would not necessarily be consistent about it.
Thanks in advance.