FPGA学习(Zynq)01——NAND_gate

开发板:ZedBoard

项目:创建一个与非门

Step 1:新建项目(如果在选择开发板时没有自己的开发板,可以点击“refresh”从Git获取)

Step 2:添加源文件(NAND_gate.v)

Step 3:添加约束文件(physical_constr.xdc)

Step 4:create block design,添加“ZYNQ7 Processing System”

 双击“Run Block Automation”,点击OK:

得到“DDR”、“FIXED_IO” 连接:

Step 5:在source中找到module(NAND_gate.v),右键,将module添加至block design:

 Step 6:在block design中添加AXI_GPIO块,用于module和Zynq的通信

AXI GPIO属于PL的一部分,允许Zynq processing system通过PL和外界交互(access the outside world through the programmable logic) 。

在本项目中,需要两个AXI GPIO块。

点击“Run Connection Automation”,勾选如下:

 (不勾选“GPIO”因为我们使用自己的GPIO)

Step 7:“axi_gpio_0”将和与非门的输出相连,并通过这些布线输入到Zynq处理系统。 

("axi_gpio_0" is gonna to be connected to the output of the NAND gate module, and is inputting back through these wires all the way into the processing system.) 

双击“axi_gpio_0”块,找到“IP Configuration”:

因为这个块将作为input,所以勾选“All Inputs”,GPIO Width选择1位就够了。不要勾选“Enable Dual Channel”,因为这个块暂时是单通道的(single channel)。点击“OK”。

 连接“NAND_gate”块和“axi_gpio_0”块(注意gpio_io端口要是input,即向左的三角标志):

点击NAND_gate模块的b端口,按Ctrl+T创建外部连接:

想使用开关控制创建的外部连接,只需要将名称改为约束文件里开关对应的端口名即可。

同样方法设置好另一个端口a后,点击“regenerate layout”优化布局:

开关sw0和swi输入到FPGA模块(PL),与非门的输出进入axi_gpio_0模块(即连接FPGA和Zynq的模块)

(sw1,sw0 inputs to FPGA fabric, the output of NAND block goes into axi_gpio_0 block which is a connection from the FPGA fabric to the Zynq processor.)

Step 8:连接Zynq处理器和外部LED

(这里使用到了另一个axi_Gpio模块)

配置axi_gpio_1:

Step 9:创建HDL wrapper

合并所有模块。

(HDL wrapper is something that wraps around the entire all the instantiations of these different blocks or instances, and it essentially forms it into one module.)

Step 10:生成bit文件

 

成功后导出:

 

报错:'get_property' expects at least one object.

若出现此类报错,将自定义模块设为顶层模块:(之前的步骤默认将design_1_wrapper设为顶层模块了)

 解决方式参考:AMD Customer Community

之后重新“Run Synthesis”

“Run implementation”

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值