加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

uvm_resource_db

(2011-10-17 11:27:04)
标签:

uvm

base

resource_db

it

分类: uvm

preface

  uvm_resource_db提供了一个访问resource_pool的方便的接口,使得许多使用resource_base需要多行代码完成的访问操作,现在只需要简短的一行代码。uvm_resource_db#(T)是一个独立的类,里边调用了resource_pool,根据不同的资源类型有不同的uvm_resource_db#(T),所以在资源池中可以根据类型把他们区分开来。相当于把uvm_resource #(T)通过uvm_resource_db#(T)这个独立的类型进行封装一次,然后注册到pool中

  1.typedef uvm_resource #(T) rsrc_t;定义了t型资源,本资源是一个resource_base type

  2.static function rsrc_t get_by_type(string scope);调用resource_base的rsrc_t::get_by_type(scope, rsrc_t::get_type());函数实现从resource_pool中取出scope, uvm_resource #(T)type的资源

  3.  static function rsrc_t get_by_name(string scope,
                                     string name,
                                     bit rpterr=1);//根据名字,scope取出资源

  4.static function rsrc_t set_default(string scope, string name);//生成一个uvm_resource #(T) r = new(name, scope)然后调用set注册进pool

  5.   static function void set(input string scope, input string name,
                           T val, input uvm_object accessor = null);//创建一个资源,然后把val写入,然后注册进pool,用scope和name来做为查找的参数,用accessor来做一个监听

  6.   static function void set_anonymous(input string scope,
                                     T val, input uvm_object accessor = null);//和5一样,只是名字是空的

  7.  function void set_override(input string scope, input string name,
                             T val, uvm_object accessor = null);//创建一个资源,把val计入其中,将该资源注册进pool,并用name和scope来检索该资源,用accessor来监听该资源,同时该资源在pool的两个散列中都是位于队列的开始处。

  8.  function void set_override_type(input string scope, input string name,
                                  T val, uvm_object accessor = null);//和7类似只在type散列中位于队列头

  9.  function void set_override_name(input string scope, input string name,
                                  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_type(input string scope,
                                   ref T val,
                                   input uvm_object accessor = null);//和10类似

  12.  static function bit write_by_name(input string scope, input string name,
                                     T val, input uvm_object accessor = null);//和10类似

  13.   static function bit write_by_type(input string scope,
                                    input T val, input uvm_object accessor = null);和10类似

  14. static function void dump();//对resource_pool中的所有资源进行打印显示

location:

 F:\zhenyu_liu\my_work\matierals\systemverilog\uvm-1.0p1\uvm-1.0p1\src\base\uvm_resource_db.svh

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有