User`s manual
Using the Verilog PLI
5-82 Verilog Simulation ModelSim Xilinx User’s Manual
{0} /* last entry must be 0 */
};
Alternatively, you can add an init_usertfs function to explicitly register each entry
from the array:
void init_usertfs()
{
p_tfcell usertf = veriusertfs;
while (usertf->type)
mti_RegisterUserTF(usertf++);
}
It is an error if the PLI application does not contain a veriusertfs array or an
init_usertfs function.
Since PLI applications are dynamically loaded by the simulator, you must specify
which applications to load (each application must be a dynamically loadable
library, see Compiling and linking PLI applications). The PLI applications are
specified as follows:
• As a list in the Veriuser entry in the modelsim.ini file:
Veriuser = pliapp1.so pliapp2.so pliappn.so
• As a list in the PLIOBJS environment variable:
% setenv PLIOBJS "pliapp1.so pliapp2.so pliappn.so"
• As a -pli option to the simulator (multiple options are allowed):
-pli pliapp1.so -pli pliapp2.so -pli pliappn.so
The various methods of specifying PLI applications may be used simultaneously.
Compiling and linking PLI applications
ModelSim Verilog uses operating system calls to dynamically load PLI
applications when the simulator loads a design. Therefore, the PLI application
must be compiled and linked for dynamic loading on a specific operating system.
The PLI routines are declared in the include files located in the ModelSim
<install_dir>/modeltech/include directory. The acc_user.h file declares the ACC
routines (defined in Section 19 of the IEEE Std 1364) and the veriuser.h file
declares the TF routines (defined in Section 21 of the IEEE Std 1364).
The following instructions assume that the PLI application is in a single source
file. For multiple source files, compile each file as specified in the instructions and
link all of the resulting object files together with the specified link instruction.