Open the Vitis Unified IDE if you have closed it. You can use the same workspace as the previous stage or create a new one.
Click on View > Examples to view the application examples installed with Vitis
Under AI Engine Examples > Installed AI Engine Examples select the Simple example
Click Create AI Engine Component from Template
NOTE: In the description of the template, it says that the template works only for AI Engine Emulation and software (x86) simulation. In the following steps, you will learn how to make it work on hardware.
Set the component name as simple_aie_application and click Next
On the platform page, select the platform you want to use:
If you have created the platform following step 1, select the base_pfm_vek385 platform you just created. If you do not use the same workspace from last step, click Add, and select the folder
base_pfm_vek385/exportto add the platform into this workspace.If you have skipped step 1, select the VEK385 base platform (xilinx_vek385_base_202510_1) which is part of the Vitis installation.
NOTE 1: There is a current limitation in the Vitis IDE when using the base platform (vek385_base). Recommendation is to follow step 1 to create a custom platform from vivado
Click Finish.
The template imports two folders:
srccontains the sources for the kernels and the graph.datacontains the data for the simulation input (input.txt) and the golden reference for the output (golden.txt).
Open the file
project.hto see the graph. You can see that the graph (simpleGraph) has one input and one output and implements two kernels with the same function. The output of the first kernel feeds the second one.first = kernel::create(simple); second = kernel::create(simple); adf::connect(in.out[0], first.in[0]); connect(first.out[0], second.in[0]); connect(second.out[0], out.in[0]);
This is the representation of the graph.
Open the file
kernels/kernels.ccto see what function will be implemented in the kernels. You can see that this is a simple operation which is doing the sum of the real and imaginary parts of the input to create the real part of the output and the subtraction the real and imaginary part of the input to create the imaginary part of the output.void simple(adf::input_buffer<cint16> & in, adf::output_buffer<cint16> & out) { cint16 c1, c2; cint16* inItr = in.data(); cint16* outItr = out.data(); for (unsigned i=0; i<NUM_SAMPLES; i++) { c1 = *inItr++; c2.real = c1.real+c1.imag; c2.imag = c1.real-c1.imag; *outItr++ = c2; } }