uvm set/get的理解

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 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值