Technical data

Referencing source files with location maps
540
-
Tips and Techniques ModelSim EE/PLUS Reference Manual
Use these two steps to map your files:
1
Set the environment variable MGC_LOCATION_MAP to the path to your location
map file.
2
Specify the mappings from physical pathnames to logical pathnames:
$SRC
/home/vhdl/src
/usr/vhdl/src
$IEEE
/usr/modeltech/ieee
Pathname syntax
The logical pathnames must begin with $ and the physical pathnames must begin
with /. The logical pathname is followed by one or more equivalent physical
pathnames. Physical pathnames are equivalent if they refer to the same physical
directory (they just have different pathnames on different systems).
How location mappin
g
works
When a pathname is stored, an attempt is made to map the physical pathname to
a path relative to a logical pathname. This is done by searching the location map
file for the first physical pathname that is a prefix to the pathname in question. The
logical pathname is then substituted for the prefix. For example, "/usr/vhdl/src/
test.vhd" is mapped to "$SRC/test.vhd". If a mapping can be made to a logical
pathname, then this is the pathname that is saved. The path to a source file entry
for a design unit in a library is a good example of a typical mapping.
For mapping from a logical pathname back to the physical pathname, Model
Sim
expects an environment variable to be set for each logical pathname (with the
same name). Model
Sim
reads the location map file when a tool is invoked. If the
environment variables corresponding to logical pathnames have not been set in
your shell, Model
Sim
sets the variables to the first physical pathname following
the logical pathname in the location map. For example, if you don't set the SRC
environment variable, VSIM will automatically set it to "/home/vhdl/src".
Mappin
g
with Tcl variables
Two Tcl variables may also be used to specify alternative source-file paths; see,
SourceDir (p254), and SourceMap (p254).