Download ModelSim SE User`s Manual - Electrical and Computer Engineering

Transcript
Compiling VHDL files UM-75
Differences between language versions
There are three versions of the IEEE VHDL 1076 standard: VHDL-1987, VHDL-1993, and
VHDL-2002. The default language version for ModelSim is VHDL-2002. If your code was
written according to the ’87 or ’93 version, you may need to update your code or instruct
ModelSim to use the earlier versions’ rules.
To select a specific language version, do one of the following:
• Select the appropriate version from the compiler options menu in the GUI
• Invoke vcom (CR-311) using the argument -87, -93, or -2002
• Set the VHDL93 variable in the [vcom] section of the modelsim.ini file. Appropriate
values for VHDL93 are:
- 0, 87, or 1987 for VHDL-1987
- 1, 93, or 1993 for VHDL-1993
- 2, 02, or 2002 for VHDL-2002
The following is a list of language incompatibilities that may cause problems when
compiling a design.
• The only major problem between VHDL-93 and VHDL-2002 is the addition of the
keyword "PROTECTED". VHDL-93 programs which use this as an identifier should
choose a different name.
All other incompatibilities are between VHDL-87 and VHDL-93.
• VITAL and SDF
It is important to use the correct language version for VITAL. VITAL2000 must be
compiled with VHDL-93 or VHDL-2002. VITAL95 must be compiled with VHDL-87.
A typical error message that indicates the need to compile under language version
VHDL-87 is:
"VITALPathDelay DefaultDelay parameter must be locally static"
• Purity of NOW
In VHDL-93 the function "now" is impure. Consequently, any function that invokes
"now" must also be declared to be impure. Such calls to "now" occur in VITAL. A typical
error message:
"Cannot call impure function 'now' from inside pure function '<name>'"
• Files
File syntax and usage changed between VHDL-87 and VHDL-93. In many cases vcom
issues a warning and continues:
"Using 1076-1987 syntax for file declaration."
In addition, when files are passed as parameters, the following warning message is
produced:
"Subprogram parameter name is declared using VHDL 1987 syntax."
This message often involves calls to endfile(<name>) where <name> is a file parameter.
ModelSim SE User’s Manual