uvm_globals.svh 存放全局的变量和方法。当UVM平台启动时,便在uvm_globals查找相应的方法,uvm_globals 的方法实现也比较简单,就是调用uvm_root对应的方法。其简略源代码如下:

// Title: Globals

//------------------------------------------------------------------------------
//
// Group: Simulation Control
//
//------------------------------------------------------------------------------ // Task: run_test
//
// Convenience function for uvm_top.run_test(). See <uvm_root> for more
// information. task run_test (string test_name="");
uvm_root top;
uvm_coreservice_t cs;
cs = uvm_coreservice_t::get();
top = cs.get_root();
top.run_test(test_name);
endtask `ifndef UVM_NO_DEPRECATED
// Variable- uvm_test_done - DEPRECATED
//
// An instance of the <uvm_test_done_objection> class, this object is
// used by components to coordinate when to end the currently running
// task-based phase. When all participating components have dropped their
// raised objections, an implicit call to <global_stop_request> is issued
// to end the run phase (or any other task-based phase). const uvm_test_done_objection uvm_test_done = uvm_test_done_objection::get(); // Method- global_stop_request - DEPRECATED
//
// Convenience function for uvm_test_done.stop_request(). See
// <uvm_test_done_objection::stop_request> for more information. function void global_stop_request();
uvm_test_done_objection tdo;
tdo = uvm_test_done_objection::get();
tdo.stop_request();
endfunction // Method- set_global_timeout - DEPRECATED
//
// Convenience function for uvm_top.set_timeout(). See
// <uvm_root::set_timeout> for more information. The overridable bit
// controls whether subsequent settings will be honored. function void set_global_timeout(time timeout, bit overridable = );
uvm_root top;
uvm_coreservice_t cs;
cs = uvm_coreservice_t::get();
top = cs.get_root();
top.set_timeout(timeout,overridable);
endfunction // Function- set_global_stop_timeout - DEPRECATED
//
// Convenience function for uvm_test_done.stop_timeout = timeout.
// See <uvm_uvm_test_done::stop_timeout> for more information. function void set_global_stop_timeout(time timeout);
uvm_test_done_objection tdo;
tdo = uvm_test_done_objection::get();
tdo.stop_timeout = timeout;
endfunction
`endif //----------------------------------------------------------------------------
//
// Group: Reporting
//
//---------------------------------------------------------------------------- // Function: uvm_get_report_object
//
// Returns the nearest uvm_report_object when called.
// For the global version, it returns uvm_root.
//
function uvm_report_object uvm_get_report_object();
uvm_root top;
uvm_coreservice_t cs;
cs = uvm_coreservice_t::get();
top = cs.get_root();
return top;
endfunction // Function: uvm_report_enabled
//
// Returns 1 if the configured verbosity in ~uvm_top~ for this
// severity/id is greater than or equal to ~verbosity~ else returns 0.
//
// See also <uvm_report_object::uvm_report_enabled>.
//
// Static methods of an extension of uvm_report_object, e.g. uvm_component-based
// objects, cannot call ~uvm_report_enabled~ because the call will resolve to
// the <uvm_report_object::uvm_report_enabled>, which is non-static.
// Static methods cannot call non-static methods of the same class. function int uvm_report_enabled (int verbosity,
uvm_severity severity=UVM_INFO, string id="");
uvm_root top;
uvm_coreservice_t cs;
cs = uvm_coreservice_t::get();
top = cs.get_root();
return top.uvm_report_enabled(verbosity,severity,id);
endfunction // Function: uvm_report function void uvm_report( uvm_severity severity,
string id,
string message,
int verbosity = (severity == uvm_severity'(UVM_ERROR)) ? UVM_LOW :
(severity == uvm_severity'(UVM_FATAL)) ? UVM_NONE : UVM_MEDIUM,
string filename = "",
int line = ,
string context_name = "",
bit report_enabled_checked = );
uvm_root top;
uvm_coreservice_t cs;
cs = uvm_coreservice_t::get();
top = cs.get_root();
top.uvm_report(severity, id, message, verbosity, filename, line, context_name, report_enabled_checked);
endfunction // Undocumented DPI available version of uvm_report
export "DPI-C" function m__uvm_report_dpi;
function void m__uvm_report_dpi(int severity,
string id,
string message,
int verbosity,
string filename,
int line);
uvm_report(uvm_severity'(severity), id, message, verbosity, filename, line);
endfunction : m__uvm_report_dpi // Function: uvm_report_info function void uvm_report_info() ;
endfunction // Function: uvm_report_warning function void uvm_report_warning();
endfunction // Function: uvm_report_error function void uvm_report_error();
endfunction // Function: uvm_report_fatal
//
// These methods, defined in package scope, are convenience functions that
// delegate to the corresponding component methods in ~uvm_top~. They can be
// used in module-based code to use the same reporting mechanism as class-based
// components. See <uvm_report_object> for details on the reporting mechanism.
//
// *Note:* Verbosity is ignored for warnings, errors, and fatals to ensure users
// do not inadvertently filter them out. It remains in the methods for backward
// compatibility. function void uvm_report_fatal();
endfunction // Function: uvm_process_report_message
//
// This method, defined in package scope, is a convenience function that
// delegate to the corresponding component method in ~uvm_top~. It can be
// used in module-based code to use the same reporting mechanism as class-based
// components. See <uvm_report_object> for details on the reporting mechanism. function void uvm_process_report_message(uvm_report_message report_message);
endfunction // TODO merge with uvm_enum_wrapper#(uvm_severity)
function bit uvm_string_to_severity (string sev_str, output uvm_severity sev);
endfunction //----------------------------------------------------------------------------
//
// Group: Miscellaneous
//
//---------------------------------------------------------------------------- // Function: uvm_is_match
//
// Returns 1 if the two strings match, 0 otherwise.
//
// The first string, ~expr~, is a string that may contain '*' and '?'
// characters. A * matches zero or more characters, and ? matches any single
// character. The 2nd argument, ~str~, is the string begin matched against.
// It must not contain any wildcards.
//
//---------------------------------------------------------------------------- function bit uvm_is_match (string expr, string str);
string s;
s = uvm_glob_to_re(expr);
return (uvm_re_match(s, str) == );
endfunction //----------------------------------------------------------------------------
//
// Task: uvm_wait_for_nba_region
//
// Callers of this task will not return until the NBA region, thus allowing
// other processes any number of delta cycles (#0) to settle out before
// continuing. See <uvm_sequencer_base::wait_for_sequences> for example usage.
//
//---------------------------------------------------------------------------- task uvm_wait_for_nba_region; string s; int nba;
int next_nba; //If `included directly in a program block, can't use a non-blocking assign,
//but it isn't needed since program blocks are in a separate region.
`ifndef UVM_NO_WAIT_FOR_NBA
next_nba++;
nba <= next_nba;
@(nba);
`else
repeat(`UVM_POUND_ZERO_COUNT) #;
`endif endtask

参考文献:

1 uvm_globals. http://blog.sina.com.cn/s/blog_466496f30100yan3.html

uvm_globals——告诉这个世界我爱你的更多相关文章

  1. 张艾迪(创始人):发明Global.World.224C的天才

    Eidyzhang: Genius.Founder.CEO.23 I 世界级最高级创始人.世界最高级FounderCEO 出生在亚洲中国.Eidyzhang 拥有黑色头发白色皮肤(20岁)大学辍学生. ...

  2. [置顶] 请听一个故事------>你真的认为iPhone只是一部手机?苹果惊天秘密!!

    在网上看到的一篇小说,感觉有点意思,转载过来大家一起围观下,作者很幽默很风趣. 导读:iPhone的隐藏功能!Jobs的军方身份!图灵服毒自杀的传奇故事!中兴华为的神秘背景! 你真的认为iPhone只 ...

  3. JavaScript 函数(方法)的封装技巧要领及其重要性

    作为一枚程序猿,想必没有人不知道函数封装吧.在一个完整的项目开发中,我们会在JS代码中对一些常用(多个地方调用)的操作进行一个函数的封装,这样便于我们调试和重复调用,以致于能够在一定程度上减少代码的冗 ...

  4. Angular组件——父子组件通讯

    Angular组件间通讯 组件树,1号是根组件AppComponent. 组件之间松耦合,组件之间知道的越少越好. 组件4里面点击按钮,触发组件5的初始化逻辑. 传统做法:在按钮4的点击事件里调用组件 ...

  5. Java之NIO,BIO,AIO

    Hollis知识星球的一些学习笔记,有兴趣的朋友可以微信搜一下 什么是NIO 什么是IO? 它是指计算机与外部世界或者一个程序与计算机的其余部分的之间的接口.它对于任何计算机系统都非常关键,因而所有 ...

  6. AI 的下一个重大挑战:理解语言的细微差别

    简评:人类语言非常博大精妙,同一句话在不同的语境下,就有不同的含义.连人类有时候都不能辨别其中细微的差别,机器能吗?这就是人工智能的下一个巨大挑战:理解语言的细微差别.本文原作者是 Salesforc ...

  7. 你真的认为iphone只是一部手机么

    闲言不表,直奔主题.我是一个程序员,上周参加了一个开源软件交流大会,其实会上并没有听到什么新鲜的东西.但是在会中,偶然间听到了一个关于iphone的秘密,却着实令我震惊了,事情具体是这样的,听我慢慢道 ...

  8. 请听一个故事------>你真的认为iPhone只是一部手机?苹果惊天秘密!!

    在网上看到的一篇小说,感觉有点意思,转载过来大家一起围观下,作者很幽默很风趣. 导读:iPhone的隐藏功能!Jobs的军方身份!图灵服毒自杀的传奇故事!中兴华为的神秘背景! 你真的认为iPhone只 ...

  9. 在西雅图华盛顿大学 (University of Washington) 就读是怎样一番体验?

    http://www.zhihu.com/question/20811431   先说学校.优点: 如果你是个文青/装逼犯,你来对地方了.连绵不断的雨水会一下子让写诗的感觉将你充满. 美丽的校园.尤其 ...

随机推荐

  1. final/finalize/finally的区别

    一.性质不同 (1)final为关键字: (2)finalize()为方法:---垃圾回收机制中的方法(GC) (3)finally为为区块标志,用于try语句中: 二.作用 (1)final为用于标 ...

  2. 用于生成交易统计时间戳(常配合echarts走势图使用)

    <?php //获取交易统计时间戳 时间段内每小时 public function getPayCountTimeHours($start_date,$end_date){ $data = ar ...

  3. How Many Boyfriends

    知乎上看到一个问题,如果一个女人说自己集齐了12个星座的男朋友,那么她已经搞过多少男人了. 先考虑这个问题的最简单版本,如果说该女人每一次和12个星座的男人交往的概率相同. 考虑$dp$ 注意到这个问 ...

  4. Can you answer these queries II

    题意: 给一长度为n的序列,有m组询问,每一组询问给出[l,r]询问区间内的最大去重连续子段和. 解法: 考虑一下简化后的问题:如果题目要求询问查询以$r$为右端点且$l$大于等于给定值的去重连续子段 ...

  5. JS正则表达式(一)

    正则表达常用符号 /..../  开始结束 ^ 开始 $ 结束 /s 任何非空字符  /S 非空 /d  匹配一个数字=[0-9] /D  匹配一个非数字=[^0-9] /w   匹配一个数字,下划线 ...

  6. monkey基本命令及脚本编写

    Monkey 是Android自带的黑盒测试工具,一般通过随机触发界面事件,来确定应用是否会发生异常,多用于android应用的稳定性.压力测试  基本命令: adb shell monkey [op ...

  7. java集合框架之HashSet

    参考http://how2j.cn/k/collection/collection-hashset/364.html#nowhere 元素不能重复 Set中的元素,不能重复重复判断标准是: 首先看ha ...

  8. eclipse + tomcat 开发环境配置

    一. 下载tomcat和Eclipse 下载tomcat 下载地址:http://tomcat.apache.org/download-70.cgi 下载后解压如下图 下载eclipse 下载地址:h ...

  9. 洛谷 - P1582 - 倒水 - 位运算

    https://www.luogu.org/problemnew/show/P1582 要求用最少的瓶子,那肯定不能有两个一样的瓶子,否则合并更优. 枚举其二进制位,每次加上lowbit,将最后一个1 ...

  10. Lightoj1081【500棵线段树维护】

    #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=5e2+10; const ...