01-11-2018 01:47 PM
I want to use the different library names for the same
Le's say I have a VHDL file with the following lines:
library mylib_1; use mylib_1.abc.all;
But, when I'm going to use the same file for another design, I want this library will be named differently:
library mylib_2; use mylib_2.abc.all;
I don't want to edit this file depending on what design this file is going to be used.
So, how should I manage this issue? Is it possible to do this using configurations? How?
01-12-2018 08:28 AM
I don't really understand what is your goal for using the same library/package with a different name...
Could you give more detail why it wouldn't work with the same names? Why not keeping the names of the libraries between project?
01-12-2018 09:06 AM
The unit includes packages of functions and procedures, which should be referenced inside of the files.
library pkgs; use pkgs.all;
But, then I integrate the unit into the higher hierarchy, this hierarchy also has a reference to the 'pkgs' library...
So how to solve this situation (same library names in different hierarchies/files, which should actually point to the different libraries)?
Probably is it possible to manage this situation in the following manner:
library unit1_lib; use unit1_lib.pkgs.all; library unit2_lib; use unit2_lib.pkgs.all;
But, how can I create a library inside of another library (e.g. library 'pkgs' inside of library 'unit1' and then a library 'pkgs' inside of library 'unit2')?
01-13-2018 06:13 PM
Library names are global and flat at the top-level of the environment... so can't be nested.
You could compile the utility packages for a unit in the same library as the unit. The unit just has to say "use work.all" to see all the packages. This way, the unit doesn't care/know about it's actual library name.
So, unit1 and all its packages can be compiled into library unit1_lib. Internally though, the unit1 code just uses "use work.all".
Other units, like unit2 can be arranged the same way. It's own packages are in "work" . To use unit1, it just needs to reference library unit1_lib.