The example below run in approx 77 seconds on a Pentium 2.8GHz It performed the sequence VpFft, VpIfft 10 times. The two transformations are perfomed in-place on the contents of xformFC, which is of type VpFComplex. VpFComplex indicates a complex number in cartesian coordinates whose fields are of type real.
The parameter SIZE is set to 1024 * 1024
Note that the size of the array upon which VpFft and VpIfft are called must be a power of 2 for the given FFT algorithm to work.
module top;
parameter SIZE = 1024 * 1024;
integer k;
real delta;
VpFComplex xformFC [0:SIZE - 1];
initial begin
#1;
delta = (2*$VpGetPi()) / SIZE;
$InitM(xformFC, (($I1==3) ? 7.0 : 0.0), 0.0);
$display("xformFC[3].Re=%e\n", xformFC[3].Re);
for (k = 0; k < 1; k = k + 1)
begin
$VpFft(xformFC, 0, SIZE-1);
$VpIfft(xformFC, 0, SIZE-1);
end
// $PrintM(xformFC, "%e");
$display("xformFC[3].Re=%e\n", xformFC[3].Re);
end
endmodule