我是 VHDL 新手,正在使用 VIvado 2017.1。
我正在尝试使用包来定义常量和其他此类枚举类型以包含在多个模型中。但是现在,我无法在我的模型中使用该包。我不断得到
Error: Cannot find <PACKAGE NAME> in library <xil_defaultlib>. Please ensure that the library was compiled, and that a library and a use clause are present in the VHDL file
然而,有问题的包位于 xil_defaultlib 文件夹中,我很确定它已编译,因为我没有看到错误[如此处所示][1]。
我的每个代码是
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
use work.Specs_Package.all;
entity Freq_Divider is
Port ( En,clk, reset : in std_logic; clock_out: out std_logic);
end Freq_Divider;
architecture bhv of Freq_Divider is
signal count: std_logic_vector(7 downto 0);
signal tmp : std_logic := '0';
begin
if rising_edge(reset) then
count <= x'00';
end if
process(clk,EN)
begin
if EN = '1' then
rising_edge(clk) then
count <= count + 1;
end if;
end if;
end process;
end bhv;Run Code Online (Sandbox Code Playgroud)
和
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
PACKAGE SPECS_PACKAGE IS
--Freq Divider
--667Mhz clock
--667/23=29MHz 22 - 0x16
--667/29=23MHz 28 - 0x1C
--667/46=14.5MHz 45 - 0x2D
CONSTANT FREQ_DIVIDER_LIMIT : STD_LOGIC_VECTOR(7 DOWNTO 0) := X'1C';
END PACKAGE SPECS_PACKAGE;Run Code Online (Sandbox Code Playgroud)
://i.stack.imgur.com/4b1vz.png
我不确定你的设计的正确性,但这不是问题。尝试这个:
打开项目,右键单击 Design Sources,选择 Hierarchy update,并确保第一个选项(自动更新和编译顺序)已标记。