2017-05-09 58 views
-2

我是VHDL新手,我使用的是VIvado 2017.1。VHDL包不编译

我想使用一个包来定义常量和其他这样的枚举类型以包含在多个模型中。但是,现在我无法在我的模型中使用该软件包。我不断收到

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;

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;

://i.stack.imgur.com/4b1vz.png

+0

你如何想象运行VHDL片段?:) – Staszek

+0

我认为这是一个vivado配置问题。当你添加文件时,你需要把它们放在同一个库中。只有这样他们才能看到对方(使用“工作”)。检查vivado中的库选项卡。 – JHBonarius

+1

我很确定代码没有编译,因为我看到了几个错误。 –

回答

0

我不确定你的设计是否正确,但这不是问题。 试试这个:

打开您的项目,右键单击Design Sources,选择Hierarchy更新,并确保标记了第一个选项(自动更新和编译顺序)。

+0

是的,我检查过它已经标记了 – user5565748

0

这是布莱恩德拉蒙德提到的错误。我写了x'1C'而不是x“1C”。

+0

D'oh!也许你应该在下次发布(或至少阅读)所有错误消息...... – JHBonarius