Overview - 2025.2 English

Vitis Libraries

Release Date
2025-12-17
Version
2025.2 English

These are the templates to configure the 2D FFT class. Note: Rounding modes rnd_sym_floor and rnd_sym_ceil are only supported on AIE-ML and AIE-MLv2 device.

Parameters:

TT_DATA_D1

describes the type of individual data samples input to the first transform function.

This is a typename and must be one of the following:

int16, cint16, int32, cint32, float, cfloat.

TT_DATA_D2

describes the type of individual data samples input to the second transform function.

This is a typename and must be one of the following:

int16, cint16, int32, cint32, float, cfloat. Note that choice of TT_DATA_D2 will impact the output data type of the first set of FFTs. Hence, not all combinations of TT_DATA_D1 and TT_DATA_D2 are supported.

TT_TWIDDLE

describes the type of twiddle factors of the transform.

It must be one of the following: cint16, cfloat

TP_POINT_SIZE_D1

is an unsigned integer which describes the number of samples in the first transform.

This must be 2^N where N is an integer in the range 5 to 16 inclusive.

TP_POINT_SIZE_D2

is an unsigned integer which describes the number of samples in the second transform.

This must be 2^N where N is an integer in the range 5 to 16 inclusive.

TP_FFT_NIFFT selects whether the transform to perform is an FFT (1) or IFFT (0).
TP_SHIFT selects the power of 2 to scale the result by prior to output.
TP_CASC_LEN selects the number of kernels the FFT will be divided over in series to improve throughput
TP_WINDOW_VSIZE_D1

is an unsigned integer which describes the number of samples to be processed in each call *to the

to the function. By default, TP_WINDOW_SIZE_D1 is set to match TP_POINT_SIZE_D1.

TP_WINDOW_SIZE_D1 may be set to be an integer multiple of the TP_POINT_SIZE_D1, in which case multiple FFT iterations will be performed on a given input window, resulting in multiple iterations of output samples, reducing the numer of times the kernel needs to be triggered to process a given number of input data samples.

As a result, the overheads inferred during kernel triggering are reduced and overall performance is increased.

TP_WINDOW_VSIZE_D2

is an unsigned integer which describes the number of samples to be processed in each call *to the

to the function. By default, TP_WINDOW_SIZE_D2 is set to match TP_POINT_SIZE_D2.

TP_WINDOW_SIZE_D2 may be set to be an integer multiple of the TP_POINT_SIZE_D2

TP_API is an unsigned integer to select window (0) or stream (1) interfaces. When stream I/O is selected, one sample is taken from, or output to, a stream and the next sample from or two the next stream. Two streams minimum are used. In this example, even samples are read from input stream[0] and odd samples from input stream[1].
TP_RND

describes the selection of rounding to be applied during the shift down stage of processing.

Although, TP_RND accepts unsigned integer values descriptive macros are recommended where

  • rnd_floor = Truncate LSB, always round down (towards negative infinity).

  • rnd_ceil = Always round up (towards positive infinity).

  • rnd_sym_floor = Truncate LSB, always round towards 0.

  • rnd_sym_ceil = Always round up towards infinity.

  • rnd_pos_inf = Round halfway towards positive infinity.

  • rnd_neg_inf = Round halfway towards negative infinity.

  • rnd_sym_inf = Round halfway towards infinity (away from zero).

  • rnd_sym_zero = Round halfway towards zero (away from infinity).

  • rnd_conv_even = Round halfway towards nearest even number.

  • rnd_conv_odd = Round halfway towards nearest odd number.

    No rounding is performed on ceil or floor mode variants.

    Other modes round to the nearest integer. They differ only in how they round for values of 0.5.

TP_SAT

describes the selection of saturation to be applied during the shift down stage of processing.

TP_SAT accepts unsigned integer values, where:

  • 0: none = No saturation is performed and the value is truncated on the MSB side.
  • 1: saturate = Default. Saturation rounds an n-bit signed value in the range [- ( 2^(n-1) ) : +2^(n-1) - 1 ].
  • 3: symmetric = Controls symmetric saturation. Symmetric saturation rounds an n-bit signed value in the *range [- ( 2^(n-1) -1 ) : +2^(n-1) - 1 ].
TP_TWIDDLE_MODE

describes the magnitude of integer twiddles. It has no effect for cfloat.

  • 0: Max amplitude. Values at 2^15 (for TT_TWIDDLE=cint16) and 2^31 (TT_TWIDDLE=cint32) will saturate and so *introduce errors
  • 1: 0.5 amplitude. Twiddle values are 1/2 that of mode 0 so as to avoid twiddle saturation. However, *twiddles are one bit less precise versus mode 0.
template <
    typename TT_DATA_D1,
    typename TT_DATA_D2,
    typename TT_TWIDDLE,
    unsigned int TP_POINT_SIZE_D1,
    unsigned int TP_POINT_SIZE_D2,
    unsigned int TP_FFT_NIFFT = 1,
    unsigned int TP_SHIFT = 0,
    unsigned int TP_CASC_LEN = 1,
    unsigned int TP_WINDOW_VSIZE_D1 = TP_POINT_SIZE_D1,
    unsigned int TP_WINDOW_VSIZE_D2 = TP_POINT_SIZE_D2,
    unsigned int TP_API = 0,
    unsigned int TP_RND = 4,
    unsigned int TP_SAT = 1,
    unsigned int TP_TWIDDLE_MODE = 0
    >
class fft_ifft_2d_graph: public graph

// typedefs

typedef std::conditional_t <kIsRealDataD1, fft_dit_2ch_real_graph <t_inTypeFrontGraph, TT_TWIDDLE, TP_POINT_SIZE_D1, TP_FFT_NIFFT, TP_SHIFT, TP_CASC_LEN, TP_WINDOW_VSIZE_D1, TP_API, TP_RND, TP_SAT, TP_TWIDDLE_MODE, TT_DATA_D2>, fft_ifft_dit_1ch_graph <t_inTypeFrontGraph, TT_TWIDDLE, TP_POINT_SIZE_D1, TP_FFT_NIFFT, TP_SHIFT, TP_CASC_LEN, kIntDynPtSize, TP_WINDOW_VSIZE_D1, TP_API, kIntParPow, kIntUseWidgets, TP_RND, TP_SAT, TP_TWIDDLE_MODE, TT_DATA_D2>> frontGraphType

// fields

port_array <input, 1> in
port_array <output, 1> out
frontGraphType frontFFTGraph[1]
fft_ifft_dit_1ch_graph <TT_DATA_D2, TT_TWIDDLE, TP_POINT_SIZE_D2, TP_FFT_NIFFT, TP_SHIFT, TP_CASC_LEN, kIntDynPtSize, TP_WINDOW_VSIZE_D2, TP_API, kIntParPow, kIntUseWidgets, TP_RND, TP_SAT, TP_TWIDDLE_MODE> backFFTGraph[1]
adf::shared_buffer <TT_DATA_D2> memTile1