Graph utils - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

Overview

The Graphs utilities contain helper funcitons and classes that ease usage of library elements.

// typedefs

typedef typename std::conditional <Condition, port <DIRECTION>, no_port>::type xf::dsp::aie::port_conditional
typedef typename std::array <port <DIRECTION>, SIZE> xf::dsp::aie::port_array
typedef typename std::conditional <Condition, port_array <DIRECTION, SIZE>, std::array <no_port, SIZE>>::type xf::dsp::aie::port_conditional_array

// classes

class xf::dsp::aie::empty
class xf::dsp::aie::no_port

Typedefs

typedef typename std::conditional <Condition, port <DIRECTION>, no_port>::type xf::dsp::aie::port_conditional

port_conditional is an helper alias to conditionally instance port.

Parameters:

DIRECTION describes port direction: input, output or inout.
Condition when met port of a DIRECTION is created, otherwise a no_port struct is instanced.
typedef typename std::array <port <DIRECTION>, SIZE> xf::dsp::aie::port_array

port_array is an helper alias to instance port array Uses: std::array to instance an array of port<DIRECTION> classes.

Parameters:

DIRECTION describes port direction: input, output or inout.
SIZE array size.
typedef typename std::conditional <Condition, port_array <DIRECTION, SIZE>, std::array <no_port, SIZE>>::type xf::dsp::aie::port_conditional_array

port_conditional_array is an helper alias to conditionally instance port array Uses: std::conditional to instance a port_array<DIRECTION, SIZE> class or an empty no_port struct array.

Parameters:

DIRECTION describes port direction: input, output or inout.
Condition when met port of a DIRECTION is created, otherwise a no_port struct is instanced.
SIZE array size.

Global Functions

xf::dsp::aie::convert_sym_taps_to_asym

#include "aie/fir_graph_utils.hpp"
template <typename TT_COEFF>
void xf::dsp::aie::convert_sym_taps_to_asym (
    TT_COEFF* tapsOut,
    unsigned int fLen,
    TT_COEFF* tapsIn
    )

convert_sym_taps_to_asym is an helper function to convert users input coefficient array.

Function creates an asymmetric array in the area provided from a symmetric one.

Function can be used when run-time programmable coefficients are being passed to the FIR graph,

using the graph’s class update() method.

Parameters:

TT_COEFF describes the type of individual coefficients of the filter taps.
tapsOut a pointer to the output taps array of uncompressed (flen) size.
fLen input argument defining the size of the uncompressed array.
tapsIn pointer to the input taps array of compressed (fLen+1)/2 size.

xf::dsp::aie::convert_hb_taps_to_asym

#include "aie/fir_graph_utils.hpp"
template <typename TT_COEFF>
void xf::dsp::aie::convert_hb_taps_to_asym (
    TT_COEFF* tapsOut,
    unsigned int hbFirLen,
    TT_COEFF* tapsIn,
    unsigned int ssr
    )

convert_hb_taps_to_asym is an helper function to convert users input coefficient array.

Function can be used when run-time programmable coefficients are being passed to the FIR graph,

using the graph’s class update() method.

HB taps arrays are compressed arrays of taps with the center tap at the end,

with a length of: hbFirLen = (FIR Length + 1) / 4 + 1 . When converting to Asym, we want to convert the symmetric taps to asymmetric, but it’s useful to have the center tap at the end, (since it is processed by separate polyphase lane and is offloaded to a separate, dedicated kernel).

However for SSR cases, the array needs to be padded with zeros to a multiple of SSR factor.

For example, for a FIR Length of 7, where coeffs are: 1, 0, 2, 5, 2, 0, 1

tapsIn: 1, 2, 5

hbFirLen: 3

For SSR: 1,

tapsOut: 1, 2, 2, 1, 5

For SSR: 3

tapsOut: 1, 2, 2, 1, 0, 0, 5

Parameters:

TT_COEFF describes the type of individual coefficients of the filter taps.
tapsOut a pointer to the output taps array of uncompressed (flen) size.
hbFirLen input argument defining the size of the uncompressed array.
tapsIn pointer to the input taps array of compressed (fLen+1)/2 size.
ssr ssr parameter