This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > The Zynq Book Tutorials > Designing With Vivado High Level Synthesis > Creating Projects in Vivado HLS

Creating Projects in Vivado HLS

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.

Vivado HLS welcome screen.png

(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

Adding files to a Vivado HLS project.png

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.

The device selection dialogue.png

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.

Synthesis view in the workspace.png

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.

Vivado HLS command prompt.png

(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.

  • XC3042A-6VQ100C

    Manufacturer:Xilinx

  • FPGA XC3000 Family 3K Gates 144 Cells 135MHz 5V 100-Pin VTQFP
  • Product Categories:

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC2S50-6PQG208C

    Manufacturer:Xilinx

  • FPGA Spartan-II Family 50K Gates 1728 Cells 263MHz 0.18um Technology 2.5V 208-Pin PQFP EP
  • Product Categories: FPGAs

    Lifecycle:Active Active

    RoHS:

  • XC4025E-2HQ240C

    Manufacturer:Xilinx

  • FPGA XC4000E Family 25K Gates 2432 Cells 0.35um Technology 5V 240-Pin HSPQFP EP
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC2C256-6CP132C

    Manufacturer:Xilinx

  • CPLD CoolRunner -II Family 6K Gates 256 Macro Cells 256MHz 0.18um Technology 1.8V 132-Pin CSBGA
  • Product Categories: CPLDs

    Lifecycle:Active Active

    RoHS: No RoHS

  • XC3S400A-4FG320C

    Manufacturer:Xilinx

  • FPGA Spartan-3A Family 400K Gates 8064 Cells 667MHz 90nm Technology 1.2V 320-Pin FBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Active Active

    RoHS:

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.