Icarus Verilog 警告 $readmemh:标准不一致,遵循 1364-2005

Icarus Verilog warning $readmemh: Standard inconsistency, following 1364-2005

我正在尝试使用 $readmemh 读取内存文件,但我不确定正确的文件格式是什么,因为我看到了一条警告。

在我的测试台中,我有以下内容:

reg [7:0] progmem [4095:0];

initial begin
    $readmemh("progmem.txt", progmem);
end

并且progmem.txt包含:

01
03
ff
00

依此类推,总共 4096 行。 运行测试台时,vvp显示:

$readmemh: Standard inconsistency, following 1364-2005

我已经尝试查找它,但我还没有找到关于它实际含义的解释。

不同版本的 IEEE Std 1364 指定如何通过 $readmemh 不同地加载内存。

1364-1995 州:

... the default start address is the left-hand address given in the declaration of the memory. Consecutive words are loaded until either the memory is full ...

1364-2001 状态:

... the default start address shall be the lowest address in the memory. Consecutive words shall be loaded until either the highest address in the memory is reached ...

在你的声明中,左边的地址是4095,但最低地址是0。

不是将第一个单词 (01) 加载到 progmem[4095],我相信警告是在告诉您它正在将第一个单词加载到 progmem[0]

当我将声明更改为以下内容时,edaplayground 上 iverilog 上的警告对我来说消失了:

reg [7:0] progmem [0:4095];