Overview - 2024.1 English

Vitis Libraries

Release Date
2024-05-30
Version
2024.1 English

Convolution / Correlation of input vectors F and G.

These are the templates to configure the convolution and correlation: Note: Rounding modes rnd_sym_floor and rnd_sym_ceil are only supported on AIE-ML device.

Parameters:

TT_DATA_F

describes the type of individual data samples of signal F to input to the function.

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

int8, int16, int32, cint16, cint32.

TT_DATA_G

describes the type of individual data samples of signal G to input to the function.

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

int8, int16, int32, cint16, cint32.

TT_DATA_OUT

describes the type individual data samples at the function output.

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

int16, int32, cint32, cint32. Note: TT_DATA_OUT type should be complex if any input is complex.

TP_FUNCT_TYPE describes the selection of function i.e convolution or correlation.
TP_COMPUTE_MODE

describes the computation mode of conv/corr. we have 3 modes which are

  • FULL (0) Length of F Signal will be updated by padding with zeros of G len (G-1) i.e. Len_F = [ (G-1)
  • F + (G-1) ]
  • SAME (1) Length of F Signal will be updated by padding with zeros of G len (G/2-1) i.e. Len_F = [ ((G/2)-1) + F + ((G/2)-1) ]
  • VALID (2) Length of F Signal will be updated by padding with zeros of F_load i.e. Len_F = [ F + data_load]
TP_F_LEN describes the number of samples in vector F.
TP_G_LEN describes the number of samples in vector G.
TP_SHIFT describes the number of bits to downshift.
TP_API describes whether to use streams (1) or windows (0).
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 ].
template <
    typename TT_DATA_F,
    typename TT_DATA_G,
    typename TT_DATA_OUT,
    unsigned int TP_FUNCT_TYPE,
    unsigned int TP_COMPUTE_MODE,
    unsigned int TP_F_LEN,
    unsigned int TP_G_LEN,
    unsigned int TP_SHIFT,
    unsigned int TP_API,
    unsigned int TP_RND = 0,
    unsigned int TP_SAT = 1
    >
class conv_corr_graph: public graph

// fields

input_port inWindowF
input_port inWindowG
output_port outWindow
kernel m_conv_corr