icarus verilog转储内存阵列($ dumpvars) [英] Icarus verilog dump memory array ($dumpvars)

查看:382
本文介绍了icarus verilog转储内存阵列($ dumpvars)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试转储数组(reg [31:0]数据[31:0]),但我无法成功完成. 我已经尝试了iverilog Wiki中的方法:

I try to dump an array (reg [31:0] data [31:0]) but I can't do it successfully. I've tried the way that is in the iverilog wiki:

integer idx;
for (idx = 0; idx < 32; idx = idx + 1)
    $dumpvars(0,cpu_tb.cpu0.cpu_dp.cpu_regs.data[idx]);

它可以工作,但是有两件事发生.

It works, but 2 things happen.

  1. 显示警告:VCD警告:数组字cpu_tb.cpu0.cpu_dp.cpu_regs.data [0]将与转义的标识符冲突.
  2. 在GTKWave中,我在SST窗口中有以下内容:\ data [0] [31:0]

有什么解决办法吗?

在此先感谢您的英语.

Thanks in advance and sorry for my English.

推荐答案

我已经通过电子邮件发送了Icarus Verilog的邮件列表.以下是一些答案:

I have e-mailed the mailing list of Icarus Verilog. Here are some answers:

要转储数组字,Icarus需要转义该名称,因此 与VCD转储格式兼容.这就是\ data [0] [31:0].它 是数据数组的第零个32位字.因为一个逃脱的名字 并且阵列名称现在可能会冲突Icarus会产生警告.它 如果可以检查转义的标识符冲突,则最好,并且 仅在出现问题时才打印消息,但正如我所记得的那样 不可能.

To dump an array word Icarus needs to escape the name so it is compatible with the VCD dump format. That's what \data[0][31:0] is. It is the zeroth 32-bit word of the data array. Because an escaped name and an array name could now conflict Icarus produces the warning. It would be best if it could check for an escaped identifier conflict and only print a message when there is a problem, but as I remember this was not possible.

我们选择使用转义的标识符,以便所有转储者都可以 处理数组字.另一个常见选择是仅支持它们 使用仅适用于某些转储的特殊转储命令 格式.

We chose to use escaped identifiers so that all the dumpers could handle array words. The other common choice is to only support them using a special dump command that only works with certain dump formats.

我同意,如果我们可以使警告更准确,那就太好了, 但是我们通常忙于其他事情,所以烦恼 修复起来似乎很复杂的问题通常不会得到修复.当我 请记住,已经有很多年了,问题是,如果您 搜索转义的标识符,然后找到数组元素 在VPI中无法搜索下一个事件.这是可能的 通过名称在伊卡洛斯搜索中找到数组元素 实现是一个错误.

I agree it would be nice if we could make the warning more accurate, but we are usually busy working on other things so minor annoyances that appear to be complicated to fix do not often get fixed. As I remember, and it has been a number of years, the issue is if you search for the escaped identifier it find the array element and there is no way in the VPI to search for the next occurrence. It's possible that finding the array element in the Icarus search by name implementation is a bug.

卡里

要转储数组字,Icarus需要转义该名称,因此 与VCD转储格式兼容.这就是\ data [0] [31:0]. 这是零吗?数据数组的32位字.因为逃脱了 名称和数组名称现在可能会冲突Icarus产生了 警告.最好是可以检查转义的标识符 冲突,只有在出现问题时才打印一条消息,但正如我 记住这是不可能的."

"To dump an array word Icarus needs to escape the name so it is compatible with the VCD dump format. That's what \data[0][31:0] is. It is the zeroth? 32-bit word of the data array. Because an escaped name and an array name could now conflict Icarus produces the warning. It would be best if it could check for an escaped identifier conflict and only print a message when there is a problem, but as I remember this was not possible."

...我认为没有必要对这些名称进行转义.既VCS (后跟fsdb2vcd)和CVC直接发出名称,而没有 问题.剪切和粘贴示例如下所示:

...I don't think that there's a need to escape the names. Both VCS (followed by fsdb2vcd) and CVC emit the name directly with no problems. Cut and paste example shown below:

$ var wire 5`'IC_DrAd0 [3] [4:0] $ end $ var wire 5 a'IC_DrAd0 [2] [4:0] $ end $ var wire 5 b'IC_DrAd0 [1] [4:0] $ end $ var wire 5 c'IC_DrAd0 [0] [4:0] $ end

$var wire 5 `' IC_DrAd0 [3][4:0] $end $var wire 5 a' IC_DrAd0 [2][4:0] $end $var wire 5 b' IC_DrAd0 [1][4:0] $end $var wire 5 c' IC_DrAd0 [0][4:0] $end

我意识到VCD规范并未对此进行定义,但我不得不将其折叠 这些年来,许多这类扩展到gtkwave的方法与其他方法一样 工具生成这些构造.转义符可能导致保存文件 尝试模拟时出现不兼容(信号丢失) iverilog与VCS.

I realize the VCD spec doesn't define this, but I've had to fold in a lot of these kinds of extensions into gtkwave over the years as other tools generate these constructs. The escapes can cause save file incompatibilities (missing signals) when trying to simulate on iverilog versus VCS.

随着时间的流逝,SV构造可能会导致进一步的变化. VCD文件. AFAIK,1364规范的VCD部分根本没有更新 自Verilog-XL. CVC通过以下方式解决了可能的不兼容性 添加+ dump_arrays plusarg(不,您不必在每个循环 数组元素).

Over time, SV constructs likely will cause further things added to the VCD files. AFAIK, the VCD part of the 1364 spec hasn't updated at all since Verilog-XL. CVC gets around possible incompatibilities by adding a +dump_arrays plusarg (and no, you don't have to loop on each array element either).

-托尼

我还向GTKWave的创建者Tony Bybell发送了一封邮件:

I also sent a mail to GTKWave creator Tony Bybell:

你好

问题是编译器没有将这些值发送到 转储文件.您必须与iverilog联系 开发人员.如果我运行sim并与之进行比较,我会看到相同的问题 另一个模拟器,例如启用了+ dump_arrays的CVC, 转储数组,它们在gtkwave中可见.

The problem is that the compiler is not emitting those values into the dump file. You'll have to get in contact with the iverilog developers. I see the same problem if I run sim and compare against another simulator such as CVC with +dump_arrays turned on which does dump the arrays and they are visible in gtkwave.

http://iverilog.wikia.com/wiki/Release_Notes_Icarus_Verilog_0_9_2 | 允许$​​ dumpvars接受要进行转储的数组成员

http://iverilog.wikia.com/wiki/Release_Notes_Icarus_Verilog_0_9_2 | Allow $dumpvars to accept array members for dumping,

...看起来好像在初始"时间内,您可能需要添加一个 您要转储的每个数组 element 的$ dumpvars语句.我不 知道数组名称本身是否有效.将每个元素分配给一个 电线"也可能起作用.

...it looks like during "initial" time you might need to add a $dumpvars statement for each array element you want dumped. I don't know if the array name by itself works. Assigning each element to a "wire" might work too.

我从未在iverilog中尝试过此功能,所以我不知道是否 有用.您可能需要试验或询问开发人员.

I have never tried this functionality in iverilog so I don't know if it works. You might have to experiment or ask the developers.

-托尼

这篇关于icarus verilog转储内存阵列($ dumpvars)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆