Asynchronous Scalar RTP - 2025.1 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2025-08-25
Version
2025.1 English

For asynchronous RTP input, each iteration of the kernel tries to read the newest updated RTP value, but not synchronous to the RTP update.

The test case is async_rtp.

The kernel signature is:

template<int32 NUM>
void vect_add(input_buffer<int32,extents<NUM>>& __restrict in,output_buffer<int32,extents<NUM>>& __restrict out,int32 value);

The RTP specification can be found in aie/graph.h:

using namespace adf;
adf::port<adf::direction::in> value;
adf::connect<adf::parameter>(value, async(k.in[1])); 

Note that for RTP input, the default behavior is synchronous. So, it has to specify asynchronous RTP input with keyword async (equivalent to adf::async as namespace adf is used).

The RTP calls for aiesimulator can be found in aie/graph.cpp:

gr.run(4);
gr.update(gr.value,10);

From 2025.1 onwards, AI Engine compiler supports compiling testbench only that is inside main() or graph.cpp. If RTP value is further updated, no need to compile the complete AI Engine graph. By using –compile-testbench-only option during AIE compilation, compiles only graph.cpp with the updated values. For example, make changes in graph.cpp as

gr.update(gr.value,20);

Recompile using compile-testbench-only-option inside Makefile line number 21:

v++ -c --mode aie --aie.compile-testbench-only --platform=${PLATFORM} --include="./aie" --work_dir=./Work

This finishes compilation pretty fast and seeing simulation results, RTP port values are updated to 20.

Note: It requires at least one update of the RTP input. Otherwise, the kernel execution will be stalled. A way to bypass initial RTP update is to set following constraints in the graph code (aie/graph.h). Thus, kernel can start execution asynchronously with the specified initial value.

initial_value(k.in[1])=10;

The host code for HW and HW emulation flows can be found in sw/host.cpp:

auto ghdl=xrt::graph(device,uuid,"gr");
const int ITERATION=4;
	
ghdl.run(ITERATION);
ghdl.update("gr.k.in[1]",10);