Forum Discussion
Altera_Forum
Honored Contributor
16 years agoHi everyone, here is my understanding of how the library files are best used (from much experimentation):
First off, this is what works for me: I have re-usable design entities in a library folder. Most of these have multiple architectures. In this folder of .vhd files I have a single .vhd which declares a package, eg. my_pkg. This package has a component declaration for each .vhd file in the directory. All of the .vhd files use the "- synthesis library my_lib" directive for keeping them in a unique namespace. So, in my project, the only file i need to include is the package file. If i use any of the components declared in the package file i must add to the file in my project where the components are used/ mapped: library my_lib; use my_lib.my_pkg.all; you will get warnings from quartus that it is using design units not in the project but this is fine. For some reason Quartus will only infer design entities for component declarations, either using my indirect package method, or a component declaration directly in your project files. I tried direct instantiation, by specifying the library as follows: my_device: entity my_lib.my_entityname( anArchitecture ) etc. which in theory should work but does not. Quartus does not bother to look in the additional directories to infer the design unit from the file names of the same name. I have a feeling that it is down to the compiler not having compiled the components into their specified vhdl libraries (using their synthesis directives) before the components are used in my project. Somehow it does do this when the components are explicitly declared before instantiation. ;) [bitwiselannon]