S2MM DMA Finish on TLAST - 2024.1 English

AI Engine-ML Kernel and Graph Programming Guide (UG1603)

Document ID
Release Date
2024.1 English

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 will be concluded after data is received with tlast enabled.

S2MM DMA FoT can be applied to the input buffer of a kernel, or the input port of a shared buffer. This needs to be specified explicitly in the graph code.

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;