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.

UM-116 5 - Verilog simulation<br />

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

Note that the compiler lists each module as a top level module, although, ultimately, only<br />

top is a top-level module. If a module is not referenced by another module compiled in the<br />

same invocation of the compiler, then it is listed as a top level module. This is just an<br />

informative message <strong>and</strong> can be ignored during incremental compilation. The message is<br />

more useful when you compile an entire design in one invocation of the compiler <strong>and</strong> need<br />

to know the top-level module names for the simulator. For example,<br />

% vlog top.v <strong>and</strong>2.v or2.v<br />

-- Compiling module top<br />

-- Compiling module <strong>and</strong>2<br />

-- Compiling module or2<br />

Top level modules:<br />

top<br />

Automatic incremental compilation with -incr<br />

The most efficient method of incremental compilation is to manually compile only the<br />

modules that have changed. However, this is not always convenient, especially if your<br />

source files have compiler directive interdependencies (such as macros). In this case, you<br />

may prefer to compile your entire design along with the -incr argument. This causes the<br />

compiler to automatically determine which modules have changed <strong>and</strong> generate code only<br />

for those modules.<br />

The following is an example of how to compile a design with automatic incremental<br />

compilation:<br />

% vlog -incr top.v <strong>and</strong>2.v or2.v<br />

-- Compiling module top<br />

-- Compiling module <strong>and</strong>2<br />

-- Compiling module or2<br />

Top level modules:<br />

top<br />

Now, suppose that you modify the functionality of the or2 module:<br />

% vlog -incr top.v <strong>and</strong>2.v or2.v<br />

-- Skipping module top<br />

-- Skipping module <strong>and</strong>2<br />

-- Compiling module or2<br />

Top level modules:<br />

top<br />

The compiler informs you that it skipped the modules top <strong>and</strong> <strong>and</strong>2, <strong>and</strong> compiled or2.<br />

Automatic incremental compilation is intelligent about when to compile a module. For<br />

example, changing a comment in your source code does not result in a recompile; however,<br />

changing the compiler comm<strong>and</strong> line arguments results in a recompile of all modules.<br />

Note: Changes to your source code that do not change functionality but that do affect<br />

source code line numbers (such as adding a comment line) will cause all affected<br />

modules to be recompiled. This happens because debug information must be kept current<br />

so that <strong>ModelSim</strong> can trace back to the correct areas of the source code.

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

Saved successfully!

Ooh no, something went wrong!