modelsim - System task or function '$value$plusarg' is not defined -> Warning : Verilog -


i trying learn how use $value$plusarg. have picked following code somewhere.

module test; integer i, r;  initial begin   r = $value$plusarg("myint=%d", i);   $display("value %0d", i); end  endmodule 

when tried run it, getting warning as:

system task or function '$value$plusarg' not defined. 

i have used modelsim. commands have used follows:

vlog test_genvar.v +define+myint="22" vsim work.test run -all 

i not sure if problem code or commands have used. in advance :)

very silly mistake. system task name $value$plusargs , not $value$plusarg (missing 's'..!!!).

moreover, may use $test$plusargs detect/test whether given switch available @ run-time or not. follows:

if($test$plusargs("myint")) begin $value$plusargs("myint=%d",i); end 

one more thing, using vcs, , provide these kind of switches, use "./simv +myint=5" (of course simv compiled-executable file). so, no need of +define+myint=5, directly +myint=5 should work.

also, these run-time switches , not compile time. so, think should vsim command , not vlog, not sure this. not big deal, guess.

your code available here @ edaplayground, simulated vcs. reference.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -