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

最新文章

  1. office project 激活
  2. PHP实现队列及队列原理
  3. 四、优化及调试--网站优化--Yahoo军规下
  4. 图结构练习——最小生成树(kruskal算法(克鲁斯卡尔))
  5. Pinyin 输入法安装 opensuse 13 gnome
  6. iPhone/iOS图片相关(读取、保存、绘制、其它相关)
  7. Interview----用最快的方法计算 Fibonacci 数
  8. 网件无线网卡在windows 2012支持问题
  9. [原创]安卓使用Termux做渗透测试(演示sqlmap安装,并附上一个神器)
  10. FFMPEG视音频解码【一】
  11. Selenium Web 自动化 - 项目持续集成(进阶)
  12. flask开发过程中的常见问题
  13. 前端笔记之CSS(下)浮动&amp;BFC&amp;定位&amp;Hack
  14. java复制文件夹中的所有文件和文件夹到另一个文件夹中
  15. jdbi
  16. 记一次python爬虫实战,豆瓣电影Top250爬虫
  17. 【POJ】1935 Journey(树形dp)
  18. .Net Core IFormFile 始终为空的问题
  19. QSettings 使用实例 当需要在程序关闭时保存”状态“信息
  20. [python]常用的几个包

热门文章

  1. JavaScript-Tool-导向:wizard-un
  2. bzoj4892
  3. seafile文档
  4. 标准C++中的string
  5. ORBslam总结
  6. Identity Server 4 原理和实战(完结)_单点登录实例(添加Flask客户端,Express.js的API)
  7. HTML中&amp;nbsp;&amp;emsp等空格的区别
  8. string.Format 处理 double 的问题
  9. 新手安装 hadoop、hive和hbase 笔记
  10. 理解:return、break、continue区别