首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LRM Bug还是Tool Bug?

LRM Bug还是Tool Bug?
EN

Stack Overflow用户
提问于 2019-03-28 22:36:27
回答 1查看 126关注 0票数 2

我有以下代码:

代码语言:javascript
复制
library ieee;
use ieee.std_logic_1164.all;

use std.textio.all;

entity read_fail is
end entity read_fail;

architecture test of read_fail is
begin

  process
    variable l  : line;
    constant s  : string(2 to 5) := "1111";
    
    variable a  : std_logic_vector( 3 downto 0);
    
  begin
    l := new string'(s);
    
    read(l, a);
    DEALLOCATE(l);
    
    report "done read";
    
    wait;
  end process;

end architecture;

当在ActiveHDL中运行时,我得到以下错误:

代码语言:javascript
复制
RUNTIME: Fatal Error: RUNTIME_0047 std_logic_1164-body.vhdl (1114): Index 1 out of range (2 to 5)

现在,我知道为什么会发生这种情况了,但我不确定这是LRM故障,还是Aldec有自己的实现?在LRM中没有(我可以找到)指定行必须从索引1开始的内容。

如果我将a更改为范围,就没有问题(因为我假设字符串在读取过程中是别名的,或者使用了‘bit_vector )。

如果有LRM/库问题,最好能在VHDL 2018/19中修复它。

编辑

因此,这似乎是一个Aldec问题,一种解决方法是对返回的切片重新编号:

代码语言:javascript
复制
procedure renumber (l : inout line) is
  variable tmp    : line;
begin
  tmp     := new string(1 to l'length);
  tmp.all := l.all;
  DEALLOCATE(l);
  l := tmp;
end procedure;
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-05 18:23:01

当然,IEEE的std_logic_1164包体不是由Aldec定义的,而是由IEEE发布的。请在其他模拟器中关闭此包的加速,以获得与Aldec相同的结果。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55400278

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档