User guide
4-10
Simulating Your Design
Passing Values From the Runtime Command Line
The $value$plusargs system function can pass a value to a signal
from the simv runtime command line using a plusarg. The syntax is
as follows:
integer = $value$plusargs("plusarg_format",signalname);
The plusarg_format argument specifies a user-defined runtime
option for passing a value to the specified signal. It specifies the text
of the option and the radix of the value that you pass to the signal.
The following code example contains this system function:
module valueplusargs;
reg [31:0] r1;
integer status;
initial
begin
$monitor("r1=%0d at %0t",r1,$time);
#1 r1=0;
#1 status=$value$plusargs("r1=%d",r1);
end
endmodule
If you enter the following simv command line:
simv +r1=10
The $monitor system task displays the following:
r1=x at 0
r1=0 at 1
r1=10 at 2