sv 传递参数$value$plusargs / $test$values /command line processor

457 阅读1分钟

sv 传递参数


run_test如何获取参数 +UVM_TESTNAME=xxx
uvm_root.sv
关键词:value plusargs testplusargs valueplusargs

$value$plusargs

$value$plusargs可以讲运行命令(run-options)中的参数值传递给指定的信号或者字符,其语法格式如下:

Integer = $value$plusargs(“string”,signalname);

其中string = ”plusarg_format”+”format_string”,”plusarg_format”指定了用户定义的要进行传递的值,”format_string”指定了要传递的值的格式(类似$display中定义的%s、%h、etc.),并且string中”plusarg_format”和”format_string”格式应该为”plusarg_format”(=/+)”format_string”。

在这里插入图片描述

$test$values

$test$plusargs会在命令行中搜索指定的字符,若找到相应字符,在函数返回“1”,否则返回“0”。如果下次仿真时不需要test01时,仅需要将test01从运行命令中删除即可。
[参考] [SV]$test$plusargs和$value$plusargs的使用

command line processor传递参数

command line processor传递参数