I want to call a C function within my systemverilog file using DPI C. I have tried the one step (irun -sv hello.c hello.sv )and it worked very well. But the thing I want to do is to create my own shared object .so, to do this I have tried a 3 steps methodology (ncvlog ,ncelab and ncsim) but it failed when I want to simulate it.
I got this message : ncsim: *F,NOLWSV: Searching for import subroutine "print" in default library libdpi. Unable to load the default library libdpi.OSDLERROR: ./libdpi.so: only ET_DYN and ET_EXEC can be loaded.
Please find in this following paragraph all my files and script to do this.
Thank you by advance,
You need to use ncsim -svlib lib_name to load the dpi library generated by gcc, otherwise, the link process will report error
In reply to FlyingHeart:
Thank you, but i have used the simple way to do it using irun . But i have a question, is it possible to load several shared object and not only using the default "libdpi.so" ? because i have several shared object corresponding to a function, and i want to call several function from different shared object ...
Is it possible to do this ?
thank you by advance,
In reply to jbriquet:
In fact, you can generate multiple librires and use multiple -svlib lib_name to load multiple libraries and use different functions in irunto realize your idea.