The simplest way to build a large project in MAX+plus II is to just dump all your VHDL source files in one directory and use the default "work" library when referring to any of your custom-made packages.
However, this results in a very cluttered directory, and is not particularly appealing if you like to organize files in a neat directory structure. This document describes how to manage a project whose source files are located in several different directories.
You need to tell MAX+plus II where your libraries are (or will be) located.
Go to the Options menu and select User Libraries.... You should see a dialog similar to the one below:
Type in the path of a library directory in the Directory Name field, or navigate to it using the Directories tree structure. The Directory Name field will automatically update whenever you make a selection in the tree.
When you have selected a library folder, click the Add button to place it in the list of Existing Directories.
Do this for each directory that you will use to hold your library source code.
NOTE: Your user libraries settings are global. They are saved to your
~/maxplus2.ini
file, and will be used for all
your MAX+plus II projects, including any new ones that you create,
and including any non-VHDL projects.
Let us use the example of a project whose top-level VHDL file contains the lines:
library ieee; use ieee.std_logic_1164.all; library project; use project.Global_Constants_Package.all; library util; use util.Utilities_Package.all; library math; use math.Floating_Point_Package.all;
You must tell MAX+plus II where to find each of the "non-standard" libraries that you refer to in your VHDL file..
Open your .vhd
file
and choose File -> Project -> Set Project to
Current File.
Select the Compiler window by going to the MAX+plus II menu and selecting Compiler.
As always, choose VHDL 1993 if you haven't already done so.
You must now specify your Project Libraries by associating a path with each library name.
Select one of your library directories by typing directly in the Directory Name field or by navigating to it in the Directories tree.
Type in the name of the library in the Library Name field
Click Add to add the library to the list of Existing Libraries. To change the name of an existing library, select it, retype its Library Name, and click Add again.
Repeat Steps 5 to 7 for each of the library directories that will
be used in the current project. You only need to specify the paths of the
libraries that you explicitly refer to with a VHDL library
statement.
Repeat Steps 1 to 8 for each VHDL file that refers to libraries and packages from directories other than the one containing the VHDL file.
library_name could not be found. Open the VHDL Netlist Reader Settings dialog and add library_name to your list of Existing Libraries, making sure that the directory is correct. Recompile.
package1 from library1 uses package2 from library2, but library2 is not in the list of Existing Libraries for the project that you are trying to compile.
You need to add library2 to the list of Project Libraries (see Part B above). After doing so, recompile the project that gave you the error message.
package2 has been modified and compiled since the last time you compiled package1, and as a result, package1 is out of date.
Recompile package1, then try recompiling the project that gave you the error message.