Getting started with VIVADO+ZYNQ7000, the first PL program, from creation to operation

Learning FPGA development is the only way for ordinary hardware engineers to develop into senior hardware engineers. With the increasing integration of chips, traditional hardware engineers can do less and less work. Is there no future for hardware engineers?
With the increasing integration of FPGAs, and the increasing demand for large amounts of data/large amounts of computing in the application market, the integration route of ARM+FPGA will become the mainstream trend of future chip development. Mastering the development skills of this heterogeneous platform is also one of the ways for hardware engineers to improve their own capabilities.
Let's start with a simple Verilog program. Today's main task is to be familiar with the operation process of vivado.

Project creation

The installation of the vivado software will not be introduced in this article. The following assumes that you have already installed vivado on your computer. I am using the 2016.1 version. The operations of different versions are similar.
Double-click the desktop shortcut, and it is the
Insert picture description here
first time you use this look , so click on the new project in the upper left corner and name it project_led. Save the path. I like to create a folder called MyProject under the EDA installation path. .
Insert picture description here
In the next interface, we choose RTL project, because it is the first design from the low-level design method of verilog language.
Insert picture description here
Choose the chip model according to the board you have. Of course, it’s okay not to choose it here. I believe that those comrades who can start using vivado will have some experience in using other FPGA development programs. The chip model can also be set in the following steps.
Insert picture description here
After everything is ready, you can see the interface shown in the figure below. The orange window in the upper middle contains the file information of the entire project, including design documents, constraint documents and simulation documents.
Insert picture description here

Add design files

We are on the leftmost side of the software and find Project Manag at the top. The first Projec Setting can set or modify the chip model and basic project settings. Click the second Add Sources
Insert picture description here
pop-up window to select the second one
Insert picture description here
in the new pop-up In the window, select Creat File,
Insert picture description here
select the file type Verilog, enter the file name led_test
Insert picture description here
, you can see the file information in the new window, click Finish
Insert picture description here
, and then enter the name of the module, which is also led_test
Insert picture description here
Project Manage. You can see one more file
Insert picture description here
after double-clicking and opening A blank verilog file, click the upper right corner of the window to switch the size of the window.
Insert picture description here
Enter the code below

`timescale 1ns / 1ps
//
// Company: 
// Engineer: 
// 
// Create Date: 2020/07/08 16:59:19
// Design Name: 
// Module Name: led_test
// Project Name: 
// Target Devices: 
// Tool Versions: 
// Description: 
// 
// Dependencies: 
// 
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// 
//


module led_test(
input CLK_i,
input RSTn_i,
output reg [3:0]LED_o
);
reg [31:0]CNT; //时钟计数counter
always @(posedge CLK_i)
  if(!RSTn_i)
    begin
    LED_o <= 4'b1;
    CNT <= 32'h0;
    end
  else
    begin
     if(CNT == 32'd50_000_000)
        begin
        CNT <= 32'h0;
        if(LED_o == 4'b1000)
        LED_o <= 4'b1;
        else LED_o <= LED_o << 1;
        end
     else 
       begin
        CNT <= CNT + 1'b1;
         LED_o <= LED_o; 
       end
     end
endmodule

Compile and configure

Click the synthesis icon on the top or the left to start synthesis. After synthesis, a small interface will pop up to remind you what to do next. You can click cancel and implement it after assigning pins.
Insert picture description here
Find the Project Manage on the leftmost side of the window again, and add the file, but this time the constraint file is added, select the first one.
Insert picture description here
See the familiar interface again, choose Creat File. The
Insert picture description here
input file name is still led_test, but this time the file type is XDC, constraint file. The so-called constraints refer to information such as the pin, signal characteristics, and pin level of the specified signal.
Insert picture description here
In the next step, I have seen it. Continue to Finish
Insert picture description here
Project Manage and see another file.
Insert picture description here
Next, we can double-click the xdc file and enter the constraints in the text format, or set by options. We use the second one.
First found in the left-most column of the window synthesis, the bottom has a Schema'tic, click on it
Insert picture description here
you can see the following window, click on the top of the I / O Ports
Insert picture description here
at the bottom you can see the familiar interface, pin it manually specify the
Insert picture description here
designated Afterwards, remember to click Save in the upper left corner of the window. The
Insert picture description here
effect is like this. Here, I forgot to specify the level type of the pin. An error is prompted during compilation. You cannot choose default! You need to go back and manually modify it yourself.
Or find the schematic from the leftmost synthesis column and at the bottom.
Insert picture description here
Now synthesize/generate bit files
Insert picture description here

Download and run

Find the leftmost, bottom, bottom of the window!
Insert picture description here
The circuit board is plugged into the JTAG programmer, and the target board is powered on.
Insert picture description here
If the link is correct, you will see the following look. If the device is not found, please check the hardware connection.
Insert picture description here
Find the bottom of the left side of the window again and start programming; you can also right-click on the device name to start programming,
Insert picture description here
Insert picture description here
select the file path, and
Insert picture description here
witness the joy of success!
So far, a simple verilog has been successfully programmed, downloaded and run successfully in the vivado environment!

Familiar with vivado

Go back and familiarize yourself with vivado. Under RTL analysis, click on schematic to see
Insert picture description here
the effect of the register-level schematic synthesis. Pay attention to the location of the first step. If you choose different here, the comprehensive schematic will be different. Compare the following two pictures.
Insert picture description here
Insert picture description here
Have fun for a while!

Guess you like

Origin blog.csdn.net/malcolm_110/article/details/107222944