uvm_void
The uvm_void class is the base class for all UVM classes.
uvm_object:
The uvm_object class is the base class for all UVM data and hierarchical classes.
uvm_object是一个uvm中data和component共同的基类,里边集成了很多东西如recorder,reporter等,还定义了许多公用的接口。该类继承自uvm_void

 1. 该类的属性:
      static bit use_uvm_seeding = 1;//使能调用uvm的种子机制:
    当使能的时候,UVM-based 对象使用它们的type和full hierarchical 名字进行seeded,提高对象的随机稳定性因为他们的名字是固定的
  The <uvm_component> class is an example of a type that has a unique instance name.
     local string m_leaf_name;//本object的名字 
     local int m_inst_id;//本inst_id 
     static protected int m_inst_count = 0;//总共的object数 
     static uvm_status_container __m_uvm_status_container = new;//一个所有object共享的状态容器
2. 种子机制:
    function void uvm_object::reseed
();//use_uvm_seeding使能情况下根据类型和层次化名字生成一个随机的种子,即使用uvm的种子机制

3. 对象身份方法:
     1.  function void uvm_object::set_name (string name); //设置leaf_name
     2.  function string uvm_object::get_name ();//返回leaf_name(由new设置或者通过set_name更改)
     3.  function string uvm_object::get_full_name ();//调用2
          1. 返回对象的全部层次名,The default implementation is the same as get_name, as uvm_objects do not inherently possess hierarchy.
          2. 如果对象具有层次,比如uvm_components,将会重载默认的那个实现
          3. Other objects might be associated with component hierarchy but are not themselves components.  For example, uvm_sequence #(REQ,RSP) classes are typically associated with a uvm_sequencer #(REQ,RSP).  In this case, it is useful to override get_full_name to return the sequencer’s full name concatenated with the sequence’s name.  This provides the sequence a full context, which is useful when debugging.

     4.  function int uvm_object::get_inst_id();//返回inst_id
     5. function int uvm_object::get_inst_count(); //返回inst_count
     6. function uvm_object_wrapper uvm_object::get_object_type();//在factory中查找type_name并返回对应的实例
        1. get_object_type同get_type是相同的
     7. function uvm_object_wrapper uvm_object::get_type();//返回本类型所对应的uvm_object_wrapper
        1. 某些object派生的对象都对应一个wrapper来实现对某个对象的create,register到工厂等操作,本函数就是要返回对应的wrapper
        2. 返回对象的type-proxy(类型-代理wrapper). uvm_factory's的type-based 覆盖和创建方法
        3. The default implementation of this method produces an error and returns null.  To enable use of this method, a user’s subtype must implement a version that returns the subtype’s wrapper.
        4. This function is implemented by the `uvm_*_utils macros, if employed.(下面例子中的标红部分由uvm_*utils实现) 
       举个例子:
         class cmd extends uvm_object;

           typedef uvm_object_registry #(cmd) type_id;
           static function type_id get_type();
           return type_id::get();
           endfunction
         endclass

     8. virtual function string get_type_name (); //这个函数返回对象的类型名称,这是通常的类型标识符
         1. It is used for various debugging functions in the library, and it is used by the factory for creating objects.
         2. This function must be defined in every derived class.
4.创建机制:
        1. virtual function uvm_object create ( string name ="" )
             1. Every class deriving from uvm_object, directly or indirectly, must implement the create method.
        2. virtual function uvm_object clone ();//克隆方法创建并返回这个对象的精确复制。
5. print方法:
  1 .function void uvm_object::print(uvm_printer printer=null);//调用sprint打印本object 
      1. 如果printer没有提供将会使用uvm_default_printer。
      2. See also uvm_line_printer, uvm_tree_printer, and uvm_table_printer for details on the pre-defined printer “policies,” or formatters, provided by the UVM.
      3. 自定义打印和sprint 操作,派生类必须覆盖do_print方法和使用提供的打印机政策类格式输出。
      4. $fwrite(printer.knobs.mcd,sprint(printer));//主要是调用fwrite函数,打印sprint返回的string
  2. function string uvm_object::sprint(uvm_printer printer=null); //调用do_print(printer)打印(主要目的是返回一个string,而不是为了打印)
      1. The printer policy will manage all string concatenations and provide the string to sprint to return to the caller.
      2. 注意在printer.istop,not at top-level, must be recursing into sub-object调用do_print方法
   3.调用printer.emit()实现格式化
 3. virtual function void do_print (     uvm_printer      printer     )
   1. The do_print method is the user-definable hook called by print and sprint that allows users to customize what gets printed or sprinted beyond the field information provided by the `uvm_field_* macros, Utility and Field Macros for Components and Objects.
      2. printer是policy对象,控制输出的格式和内容
      3.  To ensure correct print and sprint operation, and to ensure a consistent output format, the printer must be used by all do_print implementations.  That is, instead of using $display or string concatenations directly, a do_print implementation must call through the printer’s API to add information to be printed or sprinted.
      3. 使用printer提供的api打印
     class mytype extends uvm_object;

  data_obj data;
  int f1;
  virtual function void do_print (uvm_printer printer);
    super.do_print(printer);
    printer.print_int("f1", f1, $bits(f1), DEC);
    printer.print_object("data", data);
  endfunction
   4. convert2string()//This virtual function is a user-definable hook, called directly by the user, that allows users to provide object information in the form of a string.
       
6. Recording方法:
   1.function void uvm_object::record (uvm_recorder recorder=null);//调用do_record做记录
      1. A simulator’s recording mechanism is vendor-specific.  By providing access via a common interface, the uvm_recorder policy provides vendor-independent access to a simulator’s recording capabilities.
   2.function void uvm_object::do_record (uvm_recorder recorder);//null      

7. Copy方法:
    1.function void uvm_object::copy (uvm_object rhs); 
    2 .function void uvm_object::do_copy (uvm_object rhs); //null
8. Compare方法:
  1. function bit  uvm_object::compare (uvm_object rhs,            
                                   uvm_comparer comparer=null); //调用比较策略器进行比较
        1. The optional comparer argument specifies the comparison policy.  It allows you to control some aspects of the comparison operation.  It also stores the results of the comparison, such as field-by-field miscompare information and the total number of miscompares.  If a compare policy is not provided, then the global uvm_default_comparer policy is used.  See uvm_comparer for more information.
  2. function bit  uvm_object::do_compare (uvm_object rhs,      
                                      uvm_comparer comparer);//被1调用
         class mytype extends uvm_object;
      ...
      int f1;
      virtual function bit do_compare (uvm_object rhs,uvm_comparer comparer);
        mytype rhs_;
        do_compare = super.do_compare(rhs,comparer);
        $cast(rhs_,rhs);
        do_compare &= comparer.compare_field_int("f1", f1, rhs_.f1);
      endfunction
 
A derived class implementation must call super.do_compare() to ensure its base class’ properties, if any, are included in the comparison.  Also, the rhs argument is provided as a generic uvm_object.  Thus, you must $cast it to the type of this object before comparing.
 
The actual comparison should be implemented using the uvm_comparer object rather than direct field-by-field comparison.  This enables users of your class to customize how comparisons are performed and how much miscompare information is collected.  See uvm_comparer for more details.

9.Pack方法:
10. Unpack方法:

11.configuration方法:
  1.function void  uvm_object::set_int_local (string      field_name,
                                          uvm_bitstream_t value, 
                                          bit         recurse=1); //保存一个整数
 
  2.function void  uvm_object::set_object_local (string     field_name,
                                             uvm_object value,    
                                             bit        clone=1,  
                                             bit        recurse=1); //保存一个object
 
   3.function void  uvm_object::set_string_local (string field_name,
                                             string value,   
                                             bit    recurse=1);//保存string

1. These methods provide write access to integral, string, and uvm_object-based properties indexed by a field_name string.
2. Although the object designer implements these methods to provide outside access to one or more properties, they are intended for internal use (e.g., for command-line debugging and auto-configuration) and should not be called directly by the user.



UVM基础之----uvm_object的更多相关文章

  1. UVM基础总结——基于《UVM实战》示例

    一.前言 工作一直在做SoC验证,更关注模块间的连接性和匹配性,所以相比于擅长随机约束激励的UVM来说,定向测试的概念更容易debug.当然前提是IP已经被充分验证.因此觉得接触UVM的机会较少.到现 ...

  2. UVM基础之------uvm_transaction

    uvm_transaction继承自uvm_object,添加了timing和recording接口,该类是uvm_sequence_item的基类.下边将做剖析 1. 这个类提供了时间戳属性(tim ...

  3. UVM基础之------uvm phases机制

    代码的书写顺序会影响代码的实现,在不同的时间做不同的事情,这是UVM phase的设计哲学,UVM phase提供了一个通用的TB phase 解决方案.支持显示的隐式的同步方案,运行时刻的线程控制和 ...

  4. UVM基础之-------uvm factory机制override<博>

    override功能是UVM中一个比较重要的功能,这个功能也是在factory里面实现的,我们会在env或者具体的case中使用override功能. class case_x extends bas ...

  5. UVM基础之---------uvm factory机制register

    factory机制的一大特点就是根据类的名字来创建类的实例. factory 机制中根据类名来创建类的实例所用到的技术:一是参数化的类,二是静态变量和静态函数.这两者是factory机制实现的根本所在 ...

  6. UVM基础之---------uvm report 机制分析

    uvm 中的信息报告机制相对来说比较简单,功能上来说主要分为两部分: 第一通过ID对component的信息报告冗余级别进行控制,针对每个冗余级别进行不同的行为控制.这部分工作主要由uvm_repor ...

  7. Cadence UVM基础视频介绍(UVM SV Basics)

    Cadence关于UVM的简单介绍,包括UVM的各个方面.有中文和英文两种版本. UVM SV Basics 1 – Introduction UVM SV Basics 2 – DUT Exampl ...

  8. UVM基础之---Command-line Processor

    提供一个厂商独立的通用接口命令行参数,支持分类:   1. 基本参数和值:get_args,get_args_matches   2. 工具信息:get_tool_name(),get_tool_ve ...

  9. UVM基础之---------uvm factory机制base

    从名字上面就知道,uvm_factory用来制造uvm_objects和component.在一个仿真过程中,只有一个factory的例化存在. 用户定义的object和component types ...

随机推荐

  1. hdu 1874 dijkstra 队列实现 比数组高效特别在稀疏图

    参考  http://blog.csdn.net/zhuyingqingfen/article/details/6370561 刘汝佳白皮书 #include<stdio.h> #incl ...

  2. jQuery WeUI 组件下拉刷新和滚动加载的实现

    最近在做手机版使用到了下拉刷新和滚动加载,记录一下实现过程: 一.引入文件 ? 1 2 3 4 <link rel="stylesheet" href="Conte ...

  3. A multiprocessing system including an apparatus for optimizing spin-lock operations

    A multiprocessing system having a plurality of processing nodes interconnected by an interconnect ne ...

  4. rpm 命令的使用

    rpm -ivh    xv-3.10a-13.i386.rpm 在Terminal中,基本的安装指令如下: rpm -i    xv-3.10a-13.i386.rpm 如果你的连网速度足够快,也可 ...

  5. PHP array_pad()

    定义和用法 array_pad() 函数向一个数组插入带有指定值的指定数量的元素. 语法 array_pad(array,size,value) 参数 描述 array 必需.规定数组. size 必 ...

  6. 使用jconsole监控远程JVM

    使用jconsole监控远程JVM 学习了:https://www.linuxidc.com/Linux/2015-02/113420.htm https://www.cnblogs.com/thin ...

  7. 基于FPGA的简易数字时钟

    基于FPGA的可显示数字时钟,设计思路为自底向上,包含三个子模块:时钟模块,进制转换模块.led显示模块.所用到的FPGA晶振频率为50Mhz,首先利用它得到1hz的时钟然后然后得到时钟模块.把时钟模 ...

  8. HDOJ 5383 Yu-Gi-Oh! 最大费用最大流

    网络流裸题: 分两部分建图,求不要求满流的最大费用最大流..... Yu-Gi-Oh! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: ...

  9. datatables接口

    /*资源表格接口*/ var dataTableHeader=function(elem,unSorts,defaultSort,screens,status,toggleVis,ipAddress, ...

  10. WinMain和MFC的差别

    API(Application Programming Interface):开放给应用程序调用的系统功能. 一个Windows Application(SDK): WinMain ReristerC ...