Forum Discussion
AlexBeasley
Occasional Contributor
4 years agoLinking fftw3 lib into SystemVerilog Simulation with DPI-C
Hi there,
I am trying to run a simulation that makes use of the DPI-C interface so I can compare the FPGA output with the same function being performed in C.
For this I need to compile in the...
- 4 years ago
Hi there,
I worked it out; because the .lib files were in a directory that was not being searched automatically I had to add -L<lib_directory> into the -ldflags command. i.e.:
vsim -c -ldflags "-L./ -llibfftw3-3 -llibfftw3f-3 -llibfftw3l-3" -64 work.fftw3_tbThis now works.
Cheers
Alex
AlexBeasley
Occasional Contributor
4 years agoHi there,
Thanks for getting back to me.
I have tried passing in the -64 flag with the -ldflags command using the following commands:
vlog -dpiheader myheader.h fourier_fftw.c fftw3_tb.sv vsim -c -ldflags "-llibfftw3-3 -llibfftw3f-3 -llibfftw3l-3" -64 work.fftw3_tb
But I still get the following error in the output:
# vsim -c -ldflags "-llibfftw3-3 -llibfftw3f-3 -llibfftw3l-3" -64 work.fftw3_tb # Start time: 09:00:33 on Jul 20,2022 # ** Note: (vsim-3812) Design is being optimized... # Loading sv_std.std # Loading work.fftw3_tb(fast) # ** Fatal: (vsim-3828) Could not link 'vsim_auto_compile.dll': cmd = 'C:/intelFPGA_pro/21.3/questa_fse\gcc-7.4.0-mingw64vc15\bin\gcc.exe -shared -o "C:/Users/ALEXBE~1/AppData/Local/Temp\AlexBeasley@ALEXVIVIDQLAPTO_dpi_23316\win64_gcc-7.4.0\vsim_auto_compile.dll" c:/Data/fpga/sim/fftw3_example/work\_dpi\auto_compile@\win64_gcc-7.4.0\fourier_fftw.o -llibfftw3-3 -llibfftw3f-3 -llibfftw3l-3 -Wl,-Bsymbolic -L"C:/intelFPGA_pro/21.3/questa_fse/win64" -lmtipli' # (vsim-50) A call to system(C:/intelFPGA_pro/21.3/questa_fse\gcc-7.4.0-mingw64vc15\bin\gcc.exe -shared -o "C:/Users/ALEXBE~1/AppData/Local/Temp\AlexBeasley@ALEXVIVIDQLAPTO_dpi_23316\win64_gcc-7.4.0\vsim_auto_compile.dll" c:/Data/fpga/sim/fftw3_example/work\_dpi\auto_compile@\win64_gcc-7.4.0\fourier_fftw.o -llibfftw3-3 -llibfftw3f-3 -llibfftw3l-3 -Wl,-Bsymbolic -L"C:/intelFPGA_pro/21.3/questa_fse/win64" -lmtipli) returned error code '1'. # No such file or directory. (errno = ENOENT) # # # FATAL ERROR while loading design # Error loading design # Error: Error loading design # Pausing macro execution
I don't know if it is looking for the libfftw3 libraries in a certain location? Currently they are in the working directory of QuestaSim.
I have attached the example I am using to try and get this working. There is a "compile.do" file which has my commands in to compile the source files and run the simulation.
Any ideas?
Alex