config_db机制用于在UVM验证平台间传递参数。它们通常都是成对出现的。set函数是寄信,而get函数是收信。 【在哪里用】 build_phase中使用cfg_db机制 【set 寄信】 uvm_config_db#(int)::set(this,"env.i_agt.drv","pre_num",100); int:需要填写要送的东西的类型 【get 收信】 uvm_config_db#(int):...
在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;my_config cfg;...function void bulid_phase(uvm_pha...
void'(uvm_config_db#(int)::get(this.m_parent, "i_agt.drv", "pre_num", drv_pre_num));`uvm_info("my_model", $sformatf("after get, the pre_num is %0d", drv_pre_num), UVM_LOW)endfunction//或void'(uvm_config_db#(int)::get(uvm_root::get(), "uvm_test_top.env.i_agt...
uvm_config_db#(my_config)::set(this,"env","cfg",cfg); ... endfunction endclass 在test.env中get: classmy_envextendsuvm_env; my_config cfg; ... functionvoidbulid_phase(uvm_phase phase); ... if(!uvm_config_db#(my_config)::get(this,"","cfg",cfg)) begin `uvm_fatal(" get c...
uvm_config_db#(my_config)::get(this, "", "cfg", cfg)) begin `uvm_fatal("MY_DRIVER", "Failed to get configuration data") end endfunction endclass class my_env extends uvm_env; my_driver drv; function new(string name = "my_env", uvm_component parent = null); super.new(name, ...
同理,**'agnt_cfg'** 这个类型句柄的index也已经存在于Type Table, 所以uvm_resource#(agnt_cfg)也不会重新创建一个uvm_queue,而是将句柄直接保存到已经存在的uvm_queue中。 Pseudo scope in uvm_resource_db: 正如我们在这部分开头提到的,uvm_resource_db相比较于uvm_config_db最大的优势在于它并不需要一个...
uvm_config_db#(int)::set(null,"uvm_test_top.fifo_env.wr_agt.drv","wr_stop_sig",wr_stop_sig) 1. AI检测代码解析 uvm_config_db#(int)::get(this,"","wr_stop_sig",wr_stop_sig); 1. 因为是在top中set,第一个参数为null,会自动替换为uvm_root::get(),即uvm_top。
class env_config extends uvm_object; int is_coverage = 0; int is_check = 0; agent_config m_agent_cfg; `uvm_object_utils_begin(env_config) `uvm_field_int(is_coverage, UVM_ALL_ON) `uvm_field_int(is_check, UVM_ALL_ON) `uvm_field_object(m_agent_cfg, UVM_ALL_ON) `uvm_object_...
uvm_config_db#(uvm object)::get(this,"", "cfg", tmp); void'($cast(cfg, tmp)); `uvm info ("SETVAL", $sformatf("cfg.vallis %d afterget",cfg.vall}, UVM_LOW) endfunction endclass class test1 extends uvm_test; `uvm_componen_utils(test1) ...
.. function void build_phase(uvm_phase phase); uvm_object tmp; uvm_config_db#(uvm_object)::get(this,"","cfg",tmp); //因为传递的是父类uvm_object,所以要做类型转换 void‘($cast(cfg,tmp)); ... endfunction endclass class test1 extends uvm_test;//顶层test中传递config `uvm_component_...