FONT SIZE : AAA
In this exercise we will present the creation of Vivado HLS projects using both the Vivado HLS GUI and the use of Tcl scripting to expedite the process.
(a) Before we begin it is necessary to copy the files from C:\Zynq_Book\sources\hls to a new directory, C:\Zynq_Book\hls.
(b) Launch the Vivado HLS GUI by navigating to Start > All Programs > Xilinx Design Tools > Vivado 2014.1> Vivado HLS > Vivado HLS 2014.1
(c) When the Vivado HLS GUI loads, you will be presented with the Welcome screen as in Figure 3.1.
(d) Select the option to Create New Project in Figure 3.1
(e) At the Project Name dialogue, enter matrix_mult_prj as the Project name and C:/ Zynq_Book/hls/tut3A as Project location. Click Next.
(f) You will now be prompted to add or remove source files for the project. All C-based source files for this tutorial have been created in advance, as we seek to guide the design flow rather than the programming itself. Click Add Files. and navigate to C:\Zynq_Book\hls\tut3A
Select the files matrix_mult.cpp and matrix_mult.h and click Open. Set the top function to matrix_mult as in Figure 3.2. Click Next.
(g) You will now be prompted to add a testbench file for design testing. Once more, click Add Files. and navigate to the previous directory this time adding the file matrix_mult_test.cpp and clicking Next.
(h) The next step is configuring a solution for a specific FPGA technology. In this case, leave the solution name and clock settings as the default options. Since we are using the ZedBoard with the Zynq-7020 FPGA click . in the part selection panel.
Under the Specify section select Boards and then select the ZedBoard Zynq Evaluation and Development Kit before clicking OK as in Figure 3.3. Click Finish.
(i) The project will be generated and the workspace will open in Synthesis mode for the generated project and solution as in Figure 3.4. Expanding the Source and Test Bench sections in the Explorer tab on the left side shows the inclusion of the source and test files from the previous steps. Double clicking on these files opens them in the editor view for examination and editing.
The project consists of a matrix multiplier, which multiplies two matrices inA and inB to produce the output prod. The testbench performs the multiplication of two known matrices and checks the value of prod against expected values.
While the process of getting to this stage of HLS development is relatively straightforward, it can be quite repetitive and so can be facilitated by use of Tcl scripting. This automates the process of project naming and adding files. As such, we will now demonstrate the creation of the same project using the aforementioned scripting approach.
(j) First, close the Vivado HLS GUI. We will now open the Vivado HLS Command Prompt.
Launch the command prompt by navigating to Start > All Programs > Xilinx Design Tools > Vivado 2014.1 > Vivado HLS > Vivado HLS 2041.1 Command Prompt.
(k) It is observed that the default directory for commands is the install directory of Vivado HLS, as in Figure 3.5. To change this to the working directory for this tutorial, use the following commands, followed by pressing the Enter key.
• cd — This is a change directory command which moves up a level in the directory. Repeat this until you have reached the level of the C: drive.
• cd Zynq_Book — This changes directory to the Zynq_Book folder.
• cd HLS — This changes directory to Zynq_Book/HLS.
• cd tut3A — This changes directory to Zynq_Book/HLS/tut3A.
The command prompt should now be in the working directory C:\Zynq_Book\HLS\tut3A. This folder contains the source and test files for a project, and also the Tcl script required to build the project, run_hls.tcl.
(l) With the correct working directory and the required files present in that directory, we can now build the project. This is achieved through simply running the Tcl script using the command:
vivado_hls ‐f run_hls.tcl
This will begin the process of creating the project and adding source and test bench files. A HLS solution is then created before configuring the project for the target device. Finally a C simulation is run which utilises the test bench to ensure the project operates correctly.
The testbench performs identical multiplications using the HLS hardware solution and software, and compares the results. If these results are identical, a “Test passed!” message is displayed.:
(m) To open the project in the VIvado HLS GUI enter the following command:
vivado_hls ‐p matrix_mult_prj
And press Enter. This will open the Vivado HLS GUI for the project, which we will utilise in the next exercise.
Using the project generated in the previous exercise, we will now investigate the process of design optimisation in Vivado HLS. This will also provide an insight into the flow from project creation to C synthesis and C/RTL cosimulation. We will also discuss the use of the Analysis perspective in analysing a HLS solution.
Manufacturer:Xilinx
Product Categories:
Lifecycle:Obsolete -
RoHS: No RoHS
Manufacturer:Xilinx
Product Categories: FPGAs
Lifecycle:Active Active
RoHS:
Manufacturer:Xilinx
Product Categories: FPGAs (Field Programmable Gate Array)
Lifecycle:Obsolete -
RoHS: No RoHS
Manufacturer:Xilinx
Product Categories: CPLDs
Lifecycle:Active Active
RoHS: No RoHS
Manufacturer:Xilinx
Product Categories: FPGAs (Field Programmable Gate Array)
Lifecycle:Active Active
RoHS:
Support