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-570 D - Verilog PLI / VPI / DPI<br />

64-bit Linux for IA64 platform<br />

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

ld -shared -E -Bsymbolic -o app.so app.o -lc<br />

When using -Bsymbolic with ld, all symbols are first resolved within the shared library at<br />

link time. This will result in a list of undefined symbols. This is only a warning for shared<br />

libraries <strong>and</strong> can be ignored. If you are using <strong>ModelSim</strong> RedHat version 6.0 through 7.1,<br />

you also need to add the -noinhibit-exec switch when you specify -Bsymbolic.<br />

The compiler switch -freg-struct-return must be used when compiling any FLI application<br />

code that contains foreign functions that return real or time values.<br />

64-bit Linux is supported on RedHat Linux Advanced Workstation 2.1 for Itanium 2.<br />

gcc compiler (gcc 3.2 or later)<br />

gcc -c -fPIC -I//modeltech/include app.c<br />

ld -shared -Bsymbolic -E --allow-shlib-undefined -o app.so app.o<br />

If your PLI/VPI/DPI application requires a user or vendor-supplied C library, or an<br />

additional system library, you will need to specify that library when you link your PLI/VPI/<br />

DPI application. For example, to use the system math library libm, specify -lm to the ld<br />

comm<strong>and</strong>:<br />

gcc -c -fPIC -I//modeltech/include math_app.c<br />

ld -shared -Bsymbolic -E --allow-shlib-undefined -o math_app.so math_app.o -lm<br />

64-bit Linux for Opteron <strong>and</strong> Athlon 64 platforms<br />

32-bit Solaris platform<br />

64-bit Linux is supported on RedHat Linux EWS 3.0 for Opteron <strong>and</strong> Athlon 64.<br />

gcc compiler (gcc 3.2 or later)<br />

gcc -m64 -c -fPIC -I//modeltech/include app.c<br />

ld -m elf_x86_64 -shared -Bsymbolic -E --allow-shlib-undefined -o app.so \<br />

app.o<br />

The -m64 <strong>and</strong> -m elf_x86_64 switches are required to compile for 64-bit operation. To<br />

compile for 32-bit operation, use the -m32 argument instead of -m64 at the gcc comm<strong>and</strong><br />

line. These arguments for 32-bit or 64-bit operation are required only if the desired<br />

operation differs from the default gcc settings.<br />

If your PLI/VPI/DPI application requires a user or vendor-supplied C library, or an<br />

additional system library, you will need to specify that library when you link your PLI/VPI/<br />

DPI application. For example, to use the system math library libm, specify -lm to the ld<br />

comm<strong>and</strong>:<br />

gcc -m64 -c -fPIC -I//modeltech/include math_app.c<br />

ld -m elf_x86_64 -shared -Bsymbolic -E --allow-shlib-undefined \<br />

-o math_app.so math_app.o -lm<br />

If your PLI/VPI/DPI application uses anything from a system library, you will need to<br />

specify that library when you link your PLI/VPI/DPI application. For example, to use the<br />

st<strong>and</strong>ard C library, specify ‘-lc’ to the ‘ld’ comm<strong>and</strong>.

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

Saved successfully!

Ooh no, something went wrong!