【发布时间】:2015-09-16 16:00:42
【问题描述】:
我正在尝试在包中声明一个无符号数组,以便我可以在所有组件中使用相同类型的数组。我先在顶层组件中声明,然后使用work库和use命令调用各个组件中的包。我收到一条警告,上面写着
警告:ProjectMgmt:454 - 使用规则检测到文件循环依赖:define-before-use。
我还收到一条错误提示
第 27 行:在库
<work>中找不到<test2>。请确保库已编译,并且 VHDL 文件中存在库和 use 子句。
为什么存在循环依赖,我是否正确创建和使用包?
顶级组件
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;
【问题讨论】:
-
你用的是什么工具?您的代码在 ModelSim 中编译良好,将
test1输出端口更改为输入。此外,您不必声明work库。 -
它在 ModelSim 上也适用于我,但无法在 ISE Project Navigator 中合成。
-
尝试项目 > 清理项目文件。另外,请尝试删除您的
library work;行,也许这些会让它感到困惑。 -
我都试过了,但得到了相同的结果。
-
也许它不喜欢你的包和
test1在同一个文件中;尝试将包放在它自己的文件中(我认为这无论如何都会更传统)。如果这不起作用,那么我不确定对不起!
标签: vhdl circular-dependency xilinx xilinx-ise