This chapter describes how to get started with simulating PL and AI Engine with VSS. By simulating the AI Engine design together with PL kernels, valuable knowledge of the interaction between the domains can be modeled and visualized.
Simulating the VSS is an independent parallel activity to linking the VSS to an extensible platform allowing for various development strategies. This figure show the context of VSS simulation in the Vitis export to Vivado flow.
VSS simulation focuses on the simulation and verification work flow for the VSS. VSS simulation shares the steps for creating and compiling the PL kernels and AI Engine graphs, as well as linking the VSS together.
Within the AI Engine work folder, Makefiles corresponding to RTL simulators are generated. Depending on the choice of RTL simulator, one of the Makefiles are compiled to serve as control application during the simulation. This creates a simulation shared object that is attached to the RTL simulator.
The following figure represents the VSS simulation work flow using Vivado simulation project with XSim.
- Create a Vivado project.
- Import VSS using the following
code.
vitis::import_vss <path_to_vss>/<vss_name>.vss - Create a wrapper for the VSS block design.
- Add a VSS wrapper and relevant RTL test bench files (for example, RTL test bench, drivers, and monitors) to the project.
- Set the simulation top to the test bench.
- Setup simulation option.
- Launch Vivado simulation.
- Optional: open wave configurations and add signal logging.
- Run simulation.
- Check the results.
Example for setting up a VSS simulation is available on Vitis Tutorials on Github. See https://github.com/Xilinx/Vitis-Tutorials/tree/HEAD/Vitis_System_Design/Feature_Tutorials/02-Vitis_Subsystem_Simulation for details.
To verify incremental changes to the VSS components, the following table illustrates which steps require re-running.
| Update type | Steps to update and verify | Comments |
|---|---|---|
| AI Engine graph without PLIO change |
|
|
| AI Engine graph with VSS interface change |
|
Changes to interfaces require re-running wrapper to expose port updates so it can be connected in test bench. |
| RTL or HLS Kernel, changes within VSS |
|
|
| RTL or HLS Kernel, changes VSS interface |
|
Changes to interfaces require re-running wrapper to expose port updates so it can be connected in test bench. |
| Test bench updates |
|
Changes to files (RTL test bench, drivers and monitors) are typically detected when running interactively in Vivado. |
Comparing AI Engine Graph Control with Simulation
The following table compares AI Engine graph control and graph inputs and outputs with different methods of simulating an AI Engine design.
| Features | AIESIM | VSS Simulation | HW_EMU |
|---|---|---|---|
Graph
control:
|
graph.cpp - C_RTS |
graph.cpp - C_RTS |
host.cpp - PS (QEMU) |
| RTP |
graph.cpp - C_RTS |
graph.cpp - C_RTS |
host.cpp - PS (QEMU) |
| PLIO | File I/O | RTL test bench |
host.cpp - PS (QEMU) |
| GMIO |
graph.cpp - C_RTS |
Not supported |
host.cpp - PS (QEMU) |