passing string variables to plusargs in system verilog -
the problem - need command line options add conditions constraints in system verilog.
i'm invoking $value$pluargs("string=%d",val) function call , need use parameter passed function 'string' name.
function(string name); $value$plusargs("<name>=%d", val) endfunction i'm not sure how this. saying $value$plusargs("%s=%d",name,val) results in 'too many arguments' error.
any suggestions appreciated! thanks!
you can use string concatenation:
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
Comments
Post a Comment