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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Library usage<br />

Compiling Verilog files UM-117<br />

All modules <strong>and</strong> UDPs in a Verilog design must be compiled into one or more libraries.<br />

One library is usually sufficient for a simple design, but you may want to organize your<br />

modules into various libraries for a complex design. If your design uses different modules<br />

having the same name, then you are required to put those modules in different libraries<br />

because design unit names must be unique within a library.<br />

The following is an example of how you may organize your ASIC cells into one library <strong>and</strong><br />

the rest of your design into another:<br />

% vlib work<br />

% vlib asiclib<br />

% vlog -work asiclib <strong>and</strong>2.v or2.v<br />

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

-- Compiling module or2<br />

Top level modules:<br />

<strong>and</strong>2<br />

or2<br />

% vlog top.v<br />

-- Compiling module top<br />

Top level modules:<br />

top<br />

Note that the first compilation uses the -work asiclib argument to instruct the compiler to<br />

place the results in the asiclib library rather than the default work library.<br />

Library search rules<br />

Since instantiation bindings are not determined at compile time, you must instruct the<br />

simulator to search your libraries when loading the design. The top-level modules are<br />

loaded from the library named work unless you prefix the modules with the .<br />

option. All other Verilog instantiations are resolved in the following order:<br />

Search libraries specified with -Lf arguments in the order they appear on the comm<strong>and</strong><br />

line.<br />

Search the library specified in the "Verilog-XL `uselib compiler directive" (UM-120).<br />

Search libraries specified with -L arguments in the order they appear on the comm<strong>and</strong><br />

line.<br />

Search the work library.<br />

Search the library explicitly named in the special escaped identifier instance name.<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!