This is an old revision of the document!


Getting Started with the Nexys4

What's in the Box?

  • Nexys4
  • Micro-USB cable

Powering it On

To power on the Nexys4, you will need a micro-USB cable. Plug this cable into the JTAG slot on the Nexys4, plug the other end into your computer, and flip the power switch to the “On” position. This will begin the out of box demo.

More information on this startup demo can be found hereFIXME.


Getting Started with Vivado

This video will give you step by step instructions to get started with your Basys3.

The files needed for this demo can be downloaded by clicking here. You'll also need the constraints file which can be downloaded here.

6_GxkslqbcU?.swf

More information on the Abacus project can be found here.

Download and Install Vivado

First, install the latest version of Vivado by following our guide here.

Creating a Project

Now that we have Vivado 14.3 installed, we're going to create a project.

This opens Vivado's New Project wizard. Click “Next” and you'll see this screen.

Name your project (no spaces!) and choose your project saving directory before clicking “Next”. You will now see this screen.

Select RTL Project and click “Next”

In this window, you can select any other source files or directories that you'll want to use in your projects. We can also select which language we'll be programming in.

We'll be importing the pre-built Verilog files so click “Add Files”, navigate to where you saved the project files from before, and select them all. It should be noted that if you check the “Copy sources into project” box, Vivado will create separate copies of these sources and place them within your project directory. Click “Next”.

This window lets you choose existing IPs (Intellectual Property) cores if you have them.

Click “Next” and you'll see this window.

This is where we'll import our Xlilinx Design Constraints file (XDC) to map the HDL signals to the Artix-7 pins. Click on “Add Files”, navigate to where you saved your Basys3_Master.xdc file, select it, and click “Next”.

At this point you'll see the part selection screen.

You'll find all of the information you need on the Artix-7 chip on your board.

To find our board set the following filters

Family: Artix-7
Sub-Family: Artix-7
Package: cpg236
Speed grade: -1

Then choose the top part labeled “xc7a35tcpg236-1” and click “Next” and then “Finish”.

This will create your project and bring you to the Vivado project home page.


Working with Vivado

On the home page, you will see the files that you imported earlier in the “Sources” box.

Double clicking a file will open it in the window to the right. “Basys3_Abacus_Top” is the top module for the abacus demo we will be running. Clicking the [+] button will reveal the lower level modules used in it.

Before we run our program, we must first map the signals to pins using the Basys3_Master.xdc file we imported. To do this, we will open Basys3_Master.xdc. Inside this file, we will see how Vivado maps signals to pins. Each line should be commented out at this point (with #), so it should look something like this.

First, we want to make sure our signal names match the ones in the .xdc file. This can be confirmed by comparing the signal name in the .xdc file with the signal name in the top module. These are case sensitive!

  1. .xdc filexdc file
  2. Top module fileTop module

Once these are confirmed, we will uncomment whichever constraints we are using in the .xdc file. These constraints can be uncommented by selecting the lines of the signals we are using and un-toggling the comments (Ctrl+/). In this case, we can just select every line in the xdc file (Ctrl+A) and then uncomment them (Ctrl+/). This will result in some warnings later, but will not affect the output.

After uncommenting the xdc file, save it and we can start programming your Basys3.


Programming the Basys3

There are two ways to program your Basys3 FPGA: using a .bit file and using a .bin file. Using a .bit file, we use the JTAG programming cable to load the bit file into the FPGA. Programming with a .bin file will use the QSPI to program the FPGA each time it is powered on. This means you will not have to reprogram it using the JTAG connector each time. We will specify that we want to generate a .bin file by clicking Tools>Project Settings>Bitstream. In this window we will check the box next to .bin_file.

Programming the Basys3 with a .bit file

To begin, we will run the synthesis by clicking “Run Synthesis” beneath Synthesis in the Flow Navigator on the left side of Vivado.

When it is done synthesizing your project, you will see the Synthesis Completed window.

Click “Open Synthesized Design” and then press Ok. You may get several warnings after this, but this just refers to the parts of the Basys3 master XDC file that weren't implemented by our HDL design. It is good practice to only uncomment signal pins that are being used by the design, but this will not affect us in the end.

You should now see this window

To improve programming speed, in the main toolbar select Tools>Edit Device Properties…

Under General, set Enable Bitsream Compression to “TRUE”. Under Configuration, set Configuration Rate (Mhz) to 33. Under Configuration Modes, select Master SPI x4

Press Ok, save your synthesized design (Ctrl+S) and then click “Generate Bitstream” in the Flow Navigator on the left side. This will open a box stating that you have not implemented your design. Click “Ok” and Vivado will generate your .bit file and will show you this box. Click Open Hardware Manager and click OK.

You will see this screen. At this point, make sure your Basys 3 is plugged in via USB and turned on. Now click Next twice and you will see this screen. Set the JTAG Clock Frequency to 30000000, select the device, and click “Next” followed by “Finish”.

Programming the Basys3 using a .bit file

First, make sure that the jumper JP1 is in the JTAG position. You should see something like this. Click “Program device” (in the green bar) then xc7a35t_0, select your .bit file in the bitstream file box, and click Program. This will program your Basys3 through the JTAG connector.

Programming the Basys3 using .bin file

First, make sure the jumper on JP1 is in the QSPI position In the Hardware Manager window, under hardware right click your device and click Add Configuration Memory Device… This window will pop up. 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.

Select the .bin file where it asks for a configuration file and finally click OK.

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