有什么通用的方法可以在vcd转储中插入注释(或者可能是任何字符串)吗?例如,在下面的代码中,当a更改为1时,我想插入一些注释:
module test;
reg a;
initial begin
$dumpfile("dump.vcd");
$dumpvars(1,test.a);
end
initial begin
a = 0;
#10;
// insert_vcd_string("MY_STRING", dump.vcd);
a = 1;
#10;
end
endmodule发布于 2014-12-04 23:37:10
不存在将注释字符串写入vcd文件的标准系统任务,尽管$comment是用于创建注释部分的vcd关键字:
来自IEEE Std 1800-2012 LRM
$comment This is a single-line comment $end
$comment This is a
multiple-line comment
$end我会用$dumpoff,$dumpflush和$dumpon做实验。$dumpoff和$dumpoon在vcd文件中留下一个带有时间戳的标记,即#time $dumpoff ... $end
来自IEEE Std 1800-2012 LRM的示例
#1000
$dumpoff
x*@
x*#
x*$
bx (k
bx {2
$end
#2000
$dumpon
z*@
1*#
0*$
b0 (k
bx {2
$end您可以在a更改为1时在dumpoff/on之间切换,并对vcd文件进行后处理以在它们之间插入$comment ... $end。
发布于 2014-12-04 13:41:27
IEEE Std 1800-2012没有指定将注释插入VCD文件的任何函数。
您可以使用类似于创建一个长名称的变量,该变量看起来类似于您的字符串,但这只会出现在标头部分,而不是在任何指定的时间。例如,在Verilog代码中:
reg here_is_my_string;这将显示在VCD文件中,如下所示:
$var reg 1 " here_is_my_string $end发布于 2014-12-05 05:58:59
如果您正在使用Modelsim/Questa,您可以这样做
initial begin
a = 0;
#10;
mti_fli::mti_Command("vcd comment MY_STRING");
a = 1;
#10;
end或者因为您已经在使用SystemVerilog
import mti_fli::*;
string comment;
initial begin
a = 0;
#10;
comment = "MY_STRING";
mti_Command({"vcd comment ",comment});
a = 1;
#10;
endhttps://stackoverflow.com/questions/27288729
复制相似问题