uvm_cmdline_processor
无意中看到uvm_cmdline_processor,之前使用+UVM_TESTNAME也没深究,现在记录一下
内部调用脚本中的参数,通过使用uvm_cmdline_processor可以从脚本层级,从外部向仿真环境传递参数
get_arg_value( string match, ref string value )
Function:
get_arg_value
This function finds the first argument which matches the match arg and
returns the suffix of the argument. This is similar to the $value$plusargs
system task, but does not take a formating string. The return value is
the number of command line arguments that match the match string, and
value is the value of the first match.
使用例子:
uvm_cmdline_processor clp = uvm_cmdline_processor::get_inst();
等价于:
uvm_cmdline_processor clp;
clp=new();
1 program automatic test;
2 import uvm_pkg::*;
3
4 class hello_world extends uvm_test;
5
6 uvm_cmdline_processor clp;
7 int arg_value;
8 string arg;
9
10 `uvm_component_utils(hello_world);
11
12 function new (string name, uvm_component parent);
13 super.new(name, parent);
14 clp=new();
15 if(clp.get_arg_value("+arg_value=",this.arg)) begin
16 this.arg_value=this.arg.atoi();
17 `uvm_info("test_arg", $sformatf("input value = %d", arg_value), UVM_DEBUG);
18 end
19 else begin
20 `uvm_info("test_arg", "no input arg_value", UVM_DEBUG);
21 end
22
23 endfunction
24
25 endclass
26
27 initial begin
28 run_test();
29 end
30
31 endprogram
运行:
./simv +UVM_TESTNAME=hello_world +UVM_VERBOSITY=UVM_DEBUG +arg_value=100
结果:
UVM_INFO hello.sv(19) @ 0: uvm_test_top [test_arg] input value = 100
uvm_cmdline_processor的更多相关文章
- uvm_base——打好你的基础
uvm_base 是个很有意思的文件,这是UVM很巧妙的设计,将所有在base中包含的文件都包含在uvm_base.svh, 这样很方便管理各个文件直接的关系,而且还可以看出一些我之前没看过的东西,比 ...
- UVM基础之---Command-line Processor
提供一个厂商独立的通用接口命令行参数,支持分类: 1. 基本参数和值:get_args,get_args_matches 2. 工具信息:get_tool_name(),get_tool_ve ...
随机推荐
- 我为什么要翻译ES6官方文档
ES6出来很久了,现在网上也有很多教程,其中以阮一峰老师的教程最为经典.大家通过学习阮老师的教程肯定能学懂ES6最新的技术. ES6官方文档是一个规范,各浏览器在实现ES6的具体API时都会遵循它.我 ...
- C# 随机串的生成
/** * 生成随机串,随机串包含字母或数字 * @return 随机串 */ public static string GenerateNon ...
- [Selenium With C#基础教程] Lesson-04 按钮
作者:Surpassme 来源:http://www.jianshu.com/p/83d7416c4b7d 声明:本文为原创文章,如需转载请在文章页面明显位置给出原文链接,谢谢. Button通常有两 ...
- 深入理解java虚拟机(十二) Java 语法糖背后的真相
语法糖(Syntactic Sugar),也叫糖衣语法,是英国计算机科学家彼得·约翰·兰达(Peter J. Landin)发明的一个术语.指的是,在计算机语言中添加某种语法,这些语法糖虽然不会对语言 ...
- logback-spring.xml配置文件详解
logback-spring.xml配置文件 自己改下value="G:/logs/pmp"这个值,如果你相关依赖弄好的话,直接复制粘贴即用 输出的日志文件的名称最好也改下,下文中 ...
- thinkjs 框架图
- Echarts X轴内容过长自动隐藏,鼠标移动上去显示全部名称方法
最近公司做项目,使用echarts做开发,碰到一些数据的名称很长导致图例展示的效果不是很好,自己写了一个方法,当X轴内容过长时自动隐藏,鼠标移动上去显示全部名称 样例: 图二是鼠标移动到名称显示的,怎 ...
- JFrog Artifactory
是一款二进制存储管理工具,用来管理构建构建工具(如:gradle.maven.nuget.docker等等)等所依赖的二进制仓库,以方便管理第三方库和发布目标版本库,从而提高软件开发效率. 为DevO ...
- Page.FindControl(string id) 与母版页结合后发现的一个问题
MSDN上解释Page.FindControl(string id)方法用于查找指定ID的控件.例如: <asp:TextBox id="Email" runat=" ...
- Binder学习笔记(一)
网上看了很多关于binder的文章,但我还是想把自己的心路历程记录下来,有些是跟着别人的脚步领略险峻风景,有些则是自己只身探入代码深处打捞出的收获.我不确定是否全部融会贯通,更担心一两个月后会完全不记 ...