Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Questa Sim on Windows - linking to external LIB

AlexBarry
Novice
3,048 Views

I have been trying to use Questa (from Quartus Lite 21.1) on Windows to link to the Winsock2 library, without success.  I have a minimal test case attached.  I can't get it to load into the simulator.  I compile with the command:

  vlog -sv -dpiheader dpiheader.h test.v test.c

That succeeds.  Then, I try to start the simulator using the command:

  vsim -c DPI_test

That fails with an error:

# ** Fatal: (vsim-3828) Could not link 'vsim_auto_compile.dll': cmd = 'D:/intelFPGA_lite/21.1/questa_fse\gcc-7.4.0-mingw64vc15\bin\g++.exe -shared -o "C:/Users/barralem/AppData/Local/Temp\barralem@BHI4TNR6H2_dpi_32868\win64_gcc-7.4.0\vsim_auto_compile.dll" C:/work/embedded/test/work\_dpi\auto_compile@\win64_gcc-7.4.0\test.o -Wl,-Bsymbolic -L"D:/intelFPGA_lite/21.1/questa_fse/win64" -lmtipli'
# (vsim-50) A call to system(D:/intelFPGA_lite/21.1/questa_fse\gcc-7.4.0-mingw64vc15\bin\g++.exe -shared -o "C:/Users/barralem/AppData/Local/Temp\barralem@BHI4TNR6H2_dpi_32868\win64_gcc-7.4.0\vsim_auto_compile.dll" C:/work/embedded/test/work\_dpi\auto_compile@\win64_gcc-7.4.0\test.o -Wl,-Bsymbolic -L"D:/intelFPGA_lite/21.1/questa_fse/win64" -lmtipli) returned error code '1'.
# No such file or directory. (errno = ENOENT)
#

I have tried removing the "#pragma comment(lib, "ws2_32.lib")" line, with no change.  I have also tried specifying the library on the command line with -sclib.  I have tried copying the LIB to the project directory, with no help.

0 Kudos
1 Solution
AlexBarry
Novice
3,013 Views

I believe we have figured it out.  We needed to add the -64 parameter, and -ldflags to pass parameters to gcc.  This appears to work:

    vsim -c DPI_test -ldflags "-lws2_32" -64

View solution in original post

0 Kudos
3 Replies
ShengN_Intel
Employee
3,029 Views

Seems like some compatibility issue there. Winsock library is 32-bit version but questa gcc is 64-bit version. Try to use modelsim instead of questa in order to match bit version.

0 Kudos
AlexBarry
Novice
3,014 Views

I believe we have figured it out.  We needed to add the -64 parameter, and -ldflags to pass parameters to gcc.  This appears to work:

    vsim -c DPI_test -ldflags "-lws2_32" -64

0 Kudos
ShengN_Intel
Employee
3,007 Views

Good to know that. It'll be great if you can mark it as solution for better future reference.

0 Kudos
Reply