- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法使用 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/waveform 查看器中显示二维数组?
最佳答案
我知道这是一个老问题,但我最近不得不在类(class)期末项目中使用 Icarus/GTKWave 查看模拟内存,并希望为阅读此问题的任何人回答这个问题。我在 Icarus Verilog 可移植性说明中找到了答案(参见源代码)。
使用 Icarus,您需要转储要显式查看的每个数组字(内存位置):
module top;
reg [7:0] array [2:0];
initial begin
$dumpvars(0, array[0], array[1]);
...
end
endmodule
您可以使用 for 循环自动转储数组中的所有单元格:
module top;
integer idx; // need integer for loop
reg [7:0] array [2:0];
initial begin
for (idx = 0; idx < 2; idx = idx + 1) $dumpvars(0, array[idx]);
...
end
endmodule
来源:http://iverilog.wikia.com/wiki/Verilog_Portability_Notes (转储数组字)
关于verilog - 如何查看内存波形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8264350/
如标题所示,结构 Verilog 和行为 Verilog 之间的主要区别是什么? 最佳答案 根据 IEEE 标准,这些术语没有严格的定义。然而,习惯上,结构 是指使用模块实例来描述设计(尤其是对于较低
我正在尝试简单地转换流程图 state machine进入 Verilog代码。 但是我不知何故被以下内容困住了,因为我对 Verilog 几乎没有任何了解,所以我可能会遗漏一些东西。 状态机检测到
是否可以在 verilog 中参数化位域?本质上,我想使用参数或替代方法来定义位范围。我能想到的唯一方法是使用如下所示的`define,但似乎应该有更好的方法。 `define BITFIELD_SE
初学者在这里。我正在尝试在 Verilog 中编写一个简单的 16 位微处理器并在 Spartan 6 上实现它。 ALU 实现所有有符号操作(根本没有无符号操作)。所有输入都是连线并带有符号。结果存
我写了一些 Verilog 代码,其中部分代码如下: int i; add_bit = 1'b0; for (i = 0; i < add_len; i++)
我需要在我的 Verilog 代码中使用有理数。我寻找了任何资源,但找不到有关此问题的任何信息。如何在 Verilog 中定义有理数。 最佳答案 Verilog 有一个 real用于实数(浮点)数的数
我正在自学verilog。我正在阅读的这本书在介绍章节中指出,要执行除法,我们使用“/”运算符或“%”运算符。后面几章都说除法对于verilog来说太复杂了,不能综合,所以要进行除法就引入了很长的算法
是否可以在 Verilog 中创建 parameter 数组?例如,类似于以下内容: parameter[TOTAL-1 : 0] PARAM_ARRAY = {1, 0, 0, 2} 如果不可能,那
例如,假设我有一个 reg [7:0] myReg我给它赋值 -8'D69 我知道 Verilog 将它存储为 2 的补码,所以它应该存储为 10111011 我现在的问题是是否要对其执行操作,例如
我正在尝试编写一个用于遗传算法的适应度函数,该函数包含指数部分。那么我该如何实现这个函数( e^x ),其中 e :the base=2.7 ,x:exponent 在 verilog HDL 语言中
我在verilog中有一个语句,看起来像integer level = log(N)(其中N是一个参数,级别待确定)但我知道我无法在verilog中执行复杂的数学语句,所以我想知道是否有替代解决方案来
在 Verilog 中,您可以简单地使用模块语法创建模块。如何创建多个模块并调用另一个模块? 我的主模块有以下模块: module Lab7Part1(SW, HEX0, HEX1, HEX2, HE
在使用自上而下的方法在 verilog 中设计电路时,我可以从电路的行为开始,然后定义每个模块中的细节,以构建可综合的结构电路。但我怎么知道我的代码是否可综合呢?是否有任何指南可以遵循来支持 veri
如果我有一个 if 语句,例如: if(risingEdge && cnt == 3'b111) begin ... end 如果risingEdge不为真,它会检查cnt吗? 这在 HDL 内部
我一直在尝试构建一个模块,该模块返回(3 位)输入的二进制补码表示(第一位是符号)。我认为以下代码在概念上是正确的,但我可能遗漏了它的结构:当我尝试编译时,出现以下错误: (vlog-2110) Il
我对 HDL 语言非常陌生。我有一个关于如何对移位寄存器进行编程的问题。 (我知道我转向另一个方向)。为什么本书使用 wire[N-1:0] r_next?我的实现有什么缺点?谢谢 我的第一次尝试如下
郑重声明,我是一个十足的 Verilog 新手。我正在编写一个使用一些双向总线的模块。 inout wire [KEY_SIZE-1:0] prevKey; inout wire [TAG_SIZE-
我进行了搜索以了解 verilog 中的行为代码和数据流代码之间的区别。最后我找不到很好的例子,到处都在讲述他们所做的事情。例如: “它非常简单。名称本身就解释了它们是什么。数据流是描述程序的一种方式
在 Verilog 中,您可以简单地使用模块语法创建模块。您如何创建多个模块并从另一个模块调用一个? 我有以下模块是我的主要模块: module Lab7Part1(SW, HEX0, HEX1, H
我正在学习 verilog 分层事件队列。我对非事件事件有一点疑问。我知道它们是在当前模拟时间完成所有事件事件后执行的。但是我写了一个简单的代码来更好地理解这个概念,但我得到的结果让我感到困惑。这是我
我是一名优秀的程序员,十分优秀!