config_db 是参数化的,它的类型可以是标量、类句柄、队列、列表,甚至是虚拟接口。通过uvm_config_db::set 和 uvm_config_db::get 函数进行全局存储和检索数据库中的信息。二、set和get函数 1、set函数 set函数的原型为 static function void set(uvm_component cntxt,string inst_name,string field_name,T ...
第四个参数:和set不同,此时的value是那个要从数据库检索值(也就是要从盒子里取得value)的变量。 get 如果成功返回 1 ,如果数据库中没有找到此类资源则返回 0;set是空函数没有返回值。 3、其他说明 inst_name和field_name都可以包含通配符或正则表达式。 cntxt可以为null,这时inst_name提供完整的层次信息,cntxt...
在top_tb.sv中,set函数的第一个参数为null,第二个参数为uvm_test_top(测试用例的实例名),第三个参数为input_if接口的索引名(类似于关联数组的字符串),第四个参数表示将那个interface通过uvm_config_db传递给my_driver。 get函数一般在my_driver中,第一个参数为this,第二个参数可以不写(省略),第三个参数为...
uvm_config_db#(virtual my_if)::set(null, "uvm_test_top", "vif", input_if); 2. 收信(Get): 在`my_driver`或其他UVM组件中,他们在开始工作之前会通过`uvm_config_db#(...)::get(...)`来“收信” - 即查找并获取接口实例的地址。 // 在my_driver中 - 收信 virtual my_if vif; if ...
对于uvm_config_db来说,在调用get()函数检索数据库的时候,get()函数传递的{cntxt,”.”, inst_name}会作为uvm_re_match()的str的实参,set()函数设置的{cntxt,”.”, inst_name}在经过uvm_glob_to_re()处理后作为uvm_re_match()的实参,这也就是为什么set()参数的inst_name支持正则格式,而get()参数...
的一些功能进行了扩展,在写入操作上重载了uvm_resource_db的set 函数,在读操作上新建了一个get 函数。 让我们来看看这两个静态函数set and get 函数(有点类似于存储器的写和读功能),首先来看,uvm_config_db 的set 函数。再看uvm_config_db 的get 函数。
//| uvm_config_db#(int)::set(this, "*", "A");// // The parameter value "int" identifies the configuration type as // an int property.// // The <set> and <get> methods provide the same API and // semantics as the set/get_config_* functions in <uvm_component>.//--- c...
("e0", this); // Get virtual IF handle from the top level and pass it to everything // in the env level if(!uvm_config_db#(virtual des_if)::get(this, "", "des_if", vif)) `uvm_fatal("TEST", "Did not get vif") uvm_config_db#(virtual des_if)::set(t...
uvm_config_db#(T)::get(uvm_component cntxt,stringinst_name,stringfiled_name, inout T value); 2.2 举个栗子: intval1; uvm_config_db#(int)::get(this," ","val1", val1); 2.3 参数含义 1)set() 第⼀个参数必须为uvm_component 的实例的指针,this代表本域所属component的指针。
Hi All, Can someone tell whats the exact difference between uvm_config_db::set and uvm_config_db::wait_modified? How to decide which one to use? And also explain me how the internal mechanism of factory works when I set and get and also when I set and wait_modified? 4.0...