uvm_globals——告诉这个世界我爱你
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——告诉这个世界我爱你的更多相关文章
- 张艾迪(创始人):发明Global.World.224C的天才
Eidyzhang: Genius.Founder.CEO.23 I 世界级最高级创始人.世界最高级FounderCEO 出生在亚洲中国.Eidyzhang 拥有黑色头发白色皮肤(20岁)大学辍学生. ...
- [置顶] 请听一个故事------>你真的认为iPhone只是一部手机?苹果惊天秘密!!
在网上看到的一篇小说,感觉有点意思,转载过来大家一起围观下,作者很幽默很风趣. 导读:iPhone的隐藏功能!Jobs的军方身份!图灵服毒自杀的传奇故事!中兴华为的神秘背景! 你真的认为iPhone只 ...
- JavaScript 函数(方法)的封装技巧要领及其重要性
作为一枚程序猿,想必没有人不知道函数封装吧.在一个完整的项目开发中,我们会在JS代码中对一些常用(多个地方调用)的操作进行一个函数的封装,这样便于我们调试和重复调用,以致于能够在一定程度上减少代码的冗 ...
- Angular组件——父子组件通讯
Angular组件间通讯 组件树,1号是根组件AppComponent. 组件之间松耦合,组件之间知道的越少越好. 组件4里面点击按钮,触发组件5的初始化逻辑. 传统做法:在按钮4的点击事件里调用组件 ...
- Java之NIO,BIO,AIO
Hollis知识星球的一些学习笔记,有兴趣的朋友可以微信搜一下 什么是NIO 什么是IO? 它是指计算机与外部世界或者一个程序与计算机的其余部分的之间的接口.它对于任何计算机系统都非常关键,因而所有 ...
- AI 的下一个重大挑战:理解语言的细微差别
简评:人类语言非常博大精妙,同一句话在不同的语境下,就有不同的含义.连人类有时候都不能辨别其中细微的差别,机器能吗?这就是人工智能的下一个巨大挑战:理解语言的细微差别.本文原作者是 Salesforc ...
- 你真的认为iphone只是一部手机么
闲言不表,直奔主题.我是一个程序员,上周参加了一个开源软件交流大会,其实会上并没有听到什么新鲜的东西.但是在会中,偶然间听到了一个关于iphone的秘密,却着实令我震惊了,事情具体是这样的,听我慢慢道 ...
- 请听一个故事------>你真的认为iPhone只是一部手机?苹果惊天秘密!!
在网上看到的一篇小说,感觉有点意思,转载过来大家一起围观下,作者很幽默很风趣. 导读:iPhone的隐藏功能!Jobs的军方身份!图灵服毒自杀的传奇故事!中兴华为的神秘背景! 你真的认为iPhone只 ...
- 在西雅图华盛顿大学 (University of Washington) 就读是怎样一番体验?
http://www.zhihu.com/question/20811431 先说学校.优点: 如果你是个文青/装逼犯,你来对地方了.连绵不断的雨水会一下子让写诗的感觉将你充满. 美丽的校园.尤其 ...
随机推荐
- ASoC框架
ASoC框架分为3部分: 1. platform(用来描述芯片的DAI接口,负责数据传输): DAI:snd_soc_dai_driver, 用来表示支持哪些格式数据, 提供设置格式的函数, 启动数据 ...
- php获取YouTube视频信息的方法
YouTube的视频地址格式https://www.youtube.com/watch?v=[VIDEO_ID]例子:https://www.youtube.com/watch?v=psvkyf3Pz ...
- POJ3624(01背包:滚动 实现)
Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 30417 Accepted: 13576 ...
- 错误 128 无法将类型“string”隐式转换为“System.Windows.Forms.DataGridViewTextBoxColumn”
原因是DataGridView中列的Name属性值和DataPropertyName属性值一样,比如Name="CardID",DataPropertyName="Car ...
- Nwjs简单配置
1.创建一个工程,配置一个 package.json 文件 { "name": "application-name", "version" ...
- AngularJS系统学习之$watch(监控)
在scope的内置的所有函数中,用的最多的可能就是$watch函数了, 当你的数据模型中某一部分发生变化时,$watch函数可以向你发出通知. 你可以监控单个对象的属性,亦可以监控需要经过计算的结果( ...
- NHibernate从入门到精通系列——NHibernate环境与结构体系
内容摘要 NHibernate的开发环境 NHibernate的结构体系 NHibernate的配置 一.NHibernate的开发环境 NHibernate的英文官方网站为:http://nhfor ...
- dubbo框架介绍
1.背景 (#) 随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进. 单一应用架构 当网站流量很小 ...
- AJAX提交到Handler.ashx一般处理程序返回json数据-转
直接贴代码!我也测试通过! 一切看注释! 谢谢! <%@ WebHandler Language="C#" class="Handler" %> u ...
- HDU - 1099 - Lottery - 概率dp
http://acm.hdu.edu.cn/showproblem.php?pid=1099 最最简单的概率dp,完全是等概率转移. 设dp[i]为已有i张票,还需要抽几次才能集齐的期望. 那么dp[ ...