当前位置: 首页 > news >正文

亦庄网站开发公司百度账号购买网站

亦庄网站开发公司,百度账号购买网站,网站怎么做桌面快速链接,设计说明生成器网页版uvm_resource_db是一个类型参数化 type-parameterized的类,它是资源数据库顶部的一个方便层(convenience layer)。这个便利层简化了对低级数据库的访问,并且没有添加新功能。因此,uvm_resource_db不是从uvm_resource类派生的。以下uvm_resour…

uvm_resource_db是一个类型参数化 type-parameterized的类,它是资源数据库顶部的一个方便层(convenience layer)。这个便利层简化了对低级数据库的访问,并且没有添加新功能。因此,uvm_resource_db不是从uvm_resource类派生的。
以下uvm_resource_db类的代码段取自uvm源代码。

class uvm_resource_db #(type T=uvm_object);typedef uvm_resource #(T) rsrc_t;protected function new();endfunctionstatic function rsrc_t get_by_name(string scope, string name,bit rpterr=1);return rsrc_t::get_by_name(scope, name, rpterr);endfunctionstatic function void set(input string scope, input string name,T val, input uvm_object accessor = null);rsrc_t rsrc = new(name, scope);rsrc.write(val, accessor);rsrc.set();...    ...endfunction......
endclass

注:

  1. 这个uvm_resource_db类未实例化
  2. 它使用一组静态函数来操作资源和资源池。因此,必须使用范围解析操作符( ::)来调用它们。

        例如:uvm_resource_db #(整数)::设置(…);

     3. 如果+UVM_RESOURCE_DB_TRACE作为命令行参数提供,它会打印所有资源数据库的访问(写入和读取)。

1. uvm_resource_db methods

所有函数都是下表中提到的静态函数

2. uvm_resource_db example

在下面的示例中,control位存储在数据库中,作为在component_B中为my_component创建对象的启用条件(enable condition)。

名为“control”、类型为bit的新资源将从测试用例添加到资源池中。

uvm_resource_db #(bit)::set("*", "control", 1, this);//where,
//string scope = “*”;
//string name = “control”;
//T val = 1;
//uvm_object accessor =  this;//In component_B, 
if(!uvm_resource_db #(bit)::read_by_name(get_full_name(), "control", ctrl))`uvm_fatal(get_type_name(), "read_by_name failed for resource in this scope");

使用read_by_name静态函数检索资源,该函数在名称为“control”的数据库中查找。如果read_by_name在数据库中找不到“control”字符串名,将报告致命错误。尽管致命检查不是强制性的,但建议将其用于调试目的。一旦表中的查找成功,存储在资源数据库中的值就会在局部变量ctrl中更新。此控制位用于控制my_component对象的创建。

`include "uvm_macros.svh"
import uvm_pkg::*;class component_A #(parameter ID_WIDTH = 8) extends uvm_component;bit [ID_WIDTH-1:0] id;`uvm_component_param_utils(component_A #(ID_WIDTH))function new(string name = "component_A", uvm_component parent = null);super.new(name, parent);id = 1;endfunctionfunction display();`uvm_info(get_type_name(), $sformatf("inside component_A: id = %0d", id), UVM_LOW);endfunction
endclassclass mycomponent #(parameter ID_WIDTH = 8) extends uvm_component;bit [ID_WIDTH-1:0] id;`uvm_component_param_utils(mycomponent #(ID_WIDTH))function new(string name = "mycomponent", uvm_component parent = null);super.new(name, parent);id = 2;endfunctionfunction display();`uvm_info(get_type_name(), $sformatf("inside mycomponent: id = %0d", id), UVM_LOW);endfunction
endclassclass component_B #(int ID_WIDTH = 8) extends component_A #(ID_WIDTH);bit ctrl;bit [ID_WIDTH-1:0] id;mycomponent #(8) my_comp;`uvm_component_param_utils(component_B #(ID_WIDTH))function new(string name = "component_B", uvm_component parent = null);super.new(name, parent);id = 3;endfunctionfunction void build_phase(uvm_phase phase);super.build_phase(phase);if(!uvm_resource_db #(bit)::read_by_name(get_full_name(), "control", ctrl))`uvm_fatal(get_type_name(), "read_by_name failed for resource in this scope");if(ctrl)  my_comp = mycomponent #(8)::type_id::create("my_comp", this);endfunctionfunction display();`uvm_info(get_type_name(), $sformatf("inside component_B: id = %0d, ctrl = %0d", id, ctrl), UVM_LOW);if(ctrl) void'(my_comp.display());endfunction
endclassclass my_test extends uvm_test;bit control;`uvm_component_utils(my_test)component_A #(32) comp_A;component_B #(16) comp_B;function new(string name = "my_test", uvm_component parent = null);super.new(name, parent);endfunctionfunction void build_phase(uvm_phase phase);super.build_phase(phase);comp_A = component_A #(32)::type_id::create("comp_A", this);comp_B = component_B #(16)::type_id::create("comp_B", this);uvm_resource_db #(bit)::set("*", "control", 1, this);endfunctionfunction void end_of_elaboration_phase(uvm_phase phase);super.end_of_elaboration_phase(phase);uvm_top.print_topology();endfunctiontask run_phase(uvm_phase phase);super.run_phase(phase);void'(comp_A.display());void'(comp_B.display());endtask
endclassmodule tb_top;initial beginrun_test("my_test");end
endmodule

Output:

UVM_INFO /xcelium20.09/tools//methodology/UVM/CDNS-1.2/sv/src/base/uvm_root.svh(605) @ 0: reporter [UVMTOP] UVM testbench topology:
----------------------------------------
Name          Type           Size  Value
----------------------------------------
uvm_test_top  my_test        -     @1809comp_A      uvm_component  -     @1876comp_B      uvm_component  -     @1907my_comp   uvm_component  -     @1954
----------------------------------------UVM_INFO testbench.sv(14) @ 0: uvm_test_top.comp_A [uvm_component] inside component_A: id = 1
UVM_INFO testbench.sv(52) @ 0: uvm_test_top.comp_B [uvm_component] inside component_B: id = 3, ctrl = 1
UVM_INFO testbench.sv(28) @ 0: uvm_test_top.comp_B.my_comp [uvm_component] inside mycomponent: id = 2

http://www.yidumall.com/news/51277.html

相关文章:

  • 专门做h网页游戏的网站推推蛙seo顾问
  • 做网站深圳谷歌手机网页版入口
  • 东华网站开发杭州seo排名公司
  • 如何做网站打广告网拍外宣怎么推广
  • 网站做打火机如何怎么做一个自己的网站
  • 做网站的如何找业务朋友圈广告推广代理
  • 期货直播室网站建设全媒体运营师培训费用
  • php网站模板开源女排联赛最新排行榜
  • 长沙做网站备案企业微信营销系统
  • 淄博网站建设有实力百度搜索排名优化哪家好
  • 宝山网站建设服务企业查询网
  • 网站收录问题seo优化知识
  • 浙江建设信息网港西安seo阳建
  • 百度招聘 网站开发阿里巴巴官网首页
  • 郑州主动营销网站2023年9月疫情又开始了吗
  • 做微信公众号的网站有哪些内容广州最新消息
  • 罗湖网站建设价格网站建设介绍ppt
  • robots网站地图黄页引流推广网站入口
  • 做淘宝推广开网站合适柏乡seo快排优化
  • 企业展厅设计效果图seo教程seo教程
  • 做网站反链无锡百度正规公司
  • 网站独享ip哪有卖的成功营销案例100例
  • 找做外墙油漆网站百度竞价优缺点
  • 信阳做网站 汉狮网络信息流推广渠道有哪些
  • 中国文明网联盟网站建设最近一周热点新闻
  • 建筑材料市场信息价网百色seo快速排名
  • 自己做网站教学视频新闻发布会稿件
  • 合伙做网站怎么分配股权百度推广seo自学
  • 网站留言表格怎么做深圳品牌策划公司
  • 邯郸推广网站建设哪个好专业网站建设公司