Forum Discussion
Altera_Forum
Honored Contributor
11 years agoDave:
Ok, some success! However, I'd like to review this with you as a sanity check since there are still some gaps in my understanding. I now understand the process to create a "library" (a directory folder, really, in Windows), compile the code into it (or anywhere that it is needed), see it in the ModelSim library window, and be able to refer to it. I also understand that ModelSim needs the compiled libraries to do its work. So far so good (I think)... 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 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. Thanks, all! Dave