作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要获取命令行选项来为 SystemVerilog 中的约束添加条件。
我正在从函数调用中调用 $value$pluargs("string=%d",val)
,我需要使用传递给函数的参数作为“字符串”名称.
function(string name);
$value$plusargs("<name>=%d", val)
endfunction
我不知道该怎么做。说 $value$plusargs("%s=%d",name,val)
会导致“太多参数”错误。
最佳答案
您可以使用字符串连接:
module tb;
int val = 5;
initial begin
$monitor("val=", val);
foo("bar");
end
function void foo (string name);
$value$plusargs({name, "=%d"}, val);
endfunction
endmodule
关于verilog - 将字符串变量传递给 plusargs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16361272/
我需要获取命令行选项来为 SystemVerilog 中的约束添加条件。 我正在从函数调用中调用 $value$pluargs("string=%d",val),我需要使用传递给函数的参数作为“字符串
我是一名优秀的程序员,十分优秀!