打破传统 发表于 2021-12-15 11:29

国产FPGA高云GW1N-4系列开发板测评之——软件篇1

本帖最后由 打破传统 于 2021-12-15 11:39 编辑

<p style="text-indent:31.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">硬件是基础,但要实现FPGA的价值,让更多的人用是这款FPGA得看厂商的软件和文档支持力度了,众所周知Xilinx是FPGA世界的老大,但是我用了这么多年的Vivado,不知道踩了多少坑,但是Xilinx的支持是很给力的特别是文档,文档很全,他们有专门管理文档的插件,查找也很方便。这也是国产FPGA厂商应该努力的方向。查看高云的官方网站</span></span></span></span></span><a href="http://www.gowinsemi.com.cn/prod_view.aspx?TypeId=10&amp;FId=t3:10:3&amp;Id=168" style="color:#0563c1; text-decoration:underline"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="letter-spacing:.75pt">http://www.gowinsemi.com.cn/prod_view.aspx?TypeId=10&amp;FId=t3:10:3&amp;Id=168</span></span></span></span></a></span></span></span><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">文档还是很多的,希望软件也给力,接下来我们就来学习高云的FPGA开发工具。</span></span></span></span></span></span></span></span></p>

<p style="text-indent:31.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">官网上定位到技术支持页面在下面的技术文档里可以找到SUG100文档,这个是Gowin云软件用户指南</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span lang="EN-US" style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt"><a href="http://www.gowinsemi.com.cn/down.aspx?FId=n14:14:26" style="color:#0563c1; text-decoration:underline">http://www.gowinsemi.com.cn/down.aspx?FId=n14:14:26</a></span></span></span></span></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">高云EDA软件在官网开发者专区中的高云云源软件中下载,由于网站上申请License慢,直接发了邮寄留言,高云的FAE随后就把License发过来了,</span></span></span></span></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">软件不大,安装很方便快捷,不像vivado现在都50G左右了</span></span></span></span></span></span></span></span> <span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">windos版本的高云软件200M不到,安装飕飕的<font color="#b01600" face="-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif,SimHei,SimSun" size="3">。</font></span></span></span></span></span></span></span></span><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">教育版不许要License,但是只有一个片子GW1NSR-LV4CQN48PC6/15可用,果断还是要申请License好。</span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">打开软件长这样,如上图,总感觉似曾相识,继续往下走。</span></span></span></span></span></span></span></span></p>

<p><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">新建个工程试试水,从FILE菜单、菜单栏的FILE图标或者Quick Start页都可以新建工程如下图:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">只需要几步就可以建好新工程如下图:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">在Design区右键就可以添加工程文件或者新建工程文件:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">我们新建一个verilog file如下图:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">软件会自动打开自带的编辑器有点不太习惯,没关系,一般都会自从使用第三方编辑器,像我以前使用过Ultraedit,现在经常用的是Notepad++,都还可以,主要有关键字突出显示,查找什么的很方便。添加第三方编辑器如下图:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify">&nbsp;<span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt"> 可以选择总用第三方软件打开,勾上即可:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">写一个小代码,测试一下按键led和时钟:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span lang="EN-US" style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">Ctrl+S</span></span></span></span></span><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">保存后点击Hierarchy,将刚建的test.v设置为顶层文件,这点我想给个小心的建议,一般我用过的几个软件都是有自动顶层功能的,这个功能可以加上,剩些步骤。</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">然后单击Process区域综合一下:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">右键run即可,完成综合:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">可以人为造一个错误看看软件的反应,</span></span></span></span></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">首先用它自带的编辑器这样好显示一点,然后注释掉一个end</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span lang="EN-US" style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">Ctrl+S</span></span></span></span></span><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">保存后在综合一下,错误信息打印在Console栏中了:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">&nbsp; 描述的很清楚错误在endmodule附近。</span></span></span></span></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">看了一下,不管是布局还是信息显示框的内容,特别是process区跟我以前使用过的Lattice的diamond如出一辙,感情是兄弟软件?低功耗FPGA产品软件是不是对标的就是Lattice?</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">&nbsp; 综合好后说明代码没什么错误了然后就可以绑定管脚和添加时钟约束了,首先添加管脚约束,软件会打开管脚约束绑定工具:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">查看DK_MINI_GW1N-LV4LQ144C6I5_V1.1用户手册快速找到管脚位置:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">这个地方有一点给大家提醒一下选中相关IO,IO Type能批量修改 这样比较方便,一般来讲相同bank的电压类型是一致的,如下图:&nbsp;</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify">&nbsp; <span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">保存后可以看到Design中添加了一个物理约束文件夹打开新建的管脚约束文件可以看到之前我们的一顿操作都生成了此语法约束文件,意思是你学习一下约束语法规则可以直接建个约束文件效果同上,详见SUG935。</span></span></span></span></span></span></span></span></p>

<p>&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">接下来是主时钟约束,打开时序约束编辑工具:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">单击时钟,空白处右键creat clk:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">设置名字、周期、端口后保存:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">看到Design中生成时序约束文件,打开文件可以看到我们生成的时钟约束文件跟VIVADO生成的一样标准的tcl,当然我们熟悉语法规则后可以直接写文件的方式添加约束。</span></span></span></span></span></span></span></span></p>

<p>&nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">接下来就是布局布线,生成bit文件,这个地方有一点建议Process区中可不可以加上bit流生成这一步,总感觉少点什么似的,而且打印Bit流生成完成能把路径也打印一下就更好了,第一次用还真不知道bit流在哪个文件夹下。</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">然后就是下载程序了,下载工具也很类似diamond,选择下载方式,Bit流文件路径,然而出错了如下图:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">这是一个ID code 错误,怎么回事呢,这怎么像是器件不匹配,往后拉一下滑动条可以看到我们选择的器件的IDcoder如下图:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">然后我检查了线缆连接也没问题:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">既然连接没问题,那我们读一下器件双击operation栏下编程模式调出模式配置窗口如下图:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">保存后单击program/configure键读出器件ID如下图:</span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">好吧恍然大悟,选错器件了,于是掉转枪头验证一下:</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">发现应该选择-4B时IDcode是一致的,好吧回到软件界面,重新Set Device为-4B器件:</span></span></span></span></span></p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">重新编译好工程后重新下载成功入后面视频中可见</span></span></span></span></span></span></span></span></p>

<p style="text-align:justify"> &nbsp; &nbsp;</p>

<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="text-justify:inter-ideograph"><span style="font-size:14.0pt"><span style="background:white"><span style="font-family:宋体"><span style="color:#444444"><span style="letter-spacing:.75pt">&nbsp;这一篇我们总体上学习了软件使用的流程,下一篇我们去研究一下看看还有没有其他隐藏的功能分享给大家</span></span></span></span></span></span></span></span></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p style="text-align:justify">&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p style="text-align:justify">&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p style="text-align:justify">&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

nmg 发表于 2021-12-15 14:22

<p><img height="50" src="https://bbs.eeworld.com.cn/static/editor/plugins/hkemoji/sticker/facebook/funk1.gif" width="53" /><span style="color:#444444">vivado真的现在都50G左右了?是不是多加了个0?</span></p>

打破传统 发表于 2021-12-16 13:04

nmg 发表于 2021-12-15 14:22
vivado真的现在都50G左右了?是不是多加了个0?

<p>没图没真相是吧<img height="52" src="https://bbs.eeworld.com.cn/static/editor/plugins/hkemoji/sticker/facebook/titter.gif" width="48" /><br />
&nbsp;</p>
页: [1]
查看完整版本: 国产FPGA高云GW1N-4系列开发板测评之——软件篇1