Contents
Up
Previous
Next


Compiling Programs


You must first enter your VHDL design with a text editor of your choice. You can run the compiler by typing

vhdl [options] vhdl_file [output_file]

The items in square brackets are optional. Valid options are -l,-L, and -O. If, during compilation, the compiler reports a mark table overflow then using the -l option will make more room for that table. The -L option is used to specify the directories you would like the compiler to search when looking for source and object files. The directories should immediately follow the -L with no spaces and be separated by semicolons (ex. -L\gmvhdl\lib;\myvhdl). The -O option can be used to add the resulting object file to the library file that follows the -O with no spaces (ex. -Owork.lib). This is the equivalent of adding the object file to the named library using vlib (vlib is described in the Modules section of the Learing more chapter.

The file with the name vhdl_file will be compiled into a library (or object) file. If the optional output file name is not present, the compiler will produce an object file with the same name as the VHDL file only with a .o extension. If the output file name is present, the compiler will produce an object file with the name output_file.

If a design file references entities from any other design file (i.e. with the VHDL libarary statement), they must be compiled before compiling the design that refers to them. If you attempt to compile a design with uncompiled references then the compiler will report an error.

In order to compile a particular entity for execution, you must now use the linker to link your program. You may run the linker as

link [options] output_file library_file entity [architecture]

Valid options are -l and -L. If, during linking, the linker reports a mark table overflow then using the -l option will make more room for that table. The -L option is used to specify the directories you would like the linker to search when looking for object files. The directories should immediately follow the -L with no spaces and be separated by semicolons (ex. -L\gmvhdl\lib;\myvhdl).

The output_file is the name of the executable program that the linker will create. library_name is the name of the library that contains the entity you wish to compile. The entity is the name of the entity you wish to compile. If architecture is included, it should be the name of the architecture to compile for the named entity. If the architecture part is not included, the last architecture compiled for that entity will be used.

If you re-compile a design file that is referenced in another design file, the design that refers to it must also be re-compiled. If you do not do this, the linker will report an error when you try to link the program.

Now you may execute the program with either of the loaders sv or sve. The next chapter gives details on how to use the two loaders.