-1

I am new to VHDL and I'm using VIvado 2017.1.

I'm trying to use a package to define constants and other such enumerated types to include in multiple models. Right now however, I am unable to use the package in my model. I keep getting

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

However the package in question is in the xil_defaultlib folder and I'm pretty sure it's compiled as I see no errors [as seen here][1].

My code for each is

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;

and

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

user5565748
  • 1
  • 1
  • 1
  • 2
  • How do you imagine running VHDL snippets?:) – Staszek May 09 '17 at 08:55
  • I think it is a vivado configuration issue. When you add files, you need to put them in the same library. Only then they can see each other (using `work`). Check the libraries tab in vivado. – JHBonarius May 09 '17 at 11:28
  • 1
    I'm pretty sure that code hasn't compiled, because I see several errors. –  May 09 '17 at 21:45
  • It was the errors. I knew there were likely errors in the entity file but I didn't see any errors in the package file and for some reason, vivado was not pointing any errors out besides that package use statement. As I mentioned, I am new to vhdl and still learning its syntax. It was x'1C' instead of x"1C" that was stopping it from compiling – user5565748 May 10 '17 at 04:41

2 Answers2

4

I'm not sure about correctness of your design, but that's not the question. Try this:

Open your project, right-click Design Sources, choose Hierarchy update, and make sure, that first option (Automatic update and compile order) is marked.

Staszek
  • 849
  • 11
  • 28
0

It was errors as mentioned by Brian Drummond. I had written x'1C' instead of x"1C".

user5565748
  • 1
  • 1
  • 1
  • 2