節錄自
http://www.socvista.com/bbs/archiver/?tid-2539.html
實際使用例請參考
http://kirenenko-tw.blogspot.com/2011/05/valueplusargs.html
另一個參考點有一些例子說明
http://testbench.in/TB_22_COMPILATION_N_SIMULATION_SWITCHS.html
此處另有說明$test$plusargs的使用
1. 我们比较常用的一般还有$value$plusargs这个task,在test_top中:$value$plusargs("casename=%s",casename)
通过脚本在run的时候把casename传递进去(给vcs/nc SIM_ARG: +casename=$Testcase_name.fsdb)
便于如果同时跑多个testcase的时候可以同时dumpfsdb,另外就是跳过一些时间开始dump(SIM_ARG: +time=$start_time)
$value$plusargs("time=%d",skip)
#skip
2. project中每个人关注的module不同,为了频繁去修改test_top的dump,一般也会把需要dump的内容用dumplist的file来实现
$fsdbDumpvarsToFile("dump.list");
比如dump.list内容:(#用于注释)
0 test_top
#1 test_top
#0 test_top.dut
#0 test_top.dut.m1
#0 test_top.dut.m2
像我们用的时候一般是在test_top.v添加相关的语句:
reg [100:0] casename;
integer skip, i;
initial begin
if( $test$plusargs("dumpfsdb") ) begin
if( $value$plusargs("time=%d", skip) )
#skip;
if( $value$plusargs ("casename=%s",casename) )
$fsdbAutoSwitchDumpfile(300, casename, 30);
else
$fsdbAutoSwitchDumpfile(300,"./test_top.fsdb",40);
$fsdbDumpvarsToFile("dump.list");
end
end
1. 跑仿真的时候,对应的如果要从5000ns(时间单位根timescale有关)处开始dump波形,给vcs/nc的参数
+dumpfsdb +time= 5000 +casename= testcase1.fsdb
其中的testcase1一般我们都会在脚本处理后跟case名字关联起来,这样子跑完之后就会从5000开始dump
testcase1_000.fsdb, testcase1_001.fsdb这样子,
2. 另外那个dump.list(名字可以随便取)里面的设定就跟平常的设定dump的层次设置一样了
层次 路径名
0 test_top.dut.m1
沒有留言:
張貼留言