Technical data
Compiling and linking FLI and PLI applications
452
-
VHDL Foreign Language Interface and Verilog PLI ModelSim EE/PLUS Reference Manual
All of the PLI routines described in the IEEE Std 1364-1995 are implemented
(except the vpi_* routines). The corresponding
veriuser.h
and
acc_user.h
include
files are located in the Model
Sim
<install_dir>/include
directory. A complete list
of routines supported is listed in installed text files, see
<install_dir>/modeltech/
docs/technotes.
Note:
The Tcl C interface is included in the FLI; you’ll find
tcl.h
in the
<install_dir>/modeltech/include
directory. Tk and Tix are not included in the FLI because the FLI is in the kernel, not the user interface. You
can FTP Tcl from: http://www.scriptics.com.
Compiling and linking FLI and PLI applications
PLI application requirements
PLI applications are dynamically linked to VSIM's PLI routines. A PLI
application must supply a dynamically loadable object with an entry point named
init_usertfs. This function must call mti_RegisterUserTF for each entry in the
table of user tasks and functions.
PLI applications that use the TF routines should include the
veriuser.h
file.
Here’s an example of a C file to be compiled for the PLI:
------------------app.c-------------------
#include "veriuser.h"
static int hello()
{
io_printf("Hi there\n");
}
static s_tfcell veriusertfs[] = {
{usertask, 0, 0, 0, hello, 0, "$hello", 0},{0}
};
void init_usertfs()
{
p_tfcell usertf;
for (usertf = veriusertfs; usertf; usertf++) {
if (usertf->type == 0)
return;
mti_RegisterUserTF(usertf);
}
}