1,问题
在env里边set了qlen_db的virtual intf, 在qlen_db中使用的时候出现错误:
Error: uninitialized virtual interface object
错误分析: 肯定是qlen_db中没有拿到这个intf,所以才会出现uninitialized的问题
2,解决方法
在使用的时候,重新get一下。
3,注意事项
get和set都是在build_phase做的,build_phase是自顶向下的顺序执行的,其他的phase是自底向上执行的。
参考:
http://www.testbench.in/UT_05_UVM_CONFIGURATION.html
Configuration is a mechanism in UVM that higher level components in a hierarchy can configure the lower level components variables. Using set_config_* methods, user can configure integer, string and objects of lower level components. Without this mechanism, user should access the lower level component using hierarchy paths, which restricts reusability. This mechanism can be used only with components. Sequences and transactions cannot be configured using this mechanism. When set_config_* method is called, the data is stored w.r.t strings in a table. There is also a global configuration table.
Higher level component can set the configuration data in level component table. It is the responsibility of the lower level component to get the data from the component table and update the appropriate table.
Using get_config_* methods, user can get the required data if the data is available in the table.
http://www.synopsys.com/Services/Documents/hierarchical-testbench-configuration-using-uvm.pdf