User`s manual
Specifying the resource libraries
2-32 Design Libraries ModelSim Xilinx User’s Manual
Specifying the resource libraries
VHDL resource libraries
Within a VHDL source file, you can use the VHDL library clause to specify
logical names of one or more resource libraries to be referenced in the subsequent
design unit. The scope of a library clause includes the text region that starts
immediately after the library clause and extends to the end of the declarative
region of the associated design unit. It does not extend to the next design unit in
the file.
Note that the library clause is not used to specify the working library into which
the design unit is placed after compilation; the vcom
(CR-106) adds compiled
design units to the current working library. By default, this is the library named
work. To change the current working library, you can use vcom -work and
specify the name of the desired target library.
Predefined libraries
Certain resource libraries are predefined in standard VHDL. The library named
std contains the packages standard and textio, which should not be modified. The
contents of these packages and other aspects of the predefined language
environment are documented in the IEEE Standard VHDL Language Reference
Manual, Std 1076-1987 and ANSI/IEEE Std 1076-1993. See also, "Using the
TextIO package"
(4-47).
A VHDL use clause can be used to select specific declarations in a library or
package that are to be visible within a design unit during compilation. A use
clause references the compiled version of the package—not the source.
By default, every design unit is assumed to contain the following declarations:
LIBRARY std, work;
USE std.standard.all
To specify that all declarations in a library or package can be referenced, you can
add the suffix .all to the library/package name. For example, the use clause above
specifies that all declarations in the package standard in the design library named
std are to be visible to the VHDL design file in which the use clause is placed.
Other libraries or packages are not visible unless they are explicitly specified
using a library or use clause.
Another predefined library is work, the library where a design unit is stored after
it is compiled as described earlier. There is no limit to the number of libraries that
can be referenced, but only one library is modified during compilation.