我有以下代码:
entity test is
end entity;
architecture rtl of test is
type T_TUPLE is record
A : NATURAL;
B : NATURAL;
end record;
type T_VECTOR is array (NATURAL range <>) of T_TUPLE;
constant LIST : T_VECTOR := ((8, 32), (8, 20), (8, 36));
begin
genTests : for i in LIST'range generate
constant LOCAL_A : NATURAL := LIST(i).A;
constant LOCAL_B : NATURAL := LIST(i).B;
begin
-- my tests
end generate;
end architecture;
我的生成语句收到以下错误消息:
...范围必须是静态离散范围
当我将常量更改为受约束的变体时,它可以工作...
constant LIST : T_VECTOR(0 to 2) := ((8, 32), (8, 20), (8, 36));
为什么 2. 示例更静态?
编辑:
链接到 GitHub 上的GHDL 问题讨论。