Vivado System Generator学习笔记

环境:win7 64   vivado 2014.1
开发板:zedboard version d    xc7z020clg484-1

串口软件:SecureCRT

注意:本文中所有的源码、工程文件在“我的资源”中可以找到,如果没有请联系作者本人。转载请注明出处。


  前面一段时间各种事,一直就没有更新博客了。现在准备把前两天的学习笔记放上来,以供分享讨论。

  这篇笔记主要是关于Vivado System Generator的学习笔记,是Xilinx官网的ug948教程的简要说明,只包括了自己实际验证的部分。ug948、ug897都是很好的学习Vivado System Generator的资料,讲的非常详细,英文也不难,所以这里不打算像之前一样一步步的写下来了,有了前面的基础和一点matlab的基础应该可以很快上手的。


1. 使用流程(个人总结,详细请参考ug948)

1. 使用流程(新建slx)
    打开SG
    在matlab主界面:打开simulink
    新建model,在simulink library browser里面选择相应的组件,添加到model中
    修改相关参数,连接模块
    设置参数,仿真


2. 使用流程(已有的slx文件)
    打开SG
    在matlab主界面,设置工作目录(非常重要);在左侧栏可以看到已有的工程文件。
    打开*.slx文件,可进行编辑。打开simulink可选择相关模型。
    添加Xilinx(System Generator模块),一定注意设置part为已安装的part。
    如果因为版本问题无法保存,可以另存为新的文件。(测试几次mdl格式比较保险)


2. ug948学习导航

•  Lab 1: Use Simulink to create a simple design, create a subsystem, and then simulate.
    基本概念和使用。
•  Lab 2: Build a basic design in System Generator, simulate the design, and then generate an FPGA bitstream for a target Xilinx technology.
    首先介绍了matlab simulink的使用;
    然后使用Xilinx block改写;注意必须使用Xilinx Gateway In / Gateway Out blocks 来定义FPGA的边界;设计中必须有 Xilinx System Generator™ token
    选中Xilinx模块,ctrl+G将其打包成一个模块,注意要包括Xilinx System Generator™ token
    采用不同的方案进行设计。如普通计算单元和DSP48单元。
•  Lab 3: Learn how signal routing blocks are used to re-define or modify fixed-point numbers at the bit-level.
•  Lab 4: Create a finite state machine using the Mcode block in System Generator.
    使用Mcode模块,通过m文件构建了一个状态机并在SG中验证。
•  Lab 5: Change sample rates in a multi-rate DSP design and then convert a serial data stream to a parallel data word and a parallel data word to a serial data stream.
•  Lab 6: Use a Xilinx ROM block to implement a trig or math function such as arcsin.
•  Lab 7: Include a System Generator model within a Vivado IDE design and combine that model with other RTL sources.
    在vivado中添加各种rtl资源的方法。
•  Lab 8: Import C/C++ source files into a System Generator model by leveraging the tool integration with Vivado High-Level Synthesis (HLS).
    HLS生成的模块导入SG中应用的方法。
    添加HLS模块:
        1. Add a Vivado HLS block by right clicking anywhere on the canvas workspace. 
        2. Select Xilinx BlockAdd and scroll down to the Vivado HLS block as shown in the figure below
        3. Double click the block and use the Browse button to select the solution created by Vivado HLS
•  Lab 9: Including a System Generator Design as a Module in an IP Integrator Design
     export a design as an IP module into the Vivado® IP Catalog.包括两个例子
    第一个,raw_interface:
        1. Double-click the System Generator token and verify that the IP Catalog compilation target is selected. 
        2. Verify that the Create testbench option is checked.
        3. Click the Settings button and configure the IP Packager Settings 
        4. Click OK, then click Generate on the System Generator token
        5. 在./ip目录下有生成的ip;在./ip_catalog有示例工程。
        6. Select Behavioral simulation;Run a validation check on this design to confirm the IP works within IP integrator.
    第二个,AXI4-Lite interface:
        很强大的例子,AXI4接口;Locate the ELF file and associate
•  Lab 10: AXI4-Lite Interface Synthesis
    how to package a System Generator design with a synthesized AXI4-Lite interface
    例子:rgb2gray
        1. 设置目录;打开文件;(另存为新文件);设置器件;仿真验证
        2. 设置模块 Gateway In block to an AXI4-Lite Slave Interface:双击模块--Implementation tab--set  Interface to AXI4-Lite.
        3.  package the design:双击 System Generator token,检查器件,语言,目录等项;click the Generate button 
        4. ip在./netlist/ip中;示例工程在./netlist/ip_catalog中。
        5. 打开工程;(validate)Generate Bitstream
        6. SDK:select Xilinx Tools > Repositories and add the full path to the directory containing the System Generator Model (…/netlist_mzed/ip) 
            Create a new Application Peripheral Tests Project 
            right-click the rgb2gray_bd_i Block Design instance and select Export Hardware to SDK.Launch SDK
        7. add repository:./netlist/ip
        8. 新建工程,修改源码,验证。               
•  Lab 11: Black Box Examples

3. 小结
  看起来可能是泛泛的,但是确实是个人学习过程中的笔记,还有部分直接记在pdf中了,可以在附件中(我的资源)查看。后续个人实际做了一个使用SG生成的IP并在实际中验证成功。不过实例比较简单,没有体现出matlab的强大之处。尽管SG对matlab提供了很多支持,但是很多matlab的代码、语法不能100%迁移使用,外加的第三方库估计更难使用了。(MCode模块的报错真心是**,而且网上还不好查,得慢慢积累了)


  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值