User`s manual
Compilation
ModelSim Xilinx User’s Manual Verilog Simulation 5-59
Top level modules:
and2
or2
% vlog top.v
-- Compiling module top
Top level modules:
top
Note that the first compilation uses the -work asiclib option to instruct the
compiler to place the results in the asiclib library rather than the default work
library.
Since instantiation bindings are not determined at compile time, you must instruct
the simulator to search your libraries when loading the design. The top level
modules are loaded from the library named work unless you specify an alternate
library with the -lib option. All other Verilog instantiations are resolved in the
following order:
• Search libraries specified with -Lf options in the order they appear on the
command line.
• Search the library specified in "Verilog-XL `uselib compiler directive"
(5-63).
• Search libraries specified with -L options in the order they appear on the
command line.
• Search the work library.
• Search the library explicitly named in the special escaped identifier instance
name.
It is important to recognize that the work library is not necessarily a library named
work - the work library refers to the library containing the module that
instantiates the module or UDP that is currently being searched for. This definition
is useful if you have hierarchical modules organized into separate libraries and if
sub-module names overlap among the libraries. In this situation you want the
modules to search for their sub-modules in the work library first. This is
accomplished by specifying -L work first in the list of search libraries.
For example, assume you have a top level module "top" that instantiates module
"modA" from library "libA" and module "modB" from library "libB".
Furthermore, "modA" and "modB" both instantiate modules named "cellA", but
the definition of "cellA" compiled into "libA" is different from that compiled into
"libB". In this case, it is insufficient to just specify "-L libA - LlibB" as the search
libraries because instantiations of "cellA" from "modB" resolve to the "libA"
version of "cellA". The appropriate search library options are "-L work -L libA
-L libB".