In the previous AI Engine Series article, we have run the AIE compiler targeting the X86 model and run the X86 simulator to verify the functional model of the AI Engine Application.
In this article we will run the AIE compiler targeting the AI Engine model and look at some of the generated files.
The following article requires you to have gone through the previous articles of the AI Engine Series.
In the project created through the previous article, open the simple_application.prj file and change the active build configuration to Emulation-AIE to compile the application for the AI Engine model.
Select the aie application (simple_application) in the Explorer window and click on the hammer icon to build the application
We can see the command which is run in the console. This is very similar to the one for x86simulator that we have seen in the previous article.
aiecompiler -v -dataflow -include="<Xilinx Installation Path>/Vitis/2020.2/aietools/include" -include="<Xilinx Installation Path>/Vitis_HLS/2020.2/include" -include="../" -include="../src" -include="../data" -include="../src/kernels" -target=hw --xlopt=0 -platform=<Platform Installation Path>/xilinx_vck190_base_202020_1/xilinx_vck190_base_202020_1.xpfm -workdir=./Work ../src/project.cpp
The main difference we can see is that the target option is set to hw. (when the build target was Emulation-SW it was set to x86).
Once the build complete, we can see in the Explorer window that a new directory named Emulation-AIE was created.
This contains all of the output from the build. We will have a look into it.
By default the AI Engine compiler writes all outputs to a directory called Work/ and a file libadf.a.
The file libadf.a is the actual output which will be used by the rest of the Vitis™ flow to integrate the AI Engine application to the rest of the system.
The Work/ directory contains multiple sub-directories and files:
We can now run the AIE simulator.
Select the AI Engine Application (simple_application) and click on the arrow next to the Run As icon and click Run As > Launch AIE Emulator
The simulation output is written in the file Emulation-AIE/aiesimulator_output/data/output.txt.
We can have a look into this file:
Note that there is a time before each line of values. This is because compared to the x86 simulation, the AIE simulation is cycle accurate.
We can see that the first output samples arrived after 683ns. In the VCK190 base platform, the frequency of the AI Engine is set to 1GHz. This means that 683 compute cycles were needed to output the first output sample.
In a later article we will cover the various reasons for this latency, however keep in mind (as mentioned in the AI Engine 3 article) that the code is not optimized to run on the vector processor and so is not taking advantage of its compute power.
If you look at line 64 in the output.txt, you should see a TLAST word. This marks the end of the execution of 1 iteration of the graph after 714ns.
The first sample of the second iteration is then outputted after a simulation time of 1197ns.
We can now verify that the data outputted is still matching with the golden results.
Select the golden.txt file and the newly created output.txt and right click on one of them. Now select Compare With > Each Other after transformation.
In the pop-up window, click on the list icon (predefined filters). In the second output window, enable Remove timestamp and click OK. Click OK on the first pop-up window.
This will remove the timestamps from the output file from the simulator in order to compare only the output sample values.
There should be no differences between the 2 files which means that the AIE compilation results are still functionally matching the golden reference.
In the next article we will have a look at the Vitis Analyzer report file generated after the AI Engine compilation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.