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 mm2s_mp 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 s2mm_mp PL kernel completes, this host application compares the AI Engine output to the golden output files (s2m_golden_i_k0.txt, s2m_golden_i_k1.txt, s2m_golden_i_k2.txt, and s2m_golden_i_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_iandinput_j)save the position data (x,y,and z) for all 12,800 particles to the
animation_data.txtfeeds input data through the AI Engine design
captures the output data from the
s2mm_mpkernelreconstructs the output data into a new
input_iand newinput_jarraysfeeds the new
input_iandinput_jback 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.