1

我想创建一个包含我可以在其他地方加载并在那里使用的类型的包。但我不让它工作。

就我而言,我有这样的事情:

类型.vhdl

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

package types is
    constant number : integer := 42;
    subtype fancy_vector is std_logic_vector(10 downto 0);
    type fancy_vector_array is array (4 downto 0) of fancy_vector;
end types;

tb_types.vhdl

library ieee;

use work.types.all;

entity tb_types is
end tb_types;

-- If I comment this entity out, everything works as expected
entity dummy is
    port (
        test : in fancy_vector_array
    );
end dummy;

architecture implementation of tb_types is
begin
    main: process begin
        assert (number = 42);
        report "Everything went well";
        wait;
    end process;
end implementation;

我像这样分析和编译测试台ghdl

$ ghdl -i types.vhdl tb_types.vhdl
$ ghdl -m tb_types
tb_types.vhdl:10:26:error: no declaration for "fancy_vector_array"

如果我将虚拟实体注释掉,一切都会按预期工作。断言没有触发,它报告“一切顺利”。

我在这里做错了什么?

我也试过没有.alland 和types.fancy_vector_arrayand types.number。然后它说:no declaration for "types"

4

0 回答 0