HI ,
I wrote a small bench to find the X power Y value , By using DPIs , and the foreign language is C
CODE :
module tb;
import “DPI-C” pow = function int power(int , int);
initial
$display("5 POWER 2 is %d ",power(5,2));
endmodule
where as the pow is the predefined function in <math.h>
the problem is if i directly call the pow function from sv it is returning some garbage value, where as it return correct value if i wrapped the pow function in some other function.
I tried to find the reason but couldn’t . Please help me .