Basys 3 Getting started in Microblaze
Overview
本指南将为Basys 3 FPGA板上使用Vivado IP集成器创建基于微蓝光的硬件设计的逐步演练。
At the end of this tutorial you will have:
-
Created a Microblaze based hardware ( HW ) design in Xilinx Vivado
-
Created a .C Project in Xilinx Vivado SDK ( Software Development Kit) to display Hello World using the hardware design shown in the previous step
-
Displayed the final output on both the SDK console and Tera Term
Prerequisites
硬件
-
Digilent Basys 3 FPGA板和Micro USB电缆用于UART通信和JTAG编程
Software
-
Xilinx Vivado 2016.X带有SDK包。
Board Support Files
-
Board Support Files
-
These files will describeGPIO在terfaces on your board and make it easier to select your FPGA board and addGPIOIP块
-
遵循本Wiki指南(Vivado Board Files for Digilent 7-Series FPGA Boards) on how to install Board Support Files for Vivado
-
- -
教程
Microblaze是Xilinx的软IP核心,它将完全在Xilinx FPGA通用记忆和逻辑结构中实现微处理器。对于本教程,我们将使用Vivado IP集成器工具添加一个微封闭式IP块。
In addition to the Microblaze IP block, a UART ( universal asynchronous receiver/transmitter ) IP block will be added to communicate between the host PC and the soft processor core running on the Basys 3.
General Design Flow
I. Vivado
-
打开Vivado并选择Basys 3板
-
Create an new Vivado Project
-
Create empty block design workspace inside the new project
-
Add required IP blocks using the IP integrator tool and build Hardware Design
-
验证并保存块设计
-
创建HDL系统包装器
-
Run design Synthesis and Implementation
-
Generate Bit File
-
导出硬件设计,包括生成的位流文件到SDK工具
-
Launch SDK
现在,硬件设计导出到SDK工具。Vivado到SDK交接是通过Vivado内部完成的。我们将使用SDK创建一个软件应用程序,该应用程序将通过从Vivado导入硬件设计信息来使用自定义的板接口数据和FPGA硬件配置。
ii。SDK
-
创建新的应用程序项目并选择默认Hello World模板
-
程序FPGA
-
通过选择正确的UART COM端口和波特率来运行配置
1.创建一个新项目
When you first run Vivado this will be the main start window where you can create a new project or open a recent one.
1.1)单击Create New Project。Choose the Project Name and Location such that there are没有空白的空间。This is an important naming convention to follow for project names, file names and location paths. Underscore is a good substitute for empty spaces. It is good practice to have a dedicated folder for Vivado Projects, preferably with the smallest possible path length. Example: C:/Vivado_Projects. Name your Project and select the Project location and clickNext。
1.3) If you have followed the Board Support File Wiki guide then click next until you can select董事会。从过滤器选项中,对供应商,显示名称和董事会修订版进行了必要的选择。Basys 3should be displayed in the selection list. A mismatch in selecting the correct board name will cause errors. Choose Basys 3 and click next.
2. Creating New Block Design
3.添加时钟
This list contains all of the components defined in the board file you installed before. These are already configured to work with several Vivado IPs.
4.添加微型封面IP和自定义
4.2) Select运行块自动化and a customization assistant window will open with default settings.
4.3)更改块选项中的默认设置,如下所示,然后单击OK。这将使用我们的新用户设置自定义块。
Local Memory: 128KB
Local Memory ECC: None
Cache Configuration: None
调试模块:仅调试
Peripheral AXI Port: Enabled
Interrupt Controller: unchecked
Clock Connection: /clk_wiz0/clk_out1(100 MHZ)
4.4) Running the block automation will auto-generate a set of additional IP blocks which will be added to our hardware design automatically based on the options selected in the previous step.Do not click on Run Connection Automation yet.
5.添加外围组件
6. Making an HDL Wrapper
6.1)在设计验证步骤之后,我们将继续创建HDL系统包装器。单击Sources标签并找到您的块设计。
6.2)右键单击你块设计和点击Create HDL Wrapper。确保让Vivado管理包装纸和自动更新is selected and clickOK。
这将在Verilog中创建一个顶部模块,并允许您生成一个botstream。
7.生成一个botstream
8. Exporting Hardware Design to SDK
8.1)在主工具栏上,单击File并选择导出→导出硬件。检查box to包括Bitstreamand clickOK。这将为软件开发工具-Vivado SDK的系统包装器导出硬件设计。
A new file directory will be created underHello_World.SDKsimilar to the Vivado hardware design project name. Two other files,。sysdefand。hdf也是创建的。此步骤本质上创建了一个新的SDK工作区。
8.2) On the main toolbar, clickFileand thenLaunch SDK。Leave both of the dropdown menus as their defaultLocal to Projectand clickOK。这将打开Xilinx SDK并导入您的硬件。
9.在SDK中创建新的应用程序项目
9.1) Click the New下拉箭头并选择xilinx→申请项目。
Give your project a name that has no empty spaces and clickNext。
9.2) Select你好世界from the list of templates and clickFinish。
You will see two new folders in theProject Explorer控制板。
-
你好世界which contains all the binaries, .C and .H (Header) files
-
你好世界_bsp这是董事会支持文件夹
你好世界is our main working source folder. This also contains an important file shown here which is the “lscript.ld”. This is a Xilinx auto generated linker script file. Double click on this file to open.
10.编程的FPGA和一些文件
10.1)确保BASYS 3通过USB-JTAG端口打开并连接到主机PC-此端口将作为与微封面的USB-UART连接双重目的。
On the top toolbar, click the 程序FPGA按钮。
10.2)单击程序to program your FPGA with your hardware design.