Cmod A7 Programming Guide
您可以通过两种方式编程CMOD A7:
-
JTAG
-
Quad SPI Flash
本教程将为您了解开始项目并使用两种可能的方法中的每一种来对CMOD A7 FPGA板进行编程。建议您先完成该项目之前首先完成“ Vivado入门”指南。
Prerequisites
技能
-
对Vivado的基本熟悉
-
可以通过走过我们的“Vivado入门“ 指导
-
硬件
-
Cmod A7 FPGA board
-
Micro-USB电缆
软件
-
Vivado Design Suite 2015.X
-
This proccess will work for 2016.X editions of Vivado as well
-
Board Support Files
-
Cmod A7 Support Files
-
These files will describeGPIO在板上的接口,使选择FPGA板并添加更容易GPIOIP blocks.
-
Follow the Wiki guide:Vivado Board Files for Digilent 7-Series FPGA Boardson how to install Board Support Files for Vivado.
-
Downloads
Source Files–邮政编码
Tutorial
1.创建项目
First we will need to create a project.
1.1) Open up Vivado and click “Create New Project” to open Vivado's New Project wizard.
![]()
1.3)我们将从头开始构建该项目并添加自己的资源,因此我们将要创建一个RTL项目。选择RTL项目,然后单击“下一步”。
![]()
1.4)在此窗口中,您可以选择要在项目中使用的任何源文件或目录。我们还可以选择将要编程的语言。对于此项目,只需保留默认设置即可。通过单击Create Filebutton.
![]()
Find “btn_led.v” within the source files folder you downloaded and click Ok.
默认情况下,将启用“将复制源到项目中”复选框。这将在我们的项目目录中创建另一个“ btn_led.v”,以免更改原件。
点击“Next” to continue.
1.5)此窗口可让您选择现有的IP(知识属性)内核,但是对于本教程,不需要IP。点击下一步”。
![]()
1.6)在这里,我们将导入Xilinx设计约束文件(XDC)将HDL信号映射到Artix-7引脚。点击Add Files, navigate to where you saved your CmodA7_B.xdc file, select it, and click “Next”.
![]()
现在,您已经成功创建/导入了程序文件,并配置了您的项目以与CMOD A7正确通信。
2. Creating Program File
For the two ways to program your Cmod A7 FPGA there are two associated 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 Cmod A7.
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 clicking Tools> 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. Click Ok.
![]()
2.2) To begin, we will run the synthesis by clicking “Run Synthesis” 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. Click “Open Synthesized Design” and then press Ok.
![]()
2.4)现在,您应该在右侧的窗口中看到合成的设计。看起来应该这样:
![]()
2.6) Under Configuration, set Configuration Rate (Mhz) to 33.
![]()
2.7)在配置模式下,选择主SPI X4
![]()
2.8)按“Ok”,保存您的合成设计(Ctrl+S). Vivado will notify you that since you have changed some things after synthesizing your design, your synthesis may become “out of date” with respect to your current project; go ahead and click Ok anyway. Vivado will then ask where you want to write unsaved constraints (even though we did not change any constaints); go ahead an choose the existing file that was used with this project and click Ok. Then click “Generate Bitstream” in the Flow Navigator on the left side.
![]()
2.9)这将打开一个盒子,说明您尚未实施设计。单击“确定”。
![]()
2.10) Vivado will begin generating your bit and bin files. When completed Vivado will show you this box. Feel free to select “Open Implemented Design”, or “View Reports” but you can also just cancel to continue with the guide.
![]()
At this point you have successfully created a .bit and .bin file that are ready to program the Cmod A7. As said previously there are two ways to program the Cmod A7 FPGA board, and we will be walking through each one of them below.
3. Programming the Cmod A7 using JTAG
JTAGis primarily used as a programming, debugging, and probing port and communicates through the micro-USB port. This makes interfacing with the Cmod A7 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 Cmod A7 is plugged into your computer via micro-USB cord. Once the board is plugged in you should see something like this.
![]()
This will program your Cmod A7 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 Cmod A7 using Quad SPI
Quad Spi Flash是一个非易失性的内存,CMOD A7的FPGA芯片在每个启动时都要查看。如果QUAD SPI闪烁,则FPGA将使用Quad Spi闪存中的内容进行编程。当您有一个最终的项目进行演示或显示不需要编辑并因此重新编程的最终项目时,对董事会进行编程的方法非常好。
4.1)在“硬件管理器”窗口中,在硬件右键下,单击您的设备,然后单击“添加配置存储设备”…
![]()
4.2)此窗口将弹出。选择n25q32-3.3v-spix1_x2_x4(下面突出显示)。单击下一个窗口上的确定,询问您是否要编程配置存储设备。
![]()
4.3)选择.bin文件(在您的project/project.runs/plang_1/文件夹中找到),它在其中索要配置文件,最后单击“确定”。
![]()
Vivado现在将删除旧配置文件,并使用演示文件对CMOD A7进行重新编程。从现在开始,当您为CMOD A7供电时,演示将在启动时加载,直到您对其进行重新编程。





