How to Get Started With Vivado HLs 2015.4

by immanueljohanesaditya in Circuits > Tools

478 Views, 2 Favorites, 0 Comments

How to Get Started With Vivado HLs 2015.4

Vivado.PNG

NOTE: This page is one part of a larger build. Please ensure you start HERE, so you understand where the following fits in within the larger project.

If you already installed the Vivado you can follow the instruction now. Enjoy!

How to Create Project

number 1.png
2.png
number 3.png
number 4.png
number 5.png
number 6.png
number 7.png
number 8.png

After Vivado application have been installed, the steps to create a project in Vivado are as follows:

  1. To create a project in Vivado, you have to Open the Vivado application first. And after that there a few choices will be shown on your screen, as shown in figure 1. And then you choose Create Project. After that, a "Create a New Vivado Project" windows on your screen, then click on "Next >" option.
  2. After you choose "Next >", the application will ask you to fill the "project name" and "project location" as show in figure 2. After finish filling the project name and project location, click on "Next >".
  3. Then, the application will ask you to choose the "Project Type" as shown in figure 3. After choosing the "Project Type", click on "Next >".
  4. The next step is to "Add Sources" to your project as show in figure 4. If you already have the file sources, than choose "Add Files". If you don't have any sources, then choose "Create File". You can choose the "HDL Source For", either "Synthesis & Simulation" or "Simulation Only". On this window, you can also choose the "target language", the options are VHDL and Verilog. Also, you can choose the "simulator language", the options are VHDL, Verilog, and Mixed. After finish adding sources to your project, click on "Next >".
  5. After that, the application will ask you to "Add Existing IP" as shown in figure 5. This is optional, if you don't want to add IP, just click on "Next >". If you have an existing IP, then choose "Add Files".
  6. Then, the application will ask you to "Add Constraints" as shown in figure 6. This is optional, if you don't want to add constraints, just click on "Next >". If you have a constraints files, then choose "Add Files".

  7. The next step, you will be ask to choose the "Default Part" as shown in figure 7. You can choose to select parts or boards. On the "Light Seeking Mobile Robot" project, the "Family" part chosen was "Artix-7". The "Package" chosen was "cpg236". The "Speed grade" chosen was "-1". Then, the "Part" used was "xc7a35tcpg236-1". After you finished choosing, click on "Next >".

  8. Finally, the last step is the application will show the "New Project Summary" as shown in figure 8. On this window, the "project type" and the "project name" will be shown if you add one. The "source files or directories" will be shown if you add one. The "configurable IP" will also be shown if you add one. The "constraints files" will be shown if you add one too. And the last is the "default part" that you have chosen will also be shown on this window. After that, click "Finish". Once you click "Finish", your new project will be created. And then, you can write you VHDL code there and run "synthesis" after you finish writing your code. Also you can run a simulation by adding a "simulation sources" that consist of the "test bench" code.

How to Add Source

Addsource_1.png
Addsource_2.png
Addsource_3.png
Addsource_4.png
Addsource_5.png

After create a project, the steps to add source in Vivado are as follows :

  1. Click "Add Sources" as indicated by the arrow in figure 1.
  2. The next step select "Add or create design sources" then click "Next>" as shown in figure 2.
  3. The next step fill "File name" box with the name that you want (should descriptive) then click "OK" as shown in figure 3. Don't forget to make sure that you select "VHDL" on "File type box".
  4. After you finish to fill "Entity name" with the name that you want (should descriptive) as shown in figure 4.
  5. Fill the "Port Name" for your source then select "Direction" which either "input" or "output" or "inout" as it should be. Check the "Bus" only if it's more than one bit and fill the "MSB" and "LSB". Just ignore or uncheck if your port only has one bit. For Example Port A has 4 bit (3 downto 0) so 3 for MSB and 0 for LSB.
    • MSB : Most Significant Bit
    • LSB : Least Significant Bit
  6. After you finish input all of your port now you can type VHDL code inside the box as show in figure 5. After finish with your code now you can click the "Run Implementation" button as indicated by the arrow.
  7. If there is something wrong with your code, an error warnings will be occurs in box below your code. Don't forget to always learn!

How to Upload to Xc7a35tcpg236-1: Generate Bitstream Files

1.png
2.png
3.png
4.png
5.png
6.png
7.png
8.png
9.png
10.png

When we are done with the coding for each component, we do the following instructions to implement and program the Basys 3 board to do the intended function of the Light-seeking Robot, through Implement and Generate Bitstream. Here is the step by step (the red numberings on the images are mentioned in the steps).

1. Choose which method to implement the code
There are three methods to implement the Basys 3 board, JTAG, USB, Quad SPI.

2. Generating .bin and .bit (bitstream) files
This configuration can be found on tools > project settings > bitstream. Choose the “.bin” to get the .bin and .bit file (Image 1)

3. Run the synthesis (Image 2)
You will be asked like this, choose Run Implementation then Ok (Image 3)
The synthesized result will looked like this (Image 4)

4. Editing the device properties
Open up on the tools window, then pick edit device properties (Image 5)
Set enable bitstream compression to 'TRUE'
Next is change the configuration rate to 33 (Image 6)
And select Master SPI x4 (Image 7)

5. Generating the Bitstream
Click on “Generate Bitstream” either located on ... (Image 8)
Then it showed that we have no implementation yet, just press yes (Image 9)
You can choose to open implemented design or view reports (Image 10)

And the .bit and .bin files are generated, now we have three methods to upload the codes to the Basys 3 board that will be explained next

How to Upload to Xc7a35tcpg236-1: Quad SPI Method

Screenshot 2021-06-28 094752.png
q1.png
q2.png
q3.png
q4.png

Quad SPI Flash is a non-volatile memory that the Basys3's FPGA chip looks at on every startup. If Quad SPI is flashed then the FPGA will program itself with the contents found in Quad SPI's flash memory. This method of programming your board is great when you have a final project that you would like to demo or display that doesn't need to be edited and therefore reprogrammed.

Note: Before we start, make sure to set the jumper mode on the JP1 pins to QSPI that looks like first image

Step 1: In the Hardware Manager window (either through Image 1 or can be founded on Flow > Hardware Manager), under hardware right click your device and click Add Configuration Memory Device (Image 2)

Step 2: A window pops up asking for what memory part. Search for “Spansion” and select the 32 bit device (highlighted below). Click Ok on the next window asking if you want to program the configuration memory device. (Image 3)

Step 3: Select the .bin file where it asks for a configuration file and finally click Ok. (Image 4)

Vivado will now erase the old configuration file, and reprogram your Basys3 with the demo file. From now on, when you power up the Basys3, the demo will load at startup until you reprogram it.

How to Upload to Xc7a35tcpg236-1: JTAG Method

Screenshot 2021-06-28 094847.png
j1.png
j2.png
j3.png

JTAG is primarily used as a programming, debugging, and probing port and communicates through the micro-USB port. This makes interfacing with the Basys easy because the micro-USB connection both supplies power to your board, and the ability to program it.

Step 1: First, make sure that the jumper JP1 is in the JTAG position and that the Basys 3 is plugged into your computer via micro-USB cord. Once the board is plugged in you should see something like image 1.

Step 2: Click “Program device” (in the green bar, image 2) then xc7a35t_0, select your .bit file in the bitstream file box, and click Program (Image 3).

This will program your Basys 3 board through the JTAG connector. Once the programming window is closed go ahead and test out your board. Each slide switch at the bottom of your board should now toggle its respective LED on and off.

How to Upload to Xc7a35tcpg236-1: USB Method

Screenshot 2021-06-28 094928.png
66305.jpg

Important note that the USB device that you select to program the Basys 3 must be formatted in Fat32. Other than that your device doesn't have to be empty and can contain other files and folders. At this point Vivado is no longer needed to program the FPGA, so you can minimize your project and follow these steps in File Explorer:

Step 1: Make sure the jumper on JP1 is in the USB position. Something looks like first image.

Step 2: Plug your USB flash device into your computer.

Step 3: Open File Explorer and navigate to the root folder of your Vivado project.

Step 4: From root go to root > Project_name.runs > impl_1 and copy the .bit file.

Step 5: Go to the root of your USB device and paste the .bit file. The Basys3 on startup will only look through the USB's root for a file with a .bit extension so it is important that the only .bit file in root is the one that you want to be used to program the Basys3.

Step 6: Safely remove the USB device from your computer and plug it into the USB port on the Basys 3 board. (Second image)

Step 7: Make sure your board is connected to your computer for power and turn on the Basys 3. It should immediately begin writing the .bit file to the FPGA.

Once finished your board should function exactly as it did when programming it with JTAG. Whether you were aware or not you just successfully programmed your Basys3 board two separate ways using the same .bit file.

References