AI Engine-ML device
supports S2MM DMA finish on tlast (FoT) feature.
With this feature, the DMA S2MM transaction can be completed when it receives data
with tlast enabled. The buffer will dynamically
switch between Ping and Pong usage upon receiving data with tlast. If a single buffer is used, the current transaction concludes
after data is received with tlast enabled.
You can apply S2MM DMA FoT to the input buffer of a kernel, or the input port of a shared buffer. The graph code must explicitly specify this.
For example, the following code specifies FoT on the input ports of a kernel
and a shared
buffer:
//Finish on Tlast for kernel input buffer. If the buffer data is transfered from PLIO, assert tlast in PL kernel will immediately finish filling the buffer, and switch to fill another buffer for next data (for example, switch from Ping buffer to Pong buffer)
adf::finish_on_tlast(first.in[0]) = adf::finish_on_tlast_mode::FoT_no_counts;
//Finish on Tlast for shared buffer. If shared buffer is signle buffer (default), asserting tlast of the input data will finish the write, and the read will start. The next write will happen in next iteration.
adf::finish_on_tlast(mtxA.in[0]) = adf::finish_on_tlast_mode::FoT_no_counts;