How to use Vivado to write the first program and run it on BASYS3

Yes, even though you are only running the simplest program, you will encounter various problems. This is Vivado, a professional tool that the teacher emphasizes.

There must be all kinds of weird questions, you may wish to leave a message in the comment area, let's discuss it together!

Install Vivado first, make sure you use a legal license

Family portrait一张无关的全家福,哈哈能用DEVC++解决的问题我从来不打开VS2019。

Before connecting to the board

First, you need to create a new project, just like we have done elsewhere.

Insert picture description hereInsert picture description here

The difference is that you may need to choose your chip model somewhere in the middle, because software is inseparable from the operation of programmable circuits and hardware. You can take a closer look at the chip on the board with the flashlight on your phone. The FPGA carton also has a slightly different model number printed on the package. The one printed on the package is XC7A35T-ICPG236C, I think the one printed on the chip shall prevail.

Insert picture description hereInsert picture description here

After FINISH, you will enter an interface similar to Eclipse Workbench. You need ADD SOURCE to add something similar to the VS2019 source file so that you can edit it.

Insert picture description here

Because I want to draw a circuit, I choose Design Source (but I don’t know anything about it. Constraints seems to provide another way to set pins)

Insert picture description here

You need to create a new file, and we intend to implement the simplest AND AND gate. (HelloWorld is too difficult on hardware)

Insert picture description here
Insert picture description here

After adding, FINISH

Insert picture description here

There will be a link to set the pins, we can write the code later and then pay attention to it, first OK and then YES, because we know what we are doing.

Insert picture description here

Insert picture description here

At this time the file has been generated, double-click to open it. You will see a place where you can write code.

Insert picture description here

This is the code to implement an and gate. Similar to a general programming language, you have to declare that x1 and x2 are input, and y is output. (There are other ways of declaration) Pay attention to write them in the brackets provided by default; outside the brackets, use the keyword and to create a new AND gate, and its parameter order is (output, input, input).

Insert picture description hereInsert picture description here

After writing, save by ctrl+s, and then we can generate a circuit diagram that brings a sense of accomplishment, click the button as shown on the left.

Insert picture description hereInsert picture description here

This dark one should be the netlist, which (should be used to) explain to the chip what hardware changes are needed. But we still prefer to look at circuit diagrams, as shown in the figure, select Schematic to generate circuit diagrams.

Insert picture description hereInsert picture description here

Now, get the board

Now what we have to do is to map the input and output to the device, so that we can verify that we really have an AND gate. The input will be set on a toggle switch, and the output will be an LED light.

Open the Layout of the toolbar, and then open the I/O Planning interface

Insert picture description here

The I/O Ports option should appear in the lower right corner, you can click on it to open the pin settings panel.

I have added a picture, it looks like this (the data is already filled in at this time, you can leave it alone)

Insert picture description here

It should be like this when you just opened it, click the plus sign to open the folder, and then set the input and output. I/O Std needs to set the voltage, and my board is set to 3.3 volts. This may need to consult the teacher to understand the parameters.

Insert picture description hereInsert picture description here

We plan to use the board's V16 and V17 as input, corresponding to x1 and x2; use the yellow LED light U16 as the output. (That is really U)
(Different topic, myth in class, I also discussed with my classmates during the experiment, if the output is set on the toggle switch, will there be magical force to move the switch?)

Insert picture description here

Just fill them in accordingly

Insert picture description here

Then the bitstream is generated. If I remember correctly, the bitstream will be imported into the board to instruct the programmable module to operate. Let's talk about the husband. (Wish you all the best)

Insert picture description here

An interface will pop up and you need to enter a name. It seems that there is no problem writing it casually (I don't know much about naming conventions). YES afterwards.

Insert picture description here

Is being generated, it may take a while, this time you can

Connect to the board

Insert picture description hereInsert picture description here

After the bitstream is generated, a window will pop up. You can choose to open the hardware management and let the software find the board. (It seems that many students can't find the board at this step?

Insert picture description here

Select Open target.

Insert picture description here

Choose to open a new goal

Insert picture description here
Insert picture description here

I wish you success in detecting your board.

Insert picture description here

FINISH we are connected!

Insert picture description here

Afterwards, the generated bitstream can be imported, and the program device can be selected.

Insert picture description here

Select the connected device, the last step, programming!

Insert picture description here
Insert picture description here

The flashing lights on the board should be dimmed before, and then you can flip the switch to operate. In this way, we have realized the truth table of and gate.

Insert picture description here

congratulate!

Guess you like

Origin blog.csdn.net/roswellnotfound/article/details/108700132