modelsim命令以在Verilog testbench中选择特定的测试 [英] modelsim command to choose a particular test in Verilog testbench
问题描述
我有4个测试模式,所有模式都写在测试台的case语句中.在仿真过程中如何通过命令行一次调用每个测试?让我知道在仿真过程中一次选择一个测试平台案例的命令行参数.谢谢
I have 4 test patterns and all written inside a case statement in the testbench. How to call each test at a time through command line during simulation?let me know the command line argument for choosing one testbench case at a time during simulation. Thank You
推荐答案
为此,我将使用定义"或$ test $ plusargs和$ value $ plusargs.
I would use a "define" or $test$plusargs and $value$plusargs for that.
您可以使用+ define +参数在命令行上定义值的值.
You can define the value of a value on the command line using the +define+ argument.
+define+TEST_TO_RUN="4"
您现在可以在代码中使用以下方法获取值:
In your code you can now grab the value using:
case(`TEST_TO_RUN)
0 : ...
4 : ...
default: // default test or giving error message and stop
endcase
但是您必须重新编译代码.您也可以在代码中设置一个值,但命令行定义始终会覆盖该值.
But you have to re-compile the code. You can also set a value in the code but the command line define always overrides that.
或者使用$ test $ plusargs和$ value $ plusargs.
Alternative use $test$plusargs and $value$plusargs.
您还可以在此处
这篇关于modelsim命令以在Verilog testbench中选择特定的测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!