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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -