如何查看内存波形?
我无法使用 gtkwave 查看内存
:
module internal_memory(
output [31:0] hrdata,
input mem_enable,
input [31:0] haddr,
input [31:0] hwdata,
input hwrite,
input hreset,
input hclk
);
reg [31:0] memory [0:1023]; // <-------------- can't find its waveform
reg [31:0] internal_hrdata;
always @(posedge hclk, hreset) begin
if (!hreset) begin
internal_hrdata <= 32'h0000_0000;
end
else begin
if (mem_enable) begin
if (hwrite) begin
memory[haddr] <= hwdata;
end
else begin
internal_hrdata <= memory[haddr];
end
end
end
end
assign hrdata = internal_hrdata;
endmodule
您有什么建议来查看内存
的波形?
或者如何在 gtkwave 或任何 .vcd/波形查看器中显示二维数组?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这是一个老问题,但最近我不得不在课程期末项目中使用 Icarus/GTKWave 查看模拟内存,并希望为阅读此问题的任何人回答这个问题。我在 Icarus Verilog 可移植性说明中找到了答案(参见源代码)。
使用 Icarus,您需要转储要显式查看的每个数组字(内存位置):
您可以使用 for 循环自动转储数组中的所有单元格:
来源:http://iverilog.wikia.com/wiki/Verilog_Portability_Notes(转储数组字)
I know this is an old question, but I recently had to view a simulated memory with Icarus/GTKWave for a course final project and wanted to answer this for anyone reading this question. I was able to find the answer on the Icarus Verilog Portability notes (see source).
With Icarus, you need to dump each array word (memory location) you want to look at explicitly:
You can automate dumping all of the cells in an array with a for loop:
Source: http://iverilog.wikia.com/wiki/Verilog_Portability_Notes (Dumping array words)
您需要先将内存转储到VCD文件中。我熟悉的 2 个模拟器需要额外的模拟选项才能将内存转储到 VCD 中;也许你的也是如此。
You need to first dump the memory into the VCD file. The 2 simulators I am familiar with require extra simulation options for dumping memories into the VCD; perhaps yours does too.