24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UM-580 D - Verilog PLI / VPI / DPI<br />

Specifying application files to load<br />

PLI/VPI file loading<br />

DPI file loading<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong><br />

PLI <strong>and</strong> VPI file loading is identical. DPI file loading uses switches to the vsim comm<strong>and</strong>.<br />

The PLI/VPI applications are specified as follows:<br />

As a list in the Veriuser entry in the modelsim.ini file:<br />

Veriuser = pliapp1.so pliapp2.so pliappn.so<br />

As a list in the PLIOBJS environment variable:<br />

% setenv PLIOBJS "pliapp1.so pliapp2.so pliappn.so"<br />

As a -pli argument to the simulator (multiple arguments are allowed):<br />

-pli pliapp1.so -pli pliapp2.so -pli pliappn.so<br />

Note: On Windows platforms, the file names shown above should end with .dll rather<br />

than .so.<br />

The various methods of specifying PLI/VPI applications can be used simultaneously. The<br />

libraries are loaded in the order listed above. Environment variable references can be used<br />

in the paths to the libraries in all cases.<br />

See also Appendix B - <strong>ModelSim</strong> variables for more information on the modelsim.ini file.<br />

DPI applications are specified to vsim (CR-373) using the following SystemVerilog<br />

arguments:<br />

-sv_lib specifies a library name to be searched <strong>and</strong> used. No filename<br />

extensions must be specified. (The extensions <strong>ModelSim</strong> expects are:<br />

.sl for HP, .dll for Win32, .so for all other platforms.)<br />

-sv_root specifies a new prefix for shared objects as specified by -sv_lib<br />

-sv_liblist specifies a “bootstrap file” to use<br />

When the simulator finds an imported task or function, it searches for the symbol in the<br />

collection of shared objects specified using these arguments.<br />

For example, you can specify the DPI application as follows:<br />

vsim -sv_lib dpiapp1 -sv_lib dpiapp2 -sv_lib dpiappn<br />

It is a mistake to specify DPI import tasks <strong>and</strong> functions (tf) inside PLI/VPI shared objects.<br />

However, a DPI import tf can make calls to PLI/VPI C code, providing that vsim -gblso<br />

was used to mark the PLI/VPI shared object with global symbol visibility. See "Loading<br />

shared objects with global symbol visibility" (UM-581).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!