DPI-SV with multiple c files

I am working on building a scoreboard, where I have to pass input data to the c function to get expected output. I have imported the c function into my scoreboard, but my c function has to call other small c functions to compute and give the pass the values back to scoreboard.

I am using the following command to generate the header file

clog -dpiheader header.h top.sv top.c

Can anyone tell me how to deal with multiple c files in DPI

You will need to build a .dll (Windows) or a .so (Linux) library. Refer to the Questasim manual, it provides a nice description on how to build such a library in the appendix.

In reply to ocmob:

I am actually building a shared library with all my c files included and trying to simulate the design using
vsim -c -sv_lib work.top
and I got an error saying unable to find c function in the shared library. Actually the tool is searching for the temporary shared library created by the questasim tool not the shared library(.c files) which I gave.

In reply to Vamsi Krishna Yella:

Please check your compilation flow. This is also one reason for an error ‘Unable to find function’.