我试图在包中声明一个无符号数组,以便我可以在所有组件中使用相同类型的数组。我先在顶层组件中声明它,然后使用工作库和use
命令调用每个组件中的包。我收到一条警告说
警告:ProjectMgmt:454 - 使用规则检测到文件循环依赖:使用前定义。
我还收到一条错误消息
<test2>
第 27 行:在库中找不到<work>
。请确保库已编译,并且库和使用子句存在于 VHDL 文件中。
为什么存在循环依赖,我是否正确创建和使用包?
顶级组件
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
package pkg is
type array_unsigned is array (99 downto 0) of UNSIGNED(7 downto 0);
end package;
package body pkg is
end package body;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
library work;
use work.pkg.ALL;
entity test1 is
end test1;
architecture Behavioral of test1 is
signal input : array_unsigned;
begin
sub: entity work.test2(Behavioral)
port map(input=>input);
end Behavioral;
低级组件
library IEEE;
library work;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use work.pkg.ALL;
entity test2 is
Port (input : in array_unsigned);
end test2;
architecture Behavioral of test2 is
begin
end Behavioral;