Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- Its a onetime process and easy too --- Quote End --- Ideally you would be able to treat the problem like C-code, where you can run a tool to find the dependencies, i.e., the ordering. I have not been able to find a tool that does this well. I've tried Modelsim's makefile generator, but it only creates a makefile *after* you have a project working. Its a tricky problem with VHDL, since; 1) If your component uses a package, the package needs to be compiled first. 2) If your package uses another package, eg., a utilities or types package, that utilities package has to be compiled first. 3) If you have have a component definition only, with no entity with the same name, and configurations are used to create instances of the component (i.e., you map a component with a different name onto the component definition), then creating a dependency tool would require a VHDL parser. The package-to-package dependency in (2) makes using a simple naming convention difficult, since utilities_pkg.vhd comes so late in the alphabet :) The best solution is simply to write a Tcl procedure that puts the source files in order. If you do use a naming convention, eg., _pkg.vhd for packages, you can search for all packages using Tcl glob, and then just pull out the one or two utility packages and compiled them first. For example ...
# 'control' library packages
set control_pkg
# The 'utilities_pkg' needs to come first in the
# compile order since other packages depend on it.
#
# Index of the utilities package in the list
set index
if {$index == -1} {
error "Error: the utilities package (utilities_pkg.vhd) is missing!"
}
# Create a new list
if {$index > 0} {
set control_pkg ]
end]
]
}
You can put this script in a common area, and set the path to it using the environment variable TCLLIBPATH (which works under both Linux and Windows for Quartus Tcl and Modelsim Tcl). Cheers, Dave