Technical data

Compiling and linking FLI and PLI applications
ModelSim EE/PLUS Reference Manual VHDL Foreign Language Interface and Verilog PLI
-
453
The following platform-specific instructions show you how to compile and link
your FLI and PLI application so it can be loaded by VSIM. In most cases
gcc
and
cc
compiler instructions are shown.
Windows NT/95/98 linkin
g
Under Windows NT/95/98 VSIM loads a 32-bit dynamically linked library for
each FLI or PLI application. The following compile and link steps are used to
create the necessary .dll (and other supporting files) file using the Microsoft
Visual C/C++ compiler.
cl -c -I<install_dir>\modeltech\include app.c
link -dll -export:<C_init_function> app.obj \
<install_dir>\modeltech\win32\mtipli.lib
Where <C_init_function> is either init_usertfs (for PLI) or app_init (for FLI).
Note:
The FLI/PLI interface has been tested with DLLs built using Microsoft Visual C/C++ compiler
version 4.1 or greater.
SunOS 4 linkin
g
VSIM loads shared objects. For example for SunOS 4:
cc -c -I/<install_dir>/modeltech/include app.c
ld -o app.so app.o
Solaris linkin
g
VSIM loads shared objects. Use these
gcc
or
cc
compiler commands for Solaris:
gcc compiler:
gcc -c -I/<install_dir>/modeltech/include app.c
ld -G -o app.so app.o
cc compiler:
cc -c -I/<install_dir>/modeltech/include app.c
ld -G -o app.so app.o
If
app.so
is in your current directory you must force Solaris to search the directory.
There are two ways you can do this:
• Add “
. /
“ before
app.so
in the attribute specification, or
• Load the path as a UNIX shell environment variable: LD_LIBRARY_PATH=
<library path without filename>