Load and Store From Window Buffer - 2022.2 English

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
Release Date
2022.2 English

AI Engine APIs provide access methods to read and write data from data memory, streaming data ports, and cascade streaming ports which can be used by AI Engine kernels. For additional details on the window and stream APIs, see Window and Streaming Data API in the AI Engine Tools and Flows User Guide (UG1076). In the following example, the window readincr (window_readincr_v<8>(din)) API is used to read a window of complex int16 data into the data vector. Similarly, readincr_v<8>(cin) is used to read a sample of int16 data from the cin stream. writeincr(cas_out, v) is used to write data to a cascade stream output.

void func(input_window<cint16> *din, 
			input_stream<int16> *cin, 
			output_stream<cacc48> *cas_out){
	aie::vector<cint16,8> data=window_readincr_v<8>(din);
	aie::vector<int16,8> coef=readincr_v<8>(cin);
	aie::accum<cacc48,4> v;
	writeincr(cas_out, v);