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.

For Windows only: Run a preliminary invocation of vsim (CR-373)<br />

Because of limitations with the linker/loader provided on Windows, an step is required.<br />

You must create the exported task/function compiled object file (exportobj.o) by running<br />

a preliminary vsim comm<strong>and</strong>, such as:<br />

vsim -dpiexportobj exportobj.o<br />

2 Include the dpiheader.h file in your C code.<br />

<strong>ModelSim</strong> recommends that any user DPI C code that accesses exported tasks/functions,<br />

or defines imported tasks/functions, will include the dpiheader.h file. This allows the C<br />

compiler to verify the interface between C <strong>and</strong> <strong>ModelSim</strong>.<br />

3 Compile the C code into a shared object.<br />

Compile your code, providing any .a or other .o files required.<br />

For Windows: In this step, the object file is bound into the .dll that you created using the<br />

-dpiexportobj argument.<br />

4 Simulate the design.<br />

When simulating, specify the name of the imported DPI C shared object (according to<br />

the SystemVerilog LRM).<br />

DPI use flow UM-567<br />

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

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

Saved successfully!

Ooh no, something went wrong!