resource有三个参数 uvm_resource_db#(int)::set("scope","name资源",value) uvm_resource_db#(int)::read_by_name("scope","name资源",value) 会把资源存储到一个queue中,然后按顺序read_by_name。发布于 2023-11-01 11:22・IP 属地上海
从这两个函数的定义中,你就能发现read_by_type比read_by_name少了一个参数,这是因为当我们声明一个uvm_resource_db的时候,这个resource的Type,Scope/Regex和Value会被UVM保存到resource中,而name域的字符串只是作为一个Name Table的一个entry,也就是uvm_queue的index。每次我们取回我们想要的data的时候都需要通过比...
T val, uvm_object accessor = null);//和7类似只在name散列中位于队列头 10. static function bit read_by_name(input string scope,input string name,ref T val, input uvm_object accessor = null);//根据scope and name读出资源中的val,并⽤accessor做监听 11. static function bit read_by_...
)往database中存⼊信息,但⽤ uvm_resource_db::read_by_name()从database中读取信息;2. 选⽤uvm_resource_db还是uvm_config_db (1) 选取uvm_resource_db还是uvm_config_db取决于当前的setting是否需要考虑层次信息;如果会考虑层次,则采⽤uvm_config_db; 如果不考虑层次,则应该使⽤uvm_resource_db;
(3) uvm_config_db与uvm_resource_db共享同一套database; 因此可能会出现通过uvm_config_db::set()往database中存入信息,但用uvm_resource_db::read_by_name()从database中读取信息; uvm_resource_db#(type)::set("scope", "name", value, accessor); //path=scope+name, default value of accessor ...
1uvm_resource_db#(type)::set("scope","name", value, accessor);2//path=scope+name, default value of accessor is null;3uvm_resource_db#(int)::set("test","loop_cnt",10, this);45uvm_resource_db#(type)::read_by_name("scope","name", var, accessor);//accessor is not necessary;...
uvm_resource_db #(int)::read_by_name("", "var1", var1, this)) `uvm_error ("GET-FAIL", "not able to get value") else `uvm_info ("GET-PASS", $sformatf("var1=%0d", var1), UVM_NONE) endfunction endclass /// class my_env extends uvm_env; `uvm_component_utils (my_env...
六、Name Table, Type Table & UVM Resources 七、使用 uvm_resource_db API 检索 UVM 资源 A. uvm_resource_db#()::read_by_name Details B. uvm_resource_db#()::read_by_type 详细信息 八、使用 uvm_config_db API 存储 UVM 资源 A. UVM uvm_config_db Command & Usage ...