Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15334 Discussions

modelsim Altera support for vpi and dpi

XXiao2
Novice
527 Views

I am trying to use DPI feature and started with one simple DPI project. I can compile the code (.sv and .c) successfully but when i want to simulated the design. I got the error message:

# Model Technology ModelSim - Intel FPGA Edition vlog 2019.2 Compiler 2019.04 Apr 17 2019

# Start time: 13:31:03 on Apr 09,2020

# vlog -reportprogress 300 -sv -dpiheader cimports.h simple_calls.sv cimports.c

# -- Compiling module top

#

# Top level modules:

#   top

# -- Compiling DPI/PLI C file cimports.c

# End time: 13:31:03 on Apr 09,2020, Elapsed time: 0:00:00

# Errors: 0, Warnings: 0

# vsim -dpicpppath /opt/tools/Altera/19.4/modelsim_ase/gcc-4.7.4-linux/bin -c top

# Start time: 13:31:03 on Apr 09,2020

# ** Error (suppressible): (vsim-7077) The path '/opt/tools/Altera/19.4/modelsim_ase/gcc-4.7.4-linux/bin' via -dpicpppath switch is not a valid gcc/g++ full path and is ignored.

# Loading /tmp/fxiao@fxiao-Precision-T7600_dpi_18315/linuxpe_gcc-5.4.0/export_tramp.so

# Loading sv_std.std

# Loading work.top

# Compiling /tmp/fxiao@fxiao-Precision-T7600_dpi_18315/linuxpe_gcc-4.7.4/exportwrapper.c

# ** Fatal: ** Fatal: (vsim-3828) Could not link 'vsim_auto_compile.so': cmd = '/opt/tools/Altera/19.4/modelsim_ase/gcc-4.7.4-linux/bin/gcc -shared -fPIC -m32 -B/usr/lib32 -o "/tmp/fxiao@fxiao-Precision-T7600_dpi_18315/linuxpe_gcc-4.7.4/vsim_auto_compile.so" /home/fxiao/verilog_prj/dpi/simple_calls/work/_dpi/auto_compile@/linuxpe_gcc-4.7.4/*.o "/tmp/fxiao@fxiao-Precision-T7600_dpi_18315/linuxpe_gcc-4.7.4/exportwrapper.o"  -Wl,-Bsymbolic '

# (vsim-50) A call to system(/opt/tools/Altera/19.4/modelsim_ase/gcc-4.7.4-linux/bin/gcc -shared -fPIC -m32 -B/usr/lib32 -o "/tmp/fxiao@fxiao-Precision-T7600_dpi_18315/linuxpe_gcc-4.7.4/vsim_auto_compile.so" /home/fxiao/verilog_prj/dpi/simple_calls/work/_dpi/auto_compile@/linuxpe_gcc-4.7.4/*.o "/tmp/fxiao@fxiao-Precision-T7600_dpi_18315/linuxpe_gcc-4.7.4/exportwrapper.o"  -Wl,-Bsymbolic >'/tmp/questatmp.Wxi800' 2>&1) returned error code '1'.

# The logfile contains the following messages:

# /opt/tools/Altera/19.4/modelsim_ase/gcc-4.7.4-linux/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.4/ld: /usr/lib32/crti.o: unrecognized relocation (0x2b) in section `.init'

# /opt/tools/Altera/19.4/modelsim_ase/gcc-4.7.4-linux/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.4/ld: final link failed: Bad value

# collect2: error: ld returned 1 exit status

#

# No such file or directory. (errno = ENOENT)

#

#

# FATAL ERROR while loading design

# Error loading design

# Error: Error loading design

#       Pausing macro execution

# MACRO ./run.do PAUSED at line 29

it seems the library is loaded from a temp folder using different version of gcc:  Loading /tmp/fxiao@fxiao-Precision-T7600_dpi_18315/linuxpe_gcc-5.4.0/export_tramp.so. But compiles the wrapper using gcc comes with the tool which is 4.7.4. How can I specify the library folder? is it an environment variable? I could not find any info about this topic online

0 Kudos
2 Replies
SyafieqS
Moderator
422 Views

Hi,

 

According to link below, the QUARTUS_LIBRARY_PATHS environment variable specifies user-defined library paths. You can use this environment variable to define multiple library paths at the same time, instead of individually adding each path to the user library. 

 

  1. https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/manual/quartus_install.pdf (p14-QUARTUS_LIBRARY_PATHS )
  2. https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/manual/archives/quartus_ins... (p14-Configuring the Linux User Environment)

Thanks,

Regards

 

 

XXiao2
Novice
422 Views
Hi there, Thank you for your reply. The tool I am talking about is the modelsim not the Quartus. Can you be more specific about the setting of this environment variable to solve this issue. Frank
Reply