24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compiling VHDL files<br />

Creating a design library<br />

Compiling VHDL files UM-73<br />

Before you can compile your source files, you must create a library in which to store the<br />

compilation results. Use vlib (CR-356) to create a new library. For example:<br />

vlib work<br />

Invoking the VHDL compiler<br />

Dependency checking<br />

This creates a library named work. By default, compilation results are stored in the work<br />

library.<br />

The work library is actually a subdirectory named work. This subdirectory contains a<br />

special file named _info. Do not create libraries using UNIX, MS Windows, or DOS<br />

comm<strong>and</strong>s – always use the vlib comm<strong>and</strong> (CR-356).<br />

See "Design libraries" (UM-57) for additional information on working with libraries.<br />

<strong>ModelSim</strong> compiles one or more VHDL design units with a single invocation of vcom (CR-<br />

311), the VHDL compiler. The design units are compiled in the order that they appear on<br />

the comm<strong>and</strong> line. For VHDL, the order of compilation is important – you must compile<br />

any entities or configurations before an architecture that references them.<br />

You can simulate a design containing units written with 1076 -1987, 1076 -1993, <strong>and</strong><br />

1076-2002 versions of VHDL. To do so you will need to compile units from each VHDL<br />

version separately. The vcom (CR-311) comm<strong>and</strong> compiles using 1076 -2002 rules by<br />

default; use the -87 or -93 argument to vcom (CR-311) to compile units written with version<br />

1076-1987 or 1076 -1993, respectively. You can also change the default by modifying the<br />

VHDL93 variable in the modelsim.ini file (see "Preference variables located in INI files"<br />

(UM-524) for more information).<br />

Dependent design units must be reanalyzed when the design units they depend on are<br />

changed in the library. vcom (CR-311) determines whether or not the compilation results<br />

have changed. For example, if you keep an entity <strong>and</strong> its architectures in the same source<br />

file <strong>and</strong> you modify only an architecture <strong>and</strong> recompile the source file, the entity<br />

compilation results will remain unchanged <strong>and</strong> you will not have to recompile design units<br />

that depend on the entity.<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!