English | 日本語
In this exercise, you modify the source file in the project to observe the effects of Vivado HLS pragmas on the performance of generated hardware. See the SDSoC Environment Profiling and Optimization Guide (UG1235) for more information on this topic.
-
Create a new project in the SDx™ environment (lab4) for the ZC702 Platform and Linux System Configuration using the design template for Matrix Multiplication and Addition.
-
Click on the tab labeled lab4 to view the SDx Project Settings. If the tab is not visible, in the Project Explorer double click on the
project.sdx
file under the lab4 project. -
In the HW Functions panel, observe that the
madd
andmmult
functions already appear in the list of functions marked for hardware acceleration. -
To get the best runtime performance, switch to use the Release configuration by clicking on the Active Build Configuration option and then selecting Release. You could also select Release from the Build icon, or by right-clicking the project and selecting Build Configuration > Set Active > Release. The Release build configuration uses a higher compiler optimization setting than the Debug build configurations.
-
Double click the
mmult.cp
p under thesrc
folder in the Project Explorer view to bring up the source editor view. -
Find the lines where the pragmas
HLS pipeline
andHLS array_partition
are located. -
Remove these pragmas by commenting out the lines.
-
Save the file.
-
Right click the top-level folder for the project and click Build Project in the menu.
-
After the build completes, copy the contents of
lab4/Release/sd_card
to an SD card. -
Insert the SD card into the ZC702 board and power on the board.
-
Connect to the board from a serial terminal in the SDx Terminal tab of the SDx IDE. Click the + icon to open the settings.
-
After the board boots up, you can execute the application at the Linux prompt. Type
/mnt/lab4.elf
.
Observe the performance and compare it with the performance achieved with the commented out pragmas present (compare it with the results of lab1). Note that the array_partition
pragmas increase the memory bandwidth for the inner loop by allowing array elements to be read in parallel. The pipeline pragma on the other hand performs pipelining of the loop and allows multiple iterations of a loop to run in parallel.
Copyright© 2018 Xilinx