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-64 3 - Design libraries<br />

Specifying the resource libraries<br />

Verilog resource libraries<br />

VHDL resource libraries<br />

Predefined libraries<br />

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

<strong>ModelSim</strong> supports separate compilation of distinct portions of a Verilog design. The vlog<br />

(CR-358) compiler is used to compile one or more source files into a specified library. The<br />

library thus contains pre-compiled modules <strong>and</strong> UDPs that are referenced by the simulator<br />

as it loads the design.<br />

Important: Resource libraries are specified differently for Verilog <strong>and</strong> VHDL. For<br />

Verilog you use either the -L or -Lf argument to vlog (CR-358). See "Library usage" (UM-<br />

117) for more information.<br />

Within a VHDL source file, you use the VHDL library clause to specify logical names of<br />

one or more resource libraries to be referenced in the subsequent design unit. The scope of<br />

a library clause includes the text region that starts immediately after the library clause <strong>and</strong><br />

extends to the end of the declarative region of the associated design unit. It does not extend<br />

to the next design unit in the file.<br />

Note that the library clause is not used to specify the working library into which the design<br />

unit is placed after compilation. The vcom comm<strong>and</strong> (CR-311) adds compiled design units<br />

to the current working library. By default, this is the library named work. To change the<br />

current working library, you can use vcom -work <strong>and</strong> specify the name of the desired target<br />

library.<br />

Certain resource libraries are predefined in st<strong>and</strong>ard VHDL. The library named std<br />

contains the packages st<strong>and</strong>ard <strong>and</strong> textio, which should not be modified. The contents of<br />

these packages <strong>and</strong> other aspects of the predefined language environment are documented<br />

in the IEEE St<strong>and</strong>ard VHDL Language Reference <strong>Manual</strong>, Std 1076. See also, "Using the<br />

TextIO package" (UM-88).<br />

A VHDL use clause can be specified to select particular declarations in a library or package<br />

that are to be visible within a design unit during compilation. A use clause references the<br />

compiled version of the package—not the source.<br />

By default, every VHDL design unit is assumed to contain the following declarations:<br />

LIBRARY std, work;<br />

U<strong>SE</strong> std.st<strong>and</strong>ard.all<br />

To specify that all declarations in a library or package can be referenced, add the suffix .all<br />

to the library/package name. For example, the use clause above specifies that all<br />

declarations in the package st<strong>and</strong>ard, in the design library named std, are to be visible to<br />

the VHDL design unit immediately following the use clause. Other libraries or packages<br />

are not visible unless they are explicitly specified using a library or use clause.<br />

Another predefined library is work, the library where a design unit is stored after it is<br />

compiled as described earlier. There is no limit to the number of libraries that can be<br />

referenced, but only one library is modified during compilation.

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

Saved successfully!

Ooh no, something went wrong!