Step 4: Testing the Functionalities - 2022.2 English

Vitis Tutorials: AI Engine Development

Document ID
XD100
Release Date
2022-12-01
Version
2022.2 English

For simplicity, all the tests can be conducted using variables defined in the command line of the Makefile. The three variables are as follows:

  • TARGET:

    • _sw_emu_ allows you to run x86simulator.

    • _hw_emu_ allows you to run aiesimulator or hw_emu.

  • EXTIO

    • _false_: the input and output files are defined in the AI Engine design. The x86simulator and aiesimulator are run using these predefined test vectors. hw_emu runs after having synthesized mm2s, s2mm, and polar_clip in the PL.

    • _true_: external traffic generators are hooked up to the various simulators.

  • TRAFFIC_GEN

    • _Python_: a Python external traffic generator is used if necessary (EXTIO=true).

    • _Cpp_: a C++ external traffic generator is used if necessary.

The rules defined in the Makefile are as follows:

  • clean: Clean up all subdirectories.

  • aie: Compile the AI Engine graph (the EXTERNAL_IO macro value is defined depending on the EXTIO variable value).

  • aiesim: Simulate at the AI Engine array level (x86simulator or aiesimulator) and check results.

  • kernels: Compile s2mm, mm2s, and polar_clip into XO files, or copy sim_ipc_master_32.xo and sim_ipc_slave_32.xo into the kernels directory.

  • xclbin: Create the XCLBIN files with the kernels defined by the XOs in the kernels directory.

  • host: Create the host application. No test is defined in this application because the verification is done on the output of the external traffic generator.

  • package: Prepare for the hw_emu.

  • traffic_gen: Compile the C++ traffic generator if it has been selected.

  • run_emu: Run hw_emu and checks results.

Some simulations you can try are shown in the following examples.

make TARGET=sw_emu EXTIO=false  clean aie aiesim
--> Runs x86simulator without external TG.

make TARGET=hw_emu EXTIO=true TRAFFIC_GEN=PYTHON clean aie aiesim
--> Runs aiesimulator with a Python external TG. You have to close the two plots to finish the simulation.

make TARGET=hw_emu EXTIO=true TRAFFIC_GEN=CPP clean aie traffic_gen aiesim
--> Same but with a C++ external TG

make TARGET=hw_emu EXTIO=true TRAFFIC_GEN=PYTHON clean aie xclbin host package run_emu
--> Runs hw_emu with Python External TG. You have to get out from Qemu (CTRL A + X) and close the 2 plots to finish the simulation.

make TARGET=hw_emu EXTIO=true TRAFFIC_GEN=CPP traffic_gen run_emu
--> Runs hw_emu with C++ external TG. Here, you take advantage of the already compiled xclbin and created package.