Declare kernel function k1
with input
stream operates on data type int32
that is named
in0
and circular 1d
output buffer operates on data type int32
that is named out0
.
void k1(input_stream<int32> *in0, output_circular_buffer<int32, adf::extents<OUTPUT_SAMPLE_SIZE>> & out0)
{
auto out0Iter = aie::begin_circular(out0);
for (int ind = 0; ind < OUTPUT_SAMPLE_SIZE; ++ind)
{
*out0Iter++ = readincr(in0);
}
}
Important: When kernels are located on the same
tile in the AI Engine,
memory addressing optimizations become possible. However, it is important to note
that some restrictions might arise due to this optimization. For instance, if K1 and
K2 are situated in the same tile and are connected through an output-to-input
buffer, they must use the same type of addressing. This means they can either opt
for linear or circular addressing, but they cannot have a mixture of both. However,
it is worth noting that this limitation will not be identified during X86 simulation
because it only emulates functional aspects of AI Engine tiles and memory. For more details on X86
simulation models, see Limitations in
AI
Engine Tools and Flows User Guide (UG1076).