In previous entries in the AI Engine Series, we looked at the text files generated by the AIE simulator to do a functional verification of an AI Engine (AIE) application.
In this article we will see how to generate traces to look at the state of the graph, which is one of the key elements of doing performance analysis.
The following article requires you to have gone through the previous articles in the AI Engine Series.
Generating VCD traces from the AIE simulator
The AI Engine simulator can generate a detailed dump of the hardware signals in the form of Value Change Dump (VCD) files. After simulation or emulation, the VCD file can be processed into events which contain information such as time stamps, different event types, and data associated with each event. These events describe the execution of the AI Engine application.
To generate the VCD files from the Vitis IDE, first right click on the AIE application from the Project Explorer window and click Run As > Run Configurations... .
In the Run Configurations window, enable Generate Traces and select VCD.
Click Run to launch the simulation. We can see that the following command is executed:
By comparing to the previous run, we can see that the option --dump-vcd=<file name> was added to generate the VCD traces.
When the simulation completes, we can see the VCD file (foo.vcd) created under the Emulation-AIE folder.
Generating AI Engine Trace from VCD
To analyze the events we can generate an AI Engine event trace from the VCD file. To do this in Vitis IDE, right click on the AI Engine application for which the VCD file has been generated and click Analyze AIE events.
We can see in the console that the following command is run:
This command calling the vcdanalyze utility is used to generate a Common Trace Format (CTF). Other output formats available for the vcdanalyze utility are Comma-Separated Values (CSV) and Waveform DataBase (WDB).
After running Analyze AIE events, you should see that the tool has opened multiple new windows in the IDE.
One of the windows is the CTF view. This view shows all of the events in chronological order with their timestamps and details.
The Statistics tab shows the aggregate event statistics based on a selection of multiple events (in the CTF view) or a time slice (in other views)
The System View tab represents the state of system resources such as AI Engines, locks, and DMAs. You can zoom in the window to get a closer view. You can also select a specific time slice which will be cross-probed between the different views. You can find the time difference between the 2 pointer at the bottom of the GUI.
The Function View tab represents the state of the various kernels executing on an AI Engine tile.
In our example we can see that the core located on tile 25,0 (the tile located on the 26th column of the 1st row) is executing the function "simple" 8 times (the graph is composed of 2 kernels executing the simple function from the same core and is run for 4 iterations).
We can also see that there is some latency between each function call which is the time for the core to set the context for each kernel.
Selecting two consecutive executions of the simple kernel and the time in the main can give us an estimation of the time of each iteration of the graph. In this case it is 516 ns which is coherent with the value we have found in the AIE Series 5 (the difference between the end of the second iteration (1197) and the end of the first iteration (714))
Finally, the Data View tab represents the state of data flowing through the stream switch network.