package math_pkg; // Inspired by the post // https://community.cadence.com/cadence_blogs_8/b/fv/posts/create-a-sine-wave-generator-using-systemverilog // import functions directly from C library //import dpi task C Name = SV function name import "DPI" pure function real cos (input real rTheta); import "DPI" pure function real sin(input real y); import "DPI" pure function real atan2(input real y, input real x); endpackage : math_pkg // Encapsulates the functions in a parameterized class // The FFT is implemented using floating point arithmetic (systemverilog real) // Complex values are represented as a real vector [1:0], the index 0 is the real part // and the index 1 is the imaginary part. class fft_fp #( parameter LOG2_NS = 7, parameter NS = 1<