plusargs in verilog
plusargs are command-line switches supported by the
simulator. As per SystemVerilog LRM arguments beginning with the
+
character will be available using the
$test$plusargs
and $value$plusargs
PLI
APIs.
1 | $test$plusargs (user_string) |
Example
1 | // tb.v |
compile
1
2$ vlib work
$ vlog -sv tb.vsimulate (QuestaSim)
without plusargs
1
$ vsim work.tb -c -do "run; exit"
1
2
3
4
5
6
7
8
9# //
# Loading sv_std.std
# Loading work.tb(fast)
# run
# There is NO $test$plusargs
# There is NO $value$plusargs
# exit
# End time: 13:04:23 on Jun 04,2022, Elapsed time: 0:00:01
# Errors: 0, Warnings: 0with plusargs
1
$ vsim work.tb -c -do "run; exit" +SEED=31 +RUNSIM
+SEED=31 +RUNSIM
1
2
3
4
5
6
7
8
9# //
# Loading sv_std.std
# Loading work.tb(fast)
# run
# There is RUNSIM plusargs
# SEED= 31
# exit
# End time: 13:04:55 on Jun 04,2022, Elapsed time: 0:00:01
# Errors: 0, Warnings: 0
reference
systemverilog-command-line-input URL: https://www.chipverify.com/systemverilog/systemverilog-command-line-input
PLUSARGS IN SYSTEMVERILOG URL:https://www.theartofverification.com/plusargs-in-systemverilog/