I want to import some C math function such as the sin and atan into my testbench using the DPI. It works fine when I use the "irum" command, the code should be right. But when I use the 3-step process it doesn't work. From the referrence manual I know that the c file should be first complied to the libdpi.so, but since I use the standare C function, which file should I compile? And I try to skip the compilation step and add the -sv_lib libm.so argument, it also doesn't work.
I greatly appreciate any help.
Here is an example which works:
% gcc my_c_funcs.c -fpic -shared -o libdpi.so
% ncvlog -sv my_test.sv -mess% ncelab -access +c worklib.my_test% ncsim worklib.my_test -sv_lib libdpi.so
I hope this helps.
Hi muffi, thank you for your reply.
The problem is I don't have the my_c_funcs.c file, because I just use the standare "sin" and "atan" math functions in my code. Do you have any idea about that?