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-122 5 - Verilog simulation<br />

Verilog configurations<br />

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

The Verilog 2001 specification added configurations. Configurations specify how a design<br />

is "assembled" during the elaboration phase of simulation. Configurations actually consist<br />

of two pieces: the library mapping <strong>and</strong> the configuration itself. The library mapping is used<br />

at compile time to determine into which libraries the source files are to be compiled. Here<br />

is an example of a simple library map file:<br />

library work ../top.v;<br />

library rtlLib lrm_ex_top.v;<br />

library gateLib lrm_ex_adder.vg;<br />

library aLib lrm_ex_adder.v;<br />

Here is an example of a library map file that uses -incdir:<br />

library lib1 src_dir/*.v -incdir ../include_dir2, ../, my_incdir;<br />

The name of the library map file is arbitrary. You specify the library map file using the<br />

-libmap argument to the vlog comm<strong>and</strong> (CR-358). Alternatively, you can specify the file<br />

name as the first item on the vlog comm<strong>and</strong> line, <strong>and</strong> the compiler will read it as a library<br />

map file.<br />

The library map file must be compiled along with the Verilog source files. Multiple map<br />

files are allowed but each must be preceded by the -libmap argument.<br />

The library map file <strong>and</strong> the configuration can exist in the same or different files. If they<br />

are separate, only the map file needs the -libmap argument. The configuration is treated as<br />

any other Verilog source file.<br />

Configurations <strong>and</strong> the library named “work”<br />

The library named “work” is treated specially by <strong>ModelSim</strong> (see "The library named<br />

"work"" (UM-58) for details) for Verilog configurations. Consider the following code<br />

example:<br />

config cfg;<br />

design top;<br />

instance top.u1 use work.u1;<br />

endconfig<br />

In this case, work.u1 indicates to load u1 from the current library.

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

Saved successfully!

Ooh no, something went wrong!