Optimum Cascade Length - 2023.2 English

Vitis Libraries

Release Date
2023.2 English
For FIR variants configured to use streaming interfaces, i.e. TP_API=1, the optimum TP_CASC_LEN for a given configuration of the other parameters is a complicated equation. Here, the optimum value of TP_CASC_LEN refers to the least number of kernels that the overall calculations can be divided, when the interface bandwidth limits the maximum performance.
To aid in this determination, utility functions have been created for FIR variants in their respective graph files.
The function signature for the single rate asymmetric filter is shown below, as an example:
template<int T_FIR_LEN, typename T_D, typename T_C, int T_PORTS, unsigned int SSR>
static constexpr unsigned int getOptCascLen();

where T_FIR_LEN is the tap length of the FIR, T_D and T_C are the data type and coeff type respectively, T_PORTS refers to single/dual ports. SSR is the parallelism factor set for super sample rate operation.

An example use of the getOptCascLen and getMinCascLen is shown below. You can first declare a dummy graph of the FIR type you need, and use the dummy graph to call the static functions with the actual parameters with which you want the configure the graph.

using fir_graph = xf::dsp::aie::fir::sr_sym::fir_sr_asym_graph<DATA_TYPE, COEFF_TYPE, FIR_LEN, SHIFT, RND, INPUT_WINDOW_VSIZE>;

static constexpr int kOptLen = fir_graph::getOptCascLen<FIR_LEN, DATA_TYPE, COEFF_TYPE, NUM_OUTPUTS, TP_SSR>();

xf::dsp::aie::fir::sr_sym::fir_sr_asym_graph<DATA_TYPE, COEFF_TYPE, FIR_LEN, SHIFT, RND, INPUT_WINDOW_VSIZE,
                                             kOptLen, USE_COEFF_RELOAD, NUM_OUTPUTS, API, SSR> firGraphWithOptLen;

More details are provided in the API Reference Overview.