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);
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);