Host Applications - 2023.2 English

Vitis Tutorials: AI Engine

Document ID
Release Date
2023.2 English

The host/main_xrt.cpp host application is compiled into the build/ps_app.exe executable. This host application reads in the m2s_i.txt and input_j.txt files that initalize the m2s_x2 PL kernel’s ibuff and jbuff DDR buffer inputs. This host application starts the PL kernels and the AI Engine graph and waits for one iteration of data to flow through the design. Once the s2m_x4 PL kernel completes, this host application compares the AI Engine output to the golden output files (s2m_x4_k0.txt, s2m_x4_k1.txt, s2m_x4_k2.txt, and s2m_x4_k3.txt files). If there are any data mismatches, then the TEST FAILED, else the TEST PASSED. If you provide the --profile command line input, this host application also calculates the execution times for the C++ N-Body Simulator and the AI Engine N-Body Simulator for comparison.

The host/main_animate.cpp host application is compiled into the build/ps_animate.exe executable. This host application does the following:

  • uses the NBodySimulator API to generate initial data (input_i and input_j)

  • save the position data (x,y,and z) for all 12,800 particles to the animation_data.txt

  • feeds input data through the AI Engine design

  • captures the output data from the s2m_x4 kernel

  • reconstructs the output data into a new input_i and new input_j arrays

  • feeds the new input_i and input_j back into the AI Engine design and computes another timesteps

The host application repeats these actions for 300 timesteps. You can provide the --timesteps <num_timesteps> command line input to specify how many timesteps (iterations) the design runs for.

The following is the general execution flow for the host applications.

alt text