1 Reply Latest reply on Jul 13, 2015 2:43 PM by chris_balcom

    QuestaSim pli simulation cannot find symbols


      I am using QuestaSim for Verilog simulation. The simulation need some systemC functions for co-simulation.


      Here's where I encounters the problem:


      First I compile the .C file into .o file


      ~/mentor/release2015/questa_v10.4/questasim/gcc-4.7.4-linux_x86_64/bin/gcc \

      -lz -std=c99 -c -g  -fPIC -DMODELSIM_VPI -fno-stack-protector\

      -I/imec/software/mentor/release2015/questa_v10.4/questasim/include/ \

      ../src/elf-loader/elf-loader.c ../src/elf-loader/vpi_wraper.c \ 

      ../src/jtag_vpi/jtag_vpi.c \


      I get no warning or errors. Then I generate .vpi files from the .o file, again no warning or errors:


      ~/mentor/release2015/questa_v10.4/questasim/gcc-4.7.4-linux_x86_64/bin/gcc \

      -lm -lz -shared -Bsymbolic \

      -o jtag_vpi.vpi jtag_vpi.o


      ~/mentor/release2015/questa_v10.4/questasim/gcc-4.7.4-linux_x86_64/bin/gcc \

      -lm -lz -shared -Bsymbolic \

      -o elf-loader.vpi  elf-loader.o vpi_wrapper.o


      Note That I have two vpi: jtag_vpi and elf-loader. Then I start QuestaSim loading those two vpi.


      vsim -c -L work -t 10ps work.dut \

      -pli jtag_vpi.vpi -pli elf-loader.vpi



      jtag_vpi  is OK. However, The other elf-loader keeps generating errors that I never get it right by trying out all the gcc configurations I know.



      # Loading ./elf-loader.vpi

      # ** Error (suppressible): (vsim-3197) Load of "./elf-loader.vpi" failed: ./elf-loader.vpi: undefined symbol: elf_strptr.

      # ** Error (suppressible): (vsim-PLI-3002) Failed to load PLI object file "./elf-loader.vpi".



      I have been working on this for few days and really appreciate if anyone will help.


      Seems to me that ModelSim missed some libraries (e.g. for elf_strptr) the elf-loader.vpi is using. But in GCC there's no warning of that, meaning GCC can find those libararies, but not QuestaSim, why?


      for the record: here's uname -a:

      Linux MY_SERVER 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux