An asynchronous RTP port can be used to probe AIE status or send minimum data without throughput requirement.
The test case is async_array_rtp_read.
The kernel signature is:
template<int32 NUM>
void vect_add(input_buffer<int32,extents<NUM>>& __restrict in,output_buffer<int32,extents<NUM>>& __restrict out,const int32 (&value)[NUM], int32 &iter);
The RTP specification can be found in aie/graph.h
:
using namespace adf;
adf::port<adf::direction::in> value;
adf::port<adf::direction::inout> iter; //for RTP read
adf::connect<adf::parameter>(value, async(k.in[1]));
adf::connect<adf::parameter>(async(k.inout[0]), iter); //for inout RTP port, default is async
The RTP calls for aiesimulator
can be found in aie/graph.cpp
:
int value[256];
gr.run(TOTAL);
gr.update(gr.value,value,256);
int current_iter=-1;
gr.read(gr.iter,current_iter);
std::cout<<"Current Iteration="<<current_iter<<std::endl;
The host code for HW and HW emulation flows can be found in sw/host.cpp
:
int value[256];
auto ghdl=xrt::graph(device,uuid,"gr");
ghdl.run(ITERATION);
ghdl.update("gr.k.in[1]",value);
int current_iter=-1;
ghdl.read("gr.k.inout[0]",current_iter);
std::cout<<"Current Iteration="<<current_iter<<std::endl;