也就是说,uvm_set_config_int是在new之后,build_phase之前完成的。大家在使用的时候一定要注意这个失效时间,避免多次赋值互相干扰。 图12 uvm_set_config参数生效时间测试结果 3uvm命令行参数的限制 1. uvm命令行参数目前只能给component传递,不能给object传递。不过大家可以换一个思路,比如sequence里面要用参数mydat...
那么,如果对这么多层次中的变量做出类似上面的单一变量设置,一方面需要更多的代码,这就容易出错,不易于阅读,另外一方面也不易于复用,毕竟底层组件的变量有添加或者减少,通过uvm_config_db::set是无法得知是否设置成功的。因此,如果将每个组件中的变量加以整合,首先放置到一个uvm_object中用于传递,那么将会更有利于整体...
也就是说,uvm_set_config_int是在new之后,build_phase之前完成的。大家在使用的时候一定要注意这个失效时间,避免多次赋值互相干扰。 图12 uvm_set_config参数生效时间测试结果 3uvm命令行参数的限制 1. uvm命令行参数目前只能给component传递,不能给object传递。不过大家可以换一个思路,比如sequence里面要用参数mydat...
上面提到的set_config_/get_config_方法是成对出现的,这些散列的API分别针对于int、string和object类型做出了配置,然而对于其它的类型例如real、数组等类型,无法直接通过API进行传递,而只能封装在uvm_object中进行间接传递。下面是这些API函数的列表: set_config_int(string name, string field_name, int value) set_...
set和get方法是静态的,所以必须使用 ::三、一个示例 在test中set:class my_test extends uvm_test;my_config cfg;...function void bulid_phase(uvm_phase phase);...uvm_config_db#(my_config)::set(this,"env","cfg",cfg);...endfunctionendclass 在test.env中get:class my_env extends uvm_env;...
Config_db使用双冒号是因为这两个函数是静态函数。 五、transaction 通过transaction实现由信号级到事务级的转换。 uvm_component_utils注册的变量具有静态声明周期,比如driver。而由uvm_object_utils注册的变量具有动态生命周期,比如transaction。 在调用transaction的randomize被调用之后,post_randomize会被自动调用。
config:所有的config直接从uvm_object派生,config的主要功能是规范验证平台的行为方式。 uvm_reg_item:派生自uvm_sequence_item,用于register model中。 uvm_phase:派生自uvm_object,控制uvm_component的行为方式,使得uvm_component平滑地在各个不同的phase之间依次运转。
class A#(int width) extends uvm_object 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 3.1.5与uvm_component相关的宏, 通过将这些component注册到factory中,以及变量进行域的自动化。可以1)使得component获得object的拥有的compare、print函数,2)还可以自动调用:config_db::get来得到变量的值 ...
在UVM提供了uvm_config_db配置类以及几种方便的变量设置方法来实现仿真时的环境控制,常见的uvm_config_db类的使用方式包括: 传递virtual interface到环境中; 设置单一变量值,例如int,string,enum等; 传递配置对象(config object)到环境; • uvm_config_db#(T): :set(uvm_component cntxt, string inst_name, ...
uvm_component parent);super.new(name,parent);endfunctionfunctionvoidbuild_phase(uvm_phase phase);wb_mon_ap=new("wb_mon_ap",this);m_config=wb_config::get_config(this);// get config objectm_bfm=m_config.WB_mon_bfm;// set local virtual if propertym_bfm.proxy=this;//Set BFM proxy ...