Forum Discussion
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- Here is my initial directory structure for what is intended to be reusable objects: $myroot\vhdllibs\work\standard_additions | |-- src |---- <source code files> |-- packages |----- work |-------- standard_additions --- Quote End --- Since "work" is a library in its own right (the default VHDL library), you might want to use $myroot\vhdllibs\standard_additions instead (to avoid confusion). --- Quote Start --- In order to begin implementing reusable objects, like the standard_additions package I found on the 'net, I placed and compiled it into $myroot\vhdllibs\work\standard_additions folder. I found, though, that in order to use it in my TB, I had to "directly" include it into my Quartus project (that is, as a reference, NOT copying the actual file into project folder). If it is true that Quartus uses only source, this seems to be the only way to do it. This also means that I did not add (or appear even to need) a Global/Project library reference in Settings -> Libraries within Quartus. (Interestingly, I tried adding entries both the standard_additions source and compiled code directories, none of which worked and were subsequently removed. That's when I added the direct reference to standard_additions.vhd to the Quartus project. Somehow, this doesn't seem right and begs the question as to what the Settings -> Libraries entries actually do in Quartus.) I like using NativeLink to launch ModelSim. The main component file was compiled without issue, but the compiler choked when attempting to compile the test bench because it couldn't find the standard_additions library that I use in it. I "fixed" this by telling ModelSim to use the modelsim.ini file that was in $myroot\vhdllibs\packages directory (when setting up a new MS Project). So, while I have something that works, this seems a bit convolved (and as if I'm making this more difficult than it should be). I'd be very interested in yours and Tricky's suggestions/critiques. --- Quote End --- Quartus' support for VHDL libraries is "lacking" in places. At one point in time, VHDL libraries were ignored completely and everything was effectively compiled into "work". You can now add a -work option when you add libraries into Quartus. For Quartus synthesis I typically create a Tcl script that adds all relevant packages and source to a project, and I don't even bother to specify individual libraries. This is a reasonable "solution" since the libraries are meaningless anyway, i.e., Quartus does not provide an option for precompiling libraries for a device family so that you can synthesize multiple designs for a specific target. As for NativeLink, I never use it. I use a Quartus Tcl script for synthesis and a Modelsim Tcl script for simulation. If any of that Tcl is re-usable I put in in a Tcl package, and then set TCLLIBPATH to point to it, and import the code into either script via "package require hdl". Cheers, Dave