uvm_root 是uvm的顶层实例扮演了一个top-level and phase controller 的作用,对于component来说。该类不需要用户实例化,他是一个自动实例化了的类,用户直接通过uvm_top调用。任何component,只要没有指定其parent,那么他将作为top的一个child。top管理所有component的phase;

1. The UVM automatically creates a single instance of uvm_root that users can access via the global (uvm_pkg-scope) variable, uvm_top.
2. uvm_top实例的关键作用:
     1. Implicit top-level(隐式的顶层)    The uvm_top serves as an implicit top-level component.  Any component whose parent is specified as NULL becomes a child of uvm_top.  Thus, all UVM components in simulation are descendants of uvm_top.所有组建的parent被指定为NULL的,就会成为uvm_top的child,uvm_top是uvm组建树的顶层。

    2. Phase control    uvm_top manages the phasing for all components.
    3. Search    Use uvm_top to search for components based on their hierarchical name.  See find and find_all.(使用uvm_top基于层次名搜索组件)
    4. Report configuration    Use uvm_top to globally configure report verbosity, log files, and actions.  For example, uvm_top.set_report_verbosity_level_hier(UVM_FULL) would set full verbosity for all components in simulation.
   5.  Global reporter    Because uvm_top is globally accessible (in uvm_pkg scope), UVM’s reporting mechanism is accessible from anywhere outside uvm_component, such as in modules and sequences.  See uvm_report_error, uvm_report_warning, and other global methods.

 1.属性
 
  uvm_component top_levels[$];//各个top注册在这 i.e test,It includes the uvm_test_top component that is created by run_test as well as any other top level components that have been instantiated anywhere in the hierarchy.
 
  bit  enable_print_topology = 0;//如果被设置,在end_of_elaboration phase结束的时候打印拓扑结构
 
  bit  finish_on_completion = 1;//If set, then run_test will call $finish after all phases are executed.
 
  time phase_timeout = `UVM_DEFAULT_TIMEOUT;
 
  static local uvm_root m_inst;
 
  bit m_phase_all_done;//所有阶段执行完毕

2. 主要的API方法:
      1. virtual task run_test (     string      test_name      =      ""     )://解析命令行的"+UVM_TESTNAME=",从工厂中取出uvm_test_top并构造一个实例,调用相应的实例。
          1. Phases all components through all registered phases
          2.  If the optional test_name argument is provided, or if a command-line plusarg, +UVM_TESTNAME=TEST_NAME, is found, then the specified component is created just prior to phasing.
     2. find/find_all:
          1. function void uvm_root::find_all(string comp_match, ref uvm_component comps[$],
                                 input uvm_component comp=null); //查找整个uvm_top,调用m_find_all_recurse实现
 
          2.function uvm_component uvm_root::find (string comp_match);//调用uvm_root::find_all实现
3. uvm_root私有函数:

      1. function uvm_root::new();//设置reporter, command_processor,调用report_header
             1. 调用super.new("__top__",null)将uvm_root设置成树的顶层
             2. 设置reporter,拿到command_processor,调用report_header
             3. 调用m_check_verbosity通过命令行获取并设置verbosity
      2. function uvm_root uvm_root::get();
          1. 构成uvm_root的单态类
          2. 调用了uvm_domain::get_common_domain();m_inst.m_domain = uvm_domain::get_uvm_domain()即生成了两个domain 一个common 一个uvm_domain
      3. task uvm_root::run_phase (uvm_phase phase);//该函数主要检查$time是否为0,如果不为0就报告错误,因为run必须从0时刻开始
      4. function void uvm_root::m_do_dump_args();//如果命令行有+UVM_DUMP_CMDLINE_ARGS,就把命令行的所有参数输出
      5. function void uvm_root::build_phase(uvm_phase phase);//调用一些内建函数完成对uvm仿真环境的配置: 
          super.build_phase(phase); 
            m_set_cl_msg_args(); 
            m_do_verbosity_settings();//解析命令行输入+uvm_set_verbosity=,主要进行一些语法检查,如果发现问题就报错,并不对设置做处理
            m_do_timeout_settings();//解析命令行的"+UVM_TIMEOUT=",并把该设置应用于uvm_top
            m_do_factory_settings();//解析命令行的+(UVM_SET_INST_OVERRIDE|uvm_set_inst_override)=,调用m_process_inst_override或者调用m_process_type_override
            m_do_config_settings();从命令行中获取+(UVM_SET_CONFIG_INT|uvm_set_config_int)=设置,并解析该设置,最后调用m_process_config记录这些设置到resource数据库里边
            m_do_max_quit_settings();+UVM_MAX_QUIT_COUNT=解析命令行的这个选项,并把该选项的设置设置入全局的report_server
            m_do_dump_args();    //如果命令行有+UVM_DUMP_CMDLINE_ARGS,就把命令行的所有参数输出


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

  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基础之---Command-line Processor

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

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

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

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

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

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

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

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

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

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

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

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

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

随机推荐

  1. 分块试水--CODEVS4927 线段树练习5

    模板 #include<stdio.h> #include<algorithm> #include<string.h> #include<stdlib.h&g ...

  2. tyvj2059 元芳看电影

    描述 神探狄仁杰电影版首映这天,狄仁杰.李元芳和狄如燕去看电影.由于人实在是太多了,入场的队伍变得十分不整齐,一个人的前面可能会出现并排的好多人.“元芳,这队伍你怎么看?”“大人,卑职看不出这队伍是怎 ...

  3. 51 nod 1079 中国剩余定理

    1079 中国剩余定理 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题  收藏  关注 一个正整数K,给出K Mod 一些质数的结果,求符合条件的最小的K.例如,K % ...

  4. javaScript 超时与间歇掉用

    <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...

  5. iOS中xib与storyboard原理,与Android界面布局的异同

    用文本标记语言来进行布局,用的最多的应该是HTML语言.HTML能够理解为有一组特殊标记的XML语言. 一.iOS中xib与storyboard显示原理 在iOS中基本的布置界面的方式有3种:代码.x ...

  6. Android实现一个自己定义相机的界面

    我们先实现拍照button的圆形效果哈.Android开发中,当然能够找美工人员设计图片,然后直接拿进来.只是我们能够自己写代码实现这个效果哈.最经常使用的的是用layout-list实现图片的叠加, ...

  7. 使用Code First建模自引用关系笔记 asp.net core上使用redis探索(1) asp.net mvc控制器激活全分析 语言入门必学的基础知识你还记得么? 反射

    使用Code First建模自引用关系笔记   原文链接 一.Has方法: A.HasRequired(a => a.B); HasOptional:前者包含后者一个实例或者为null HasR ...

  8. linux (debian) 配置静态ip

    在局域网内使用动态ip分配,机器动态的获取 ip地址.可是我使用ssh登录的时候.总是断线. 后来发现,原来机器总是在两个ip地址192.168.2.203 和192.168.2.228之间切换.用s ...

  9. js阻碍DOM加载

    今天用谷歌做了个小测试 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...

  10. [开发工具]_[Sublime Text 2]_[配置C++编译执行环境]

    场景: 1. g++的版本号更新比較快,能够使用最新的C++11特性, 这里sublime text 2是我的轻量级C++开发工具(仅仅有这个),能够使用st2这样的工具来验证一些语法新特性, 也能够 ...