Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- Apparently the thing to do is to use the 'work' as the container for user packages also.
--library CC_Data_Types ;
-- use CC_Data_Types.CC_Data_Types.all ;
library work ;
use work.CC_Data_Types.all ;
This keeps the ModelSim link happy, and Quartus is fine with it too. (I suppose I used the 'use library' in a non-standard way. I never understood this VHDL library idea anyway ..) --- Quote End --- Argh, that's a horrible thing to do :) Do you rebuild the lpm library, and altera_mf library, etc., every time you run Modelsim? No of course you don't. How then does Modelsim Altera know about these libraries ... through the magic of library mappings. Think of Modelsim libraries as shared object libraries, like a DLL or .so file. When you build a C program or C++ program, you link against the shared library, you do not build it each time. The same analogy holds for Modelsim libraries (whether the language be VHDL or Verilog - VHDL just happens to be more specific about their use). I don't have 10.0c installed just yet, but I'd be extremely surprised if library mapping is somehow broken :) Library mappings are stored in modelsim.ini or in the project file .mpf. I personally don't use .mpf files, since you cannot change directory in the Tcl shell. If you type the command 'where' or 'echo $env(MODELSIM)' it will tell you where the library mapping file is. Open that file and look at the top section [Library], and you will see all the mappings. vmap fred [pwd]/fred will edit that file and create a mapping to the library fred. Now you can compile into that library via vcom -work fred <some code> or delete the mapping via vmap -del fred But the delete will only work if the library mapping is still working correctly ($env(MODELSIM) points to what it thinks is the mapping file). If the original modelsim.ini file the variable MODELSIM points to was read-only, modelsim copies it to your local folder as modelsim.ini, and then changes the variable MODELSIM to simply modelsim.ini (i.e., a relative path, rather than an absolute path). If you cd away from the folder containing the copy of modelsim.ini, then the library mappings will not be visible anymore (since MODELSIM uses a relative path, and modelsim.ini does not exist in the folder you just changed to). I find this feature rather annoying. Perhaps you have just stumbled on it too. Cheers, Dave