Reloadable Coefficients - update_rtp() Method - Reloadable Coefficients - update_rtp() Method - 2026.1 English

Vitis IP Libraries

Release_Date
2026-06-23
Version
2026.1 English

An ease-of-use enhancement with the update_rtp() method is available for each FIR graph class. This method simplifies the process of updating coefficients at runtime to a single method call.

The following example demonstrates how to use the update_rtp() method in the context of a FIR filter graph class.

The test_graph class contains a member firGraph, which is a parameterized fir_sr_asym_graph FIR filter graph. The test_graph class also contains an array of coefficient RTP ports. The size of the array is determined by the getTotalRtpPorts() method of the fir_sr_asym_graph class.

The main function of the host application initializes the graph, updates the RTP ports at runtime using update_rtp with coefficient values from the std::vector taps.

The main function then runs the filter for a specified number of iterations and properly ends the graph execution.

// This is a header file, e.g. "test.hpp" that is included in the corresponding cpp file.

class test_graph : public adf::graph {
public:

xf::dsp::aie::fir::sr_asym::fir_sr_asym_graph<
   int16, //TT_DATA
   int32, //TT_COEFF
   32, //TP_FIR_LEN
   16, //TP_SHIFT
   0, //TP_RND
   256, //TP_INPUT_WINDOW_VSIZE
   1, //TP_CASC_LEN
   0, //TP_USE_COEFF_RELOAD
   1, //TP_NUM_OUTPUTS
   0, //TP_DUAL_IP
   0, //TP_API
   1, //TP_SSR
   0 //TP_SAT
> firGraph;

static constexpr int rtpPortNumber = firGraph::getTotalRtpPorts();
port_array<input, rtpPortNumber> coeff;
#include "test.hpp"

xf::dsp::aie::testcase::test_graph filter;

int main(void) {
   filter.init();

   std::vector<int32> taps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};

   filter.firGraph.update_rtp(filter, taps, filter.coeff);

   filter.run(4);

   filter.end();

   return 0;
}

The update_rtp method abstracts the implementation details of updating RTP ports with new coefficient values. It performs the following steps: