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.

Library mapping with environment variables<br />

Environment variables UM-523<br />

Once the MY_PATH variable is set, you can use it with the vmap comm<strong>and</strong> (CR-370) to<br />

add library mappings to the current modelsim.ini file.<br />

If you’re using the vmap comm<strong>and</strong> from a DOS prompt type:<br />

vmap MY_VITAL %MY_PATH%<br />

If you’re using vmap from the <strong>ModelSim</strong>/VSIM prompt type:<br />

vmap MY_VITAL \$MY_PATH<br />

If you used DOS vmap, this line will be added to the modelsim.ini:<br />

MY_VITAL = c:\temp\work<br />

If vmap is used from the <strong>ModelSim</strong>/VSIM prompt, the modelsim.ini file will be modified<br />

with this line:<br />

MY_VITAL = $MY_PATH<br />

You can easily add additional hierarchy to the path. For example,<br />

vmap MORE_VITAL %MY_PATH%\more_path\<strong>and</strong>_more_path<br />

vmap MORE_VITAL \$MY_PATH\more_path\<strong>and</strong>_more_path<br />

The "$" character in the examples above is Tcl syntax that precedes a variable. The "\"<br />

character is an escape character that keeps the variable from being evaluated during the<br />

execution of vmap.<br />

Referencing environment variables within <strong>ModelSim</strong><br />

There are two ways to reference environment variables within <strong>ModelSim</strong>. Environment<br />

variables are allowed in a FILE variable being opened in VHDL. For example,<br />

use std.textio.all;<br />

entity test is end;<br />

architecture only of test is<br />

begin<br />

process<br />

FILE in_file : text is in "$ENV_VAR_NAME";<br />

begin<br />

wait;<br />

end process;<br />

end;<br />

Environment variables may also be referenced from the <strong>ModelSim</strong> comm<strong>and</strong> line or in<br />

macros using the Tcl env array mechanism:<br />

echo "$env(ENV_VAR_NAME)"<br />

Removing temp files (VSOUT)<br />

Note: Environment variable expansion does not occur in files that are referenced via the<br />

-f argument to vcom, vlog, or vsim.<br />

The VSOUT temp file is the communication mechanism between the simulator kernel <strong>and</strong><br />

the <strong>ModelSim</strong> GUI. In normal circumstances the file is deleted when the simulator exits. If<br />

<strong>ModelSim</strong> crashes, however, the temp file must be deleted manually. Specifying the<br />

location of the temp file with TMPDIR (above) will help you locate <strong>and</strong> remove the file.<br />

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

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

Saved successfully!

Ooh no, something went wrong!