graph_top;
graph_top.init();
graph_top.run(1);
graph_top.end();
```
Note that [XRT](https://xilinx.github.io/XRT/2021.1/html/index.html) is used in the host application. This API layer is used to communicate with the programmable logic, specifically the PLIO kernels for reading and writing data. To understand how to use this API in an AI Engine application refer to the "Programming the PS Host Application".
2. Close the main.cpp, and run the command.
```bash
make host
```
This won't take very long.
### Section 4: Package the Design
With all the AI Engine outputs and the new platform created, you can now generate the Programmable Device Image (PDI) and a package to be used in the hardware emulated SD card. The PDI contains all executables, bitstreams, and configurations of every element of the device, and the packaged SD card directory contains everything to boot Linux and have your generated application and `.xclbin`.
To package the design, run the following command.
```bash
make package
```
### Section 5: Run Hardware Emulation
After packaging, everything is set to run emulation or hardware.
1. To run emulation use the following command.
```bash
make run_emu
```
Or
```bash
cd ./sw
./launch_hw_emu.sh
cd ..
```
This will take between 5 and 10 minutes to fully launch QEMU.
When launched, use the Linux prompt presented to run the design.
2. Execute the following command when the emulated Linux prompt displays:
```bash
cd /mnt/sd-mmcblk0p1
export XILINX_XRT=/usr
```
This will set up the design to run emulation. Run the design using the following command:
```bash
./host.exe a.xclbin
```
The host and graph are now running waiting for input from the traffic generators. Your QEMU terminal should look as follows:
![Alt Text](images/v777_qemu_wait.png)
3. In a new terminal execute `run_traffic_generators.py` with the following command.
```bash
make run_tgen
```
In the makefile run_tgen task simply executes the python script.
For 128 samples (the default amount for this tutorial) - this step will take 1 or 2 minutes to run.
The default settings for this tutorial is only 128 samples which will execute in the hardware emulation environment quite quickly. A matplotlib window will appear that looks as follows:
![Alt Text](images/V777_tutorial_fftout.png)
As you can see in the figure, the output of the DSPLib FFT module matches the expected output.
When this is shown, run the keyboard command: `Ctrl+A x` to end the QEMU instance.
**IMPORTANT**: To rerun the application you need to restart QEMU from scratch.
### Summary
In this tutorial you learned how to:
* Connect two simulation-only traffic master/slave IP cores to the AI Engine array via Vitis
* Build and Run HW emulation (QEMU + SystemC model of AI Engine)
* Pass data from python to the AI Engine via the simulation traffic generators.
* Configure the design for different PLIO widths
* Capture the AI Engine output in python
* Plot/Graph the data in python and compare against a golden reference model
To read more about the use of Vitis in the AI Engine flow see: *UG1076: Versal ACAP AI Engine Programming Environment Chapter 13: Running Hardware Emulation & Traffic Generators*.
## Support
GitHub issues will be used for tracking requests and bugs. For questions go to [forums.xilinx.com](http://forums.xilinx.com/).
## License
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0]( http://www.apache.org/licenses/LICENSE-2.0 )
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
XD066 | © Copyright 2021 Xilinx, Inc.