Managing a Multi-Directory VHDL Project in MAX+plus II


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.


Part A: Specify the location of your User Libraries

You need to tell MAX+plus II where your libraries are (or will be) located.

  1. Go to the Options menu and select User Libraries.... You should see a dialog similar to the one below:

  2. 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.

  3. When you have selected a library folder, click the Add button to place it in the list of Existing Directories.

  4. 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.


Part B: Set the Project Libraries for each project file

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..

  1. Open your .vhd file and choose File -> Project -> Set Project to Current File.

  2. Select the Compiler window by going to the MAX+plus II menu and selecting Compiler.

  3. Go to the Interfaces menu and choose VHDL Netlist Reader Settings.... The following dialog will appear:

  4. 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.

  5. Select one of your library directories by typing directly in the Directory Name field or by navigating to it in the Directories tree.

  6. Type in the name of the library in the Library Name field

  7. 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.

  8. 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.

  9. 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.


Compiler error messages and what to do about them

Can't open VHDL "library_name"

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.

Library error: primary unit "package_name" denoted by prefix "library_name" must exist in the library

  1. Check to make sure that you spelled the package name correctly
  2. If it is spelled correctly, check to see if the directory that you specified for library_name is also in your User Libraries (See Part A above).
  3. If both the User Libraries and the VHDL Project Libraries are set up correctly, try recompiling the package itself, then recompile the project that gave you the error message.

Unknown problem in directory/current_project.vhd (%DLS-E-CantOpenUsed, For unit dls_library1:package1.VHDLView; can't open used unit dls_library2:package2.VHDLView.)

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.

Unknown problem in directory/current_project.vhd (%DLS-E-UnitOutOfDate, Unit dls_library1.package1.VHDLView is out of date; uses superseded unit dls_library2:package2.VHDLView.)

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.


Last update: 1998 Oct 29
Send any questions or comments to Sydney Tang at sat@ee.ualberta.ca.
group: Sydney Tang, Su-tarn Lim, Chen-song Qin