We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 18583

XST - "ERROR:Xst:1538 - file.vhd line xxx: Component 'xxx' has two entities compiled in libraries and "


XST does not properly resolve the 'use' VHDL statement when managing libraries. As a result, XST might issue an error message similar to the following: 


"ERROR:Xst:1538 - file.vhd line xxx: Component 'xxx' has two entities compiled in libraries <a_lib> and <work>."


If a design has VHDL files being compiled into user-defined libraries with the default 'work' library not being used but still declared: 


library ieee; 

library work; 


then XST will issue the error message noted above. Because the 'work' library is not being used, remove the 'library work' declaration from the project files and the error will go away.


XST will issue the error message noted above in the following circumstance: 


- entity thing1 (VHDL file thing1_arch1.vhd) compiled into library lib1 

- entity thing1 (VHDL file thing1_arch2.vhd) compiled into library lib2 

- entity thing2 (VHDL file thing2.vhd) which instantiates thing1 from thing1_arch1.vhd compiled into library lib1 

- entity thing3 (VHDL file thing3.vhd) which instantiates entities thing2 and thing1 (from thing1_arch2.vhd) compiled into the work library 

- thing3.vhd contains the following library and 'use' declarations: 

library lib1, lib2; 

use lib1.thing2; 

use lib2.thing1; 


To work around the above situation, use direct instantiation in the thing3 architecture: 


library ieee; 

use ieee.std_logic_1164.all; 

library lib1; -- contains thing1_arch1.vhd and thing2.vhd 

library lib2; -- contains thing1_arch2.vhd 

-- For XST and the direct instantiation the library declarations are not needed 

-- however they are listed to ensure that MTI will still compile the file successfully 


instance_name1 : entity lib1.thing2(thing2_arch) 

port map (...); 


instance_name2 : entity lib2.thing1(thing1_arch2) 

port map (...);

AR# 18583
Date Created 09/03/2007
Last Updated 05/16/2014
Status Archive
Type General Article