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.

UM-120 5 - Verilog simulation<br />

Verilog-XL `uselib compiler directive<br />

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

The `uselib compiler directive is an alternative source library management scheme to the<br />

-v, -y, <strong>and</strong> +libext compiler arguments. It has the advantage that a design may reference<br />

different modules having the same name. You compile designs that contain `uselib<br />

directive statements using the -compile_uselibs argument (described below) to vlog (CR-<br />

358).<br />

The syntax for the `uselib directive is:<br />

`uselib ...<br />

where is:<br />

dir= | file= | libext= |<br />

lib=<br />

The library references are equivalent to comm<strong>and</strong> line arguments as follows:<br />

dir= -y <br />

file= -v <br />

libext= +libext+<br />

For example, the following directive<br />

`uselib dir=/h/vendorA libext=.v<br />

is equivalent to the following comm<strong>and</strong> line arguments:<br />

-y /h/vendorA +libext+.v<br />

Since the `uselib directives are embedded in the Verilog source code, there is more<br />

flexibility in defining the source libraries for the instantiations in the design. The<br />

appearance of a `uselib directive in the source code explicitly defines how instantiations<br />

that follow it are resolved, completely overriding any previous `uselib directives.<br />

-compile_uselibs argument<br />

Use the -compile_uselibs argument to vlog (CR-358) to reference `uselib directives. The<br />

argument finds the source files referenced in the directive, compiles them into<br />

automatically created object libraries, <strong>and</strong> updates the modelsim.ini file with the logical<br />

mappings to the libraries.<br />

When using -compile_uselibs, <strong>ModelSim</strong> determines into which directory to compile the<br />

object libraries by choosing, in order, from the following three values:<br />

The directory name specified by the -compile_uselibs argument. For example,<br />

-compile_uselibs=./mydir<br />

The directory specified by the MTI_U<strong>SE</strong>LIB_DIR environment variable (see<br />

"Environment variables" (UM-521))<br />

A directory named mti_uselibs that is created in the current working directory

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

Saved successfully!

Ooh no, something went wrong!