Genesys 2 - Programming Guide

Overview

There are four ways you can program the Genesys2:

  • JTAG
  • Quad SPI Flash
  • USB Flash Drive
  • Micro SD Card

This tutorial will walk you through what you need to know to get started on your projects and program your Genesys2 FPGA board using each of the three possible methods. It is recommended that you first complete the “Getting Started with Vivado” guide before continuing with this project.NOTE: The Genesys2 requires Vivado Design Edition or System Edition which supports the Kintex-7 FPGA. This is not the same as the free webpack version.


Prerequisites

Skills

  • Basic familiarity with Vivado
    • 可以通过浏览我们的“ Vivado入门”指南来找到这种体验

Hardware

  • Genesys2 FPGA board
  • Micro-USB cable
  • Micro SD card

Software

  • Vivado Design Suite 2015.X
    • System Edition or Design Edition must be installed to support Kintex-7

Board Support Files

  • Genesys2 Support Files

Downloads

Source FilesZIP

Tutorial

1. Creating the Project

First we will need to create a project.

1.1) Open up Vivado and clickCreate New Projectto open Vivado's New Project wizard.

1.2) A new window will open up, clickNextand you'll see the screen below. Name your project (no spaces!) and choose your project saving directory before clickingNext.

1.3) We will be building this project from the ground up and adding our own sources so we will want to create an RTL project. select RTL Project and clickNext.

1.4) In this window, you can select any source files or directories that you'll want to use in your projects. We can also select which language we'll be programming in. For this project just keep the default settings. Create a new file by clicking theCreate Filebutton.

1.5) Findsw_led.vwithin the source files folder you downloaded and click好的. TheCopy sources into projectcheckbox will be enabled by default. This creates anothersw_led.vwithin our project directory so that the original will not be altered. ClickNextto continue.
1.6) This window lets you choose existing IP (Intellectual Property) cores if you have them, but for this tutorial no IP's will be necessary. ClickNext.

1.7)在这里,我们将导入Xilinx设计约束文件(XDC)将HDL信号映射到Kintix-7引脚。点击Add Files, navigate to where you saved your Genesys2_H.xdc file, select it, and clickNext.

1.8) At this point Vivado will open up a part selection window. Select theBoardstab highlighted in orange below. If you installed the board files correctly, you should see a list of Digilent boards. Select theGenesys2and clickNext.

这将创建您的项目,并将您带到Vivado项目经理。

You have now successfully created/imported your program files and configured your project to properly communicate with the Genesys2.


2. Creating Program File

For the four ways to program your Genesys2 FPGA there are two file types available; .bit and .bin files. Using a .bit file we can use either the JTAG programming cable, or a standard USB storage device to load the bit file into the FPGA. Programming with a .bin file will use the QuadSPI to program the FPGA each time it is powered on. This means you will not have to reprogram it each time via a micro USB cable or by a thumb drive. The following steps bellow will get you all prepared to program your Genesys2.

2.1) In order to program the FPGA on startup we have to specify that we want to generate a .bin file. This can be done by clickingTools→Project Settings→Bitstream. In this window we will check the box next to .bin_file. Now Vivado will create both a .bit, and .bin file when we generate a Bitstream.

2.2) To begin, we will run the synthesis by clicking运行合成beneath Synthesis in the Flow Navigator on the left side of Vivado.

2.3) When the program finishes synthesizing your project, you will see the Synthesis Completed window below. ClickOpen Synthesized Designand then press好的.

2.4) You should now see your Synthesized Design in the window to the right. It should look like this:

2.5) To improve programming speed of our .bin file, in the main toolbar selectTools→Edit Device Properties. Under General, setEnable Bitsream Compressionto “TRUE”.

2.6) Under Configuration, setConfiguration Rate (Mhz)to33.

2.7) Under Configuration Modes, selectMaster SPI x4.

2.8) Click好的, save your synthesized design (Ctrl+S) and then clickGenerate Bitstreamin the Flow Navigator on the left side.

2.9) This will open a box stating that you have not implemented your design. Click好的.

2.10) Vivado will begin generating your bit and bin files. When completed Vivado will show you this box. Feel free to selectOpen Implemented Design, orView Reportsbut you can also justCancel继续进行指南。

At this point you have successfully created a .bit and .bin file that are ready to program the Genesys2. As said previously there are four ways to program the Genesys2 FPGA board, and we will be walking through each one of them below.


3. Programming the Genesys2 using JTAG

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

3.1) First, make sure that the jumper JP5 is in the JTAG position and that the Genesys2 is plugged into your computer via micro-USB cord into theJTAGport. Once the board is plugged in you should see something like this.

3.2)单击程序设备(in the green bar), then clickxc7k325t_0, and select your .bit file in thebitstream filebox, and clickProgram.

This will program your Genesys2 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引领on and off.


4. Programming the Genesys2 using a USB Flash drive or SD card

重要的是要注意,y的USB设备ou select to program the Genesys2 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:

4.1) Make sure the jumper on JP5 is in the USB/SD position and that JP4 is in the USB position if using a USB drive, or SD if using an SD Card.
4.2) Plug your USB flash device or SD Card into your computer.
4.3) Open File Explorer and navigate to the root folder of your Vivado project.
4.4) From root go toroot→Project_name.runs→impl_1and copy the .bit file.
4.5)转到USB设备的根并粘贴.bit文件。启动Genesys2只能浏览带有.bit扩展名的文件的USB的root,因此重要的是,root中唯一的.bit文件是您要用于编程Genesys2的文件。
4.6) Safely remove the device from your computer and plug it into the Genesys2.
4.7) Make sure your board is connected to your computer for power and turn on the Genesys2. 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 Nexsys 3 board two separate ways using the same .bit file.


5. Programming the Genesys2 using Quad SPI

Quad SPI Flash is a non-volatile memory that the Genesys2'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.

5.1) Make sure the jumper on JP5 is in the QSPI position
5.2) In the Hardware Manager window, under hardware right click your device and clickAdd Configuration Memory Device…
5.3) This window will pop up. Search for “Spansion” and selects25fl256sxxxxxx0-spi-x1_x2_x4. Click好的on the next window asking if you want to program the configuration memory device.
5.4) Select the .bin file (found in your project/project.runs/impl_1/ folder) where it asks for a configuration file and finally click好的.

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