Specifying the resource libraries. Model Technology Special EE/SE, Elite EE/SE
광고
광고
Specifying the resource libraries
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
vdel
command
(CR-175)
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
vdel
-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,
.
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.
2-40
Design Libraries ModelSim EE/SE User’s Manual
Specifying the resource libraries
Alternate IEEE libraries supplied
The installation directory may contain two or more versions of the IEEE library:
• ieeepure
Contains only IEEE approved std_logic_1164 packages (accelerated for
VSIM).
• ieee
Contains precompiled Synopsys and IEEE arithmetic packages for the std_logic base type, which have been accelerated by Model Technology.
You can select which library to use by changing the mapping in the modelsim.ini file. The modelsim.ini file in the installation directory defaults to the ieee library.
Rebuilding supplied libraries
Resource libraries are supplied precompiled in the modeltech installation directory. If you need to rebuild these libraries, the sources are provided in the
vhdl_src directory; a macro file is also provided for Windows platforms
(rebldlibs.do). To rebuild the libraries, invoke the DO file from within ModelSim with this command: do rebldlibs.do
(Make sure your current directory is the modeltech install directory before you run this file.)
Shell scripts are provided for UNIX (rebuild_libs.csh and rebuild_libs.sh). To rebuild the libraries, execute one of the rebuild_libs scripts while in the modeltech directory.
Note:
Because accelerated subprograms require attributes that are available only under the 1993 standard, many of the libraries are built using
vdel
(CR-175)
with the -93 option.
Regenerating your design libraries
Depending on your current ModelSim version, you may need to regenerate your design libraries before running a simulation. Check the installation README file to see if your libraries require an update. You can easily regenerate your design libraries with -refresh. You must use
vcom
(CR-169)
with the -refresh option to update the VHDL design units in a library, and
vlog
(CR-199)
with the -refresh option to update Verilog design units. By default, the work library is updated; use
ModelSim EE/SE User’s Manual Design Libraries
2-41
Specifying the resource libraries
-work <library> to update a different library. For example, if you have a library named mylib that contains both VHDL and Verilog design units: vcom -work mylib -refresh vlog -work mylib -refresh
An important feature of -refresh is that it rebuilds the library image without using source code. This means that models delivered as compiled libraries without source code can be rebuilt for a specific release of ModelSim (4.6 and later only).
In general, this works for moving forwards or backwards on a release. Moving backwards on a release may not work if the models used compiler switches or directives (Verilog only) that do not exist in the older release.
Note:
As in the example above, you will need to use vcom for VHDL and vlog for Verilog design units.
Also, you don’t need to regenerate the std, ieee, vital22b, and verilog libraries. Also, you cannot use the
-refresh option to update libraries that were built before the 4.6 release.
Verilog resource libraries
ModelSim supports and encourages separate compilation of distinct portions of a
Verilog design. The vlog
(CR-199)
compiler is used to compile one or more source files into a specified library. The library thus contains pre-compiled modules and
UDPs (and, perhaps, VHDL design units) that are drawn from by the simulator as it loads the design. See
2-42
Design Libraries ModelSim EE/SE User’s Manual
3 -
Projects and system initialization
Chapter contents
. . . . . . . . . . . . . . . . . . . 44
A new file extension . . . . . . . . . . . . . . . . . . . 44
INI and MPF file comparison . . . . . . . . . . . . . . . . 44
The [Project] section in the .mpf file . . . . . . . . . . . . . . 45
Project operations . . . . . . . . . . . . . . . . . . . 45
Creating a Project . . . . . . . . . . . . . . . . . . . 46
Working with a Project . . . . . . . . . . . . . . . . . . 49
Open a project . . . . . . . . . . . . . . . . . . . 49
Compile a project . . . . . . . . . . . . . . . . . . 49
Simulating a project . . . . . . . . . . . . . . . . . . 49
Modifying a project . . . . . . . . . . . . . . . . . . 49
The project command . . . . . . . . . . . . . . . . . 50
This chapter provides a definition of a ModelSim "project" and discusses the use of a new file extension for project files.
With the 5.3 release, ModelSim incorporates the file extension .mpf to denote project files. In past releases the modelsim.ini file (the system initialization file) was used as the project file.
Note:
If you are looking for information on project file variables, please see Appendix B - ModelSim
ModelSim EE/SE User’s Manual Projects and system initialization
3-43
다운로드
광고