[国产FPGA高云GW1N 系列开发板测评]——(2)点灯和流水灯
本帖最后由 chg0823 于 2021-12-16 00:39 编辑<p align="center" style="text-align:center; text-indent:21.0pt"> </p>
<p style="text-indent:24.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">收到高云FPGA GW1N-4B开发板</span></span></span><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">,打开一看感到很吃惊,竟然接了那么多</span></span></span><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="font-family:"Calibri",sans-serif"><span style="color:#333333">LED</span></span></span></span><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">,可以花样点灯了(开个玩笑),其实是在调试功能或者遇到问题都可以通过点灯测试,而且在有些时候可以直接先用灯观测功能,尤其实在调某些协议的时候,而且开发板还带有数码管,这样可以方便显示一些数据。</span></span></span></span></span></p>
<p> </p>
<p style="text-indent:24.0pt; text-align:justify"> </p>
<p><em>1</em>、 <span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">点灯</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> </span></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">只需将LED灯对应的引脚拉低即可。</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"><i>2</i>、闪灯:</span></span></span></span></span> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">1).编写输入输出以及时钟</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">module Blink_LED</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">(</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> input sys_clk50M,</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> output led</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">);</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">2).编写延时或者计时模块</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">always @(posedge sys_clk50M ) </span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">begin</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> if( clk_count ==clk_ms )</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> clk_count <=0;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> else </span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> clk_count <= clk_count + 1'd1;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">end</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">3).赋值</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">always @(posedge sys_clk50M ) </span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">begin</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> if(clk_count == clk_ms)</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> nled <= ~nled;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">end</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">assign led = nled;</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">4).根据原理图编写物理约束(可以自己编写,也可以在FloorPlanner中进行分配)</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 130;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "sys_clk50M" 98;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "sys_clk50M" IO_TYPE =LVCMOS33;</span></span></span></span></span> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">5).</span></span></span></span></span><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">简单的功能可以直接编译然后下板子测试,如果想仿真的话,编写一个testbench,用Modelsim或者高云自己的仿真工具进行仿真,最后下板测试,发现D7的led灯在闪烁。</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"><i>3</i>、流水灯</span></span></span></span></span> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">1)编写输入输出以及时钟</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">module Blink_LED</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">(</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> input sys_clk50M,</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> output led</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">);</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">2)编写延时或者计时模块</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">always @(posedge sys_clk50M ) </span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">begin</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> if( clk_count ==clk_ms )</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> clk_count <=0;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> else </span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> clk_count <= clk_count + 1'd1;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">end</span></span></span></span></span> </p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">3)赋值</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">reg nled = 16'b1111_1111_1111_1110;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">assign led = nled;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">always @(posedge sys_clk50M ) </span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">begin</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> if(clk_count == clk_ms)</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333"> nled <={nled,nled};</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">end</span></span></span></span></span> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">4)根据原理图编写物理约束(可以自己编写,也可以在FloorPlanner中进行分配)</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 130;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 128;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 124;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 122;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 120;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 118;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 116;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 114;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 129;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 126;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 123;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 121;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 119;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 117;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 115;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "led" 113;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_LOC "sys_clk50M" 98;</span></span></span></span></span></p>
<p> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "led" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span lang="EN-US" style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">IO_PORT "sys_clk50M" IO_TYPE =LVCMOS33;</span></span></span></span></span></p>
<p><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">5)可以直接编译然后下板子测试,发现16个的led灯轮流循环在闪烁。</span></span></span></span></span></p>
<p> </p>
<p> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:等线"><span style="font-size:12.0pt"><span style="background:white"><span style="color:#333333">最后,吐槽一下,高云的原理图有点乱^_-,整理引脚得花好多时间啊!!!</span></span></span></span></span></p>
<p> </p>
<p> </p>
<p>点灯好像是开发板常规步骤了</p>
<p>楼主有空可否讲一下用Modelsim仿真步骤</p>
Jacktang 发表于 2021-12-16 07:28
点灯好像是开发板常规步骤了
楼主有空可否讲一下用Modelsim仿真步骤
<p>好的</p>
FPGA有国产的了?性能如何?现在许多芯片都被断供,就连打印机都涨价,希望我们的芯片能够快速成长起来 预提虎牙 发表于 2021-12-16 09:35
FPGA有国产的了?性能如何?现在许多芯片都被断供,就连打印机都涨价,希望我们的芯片能够快速成长起来
<p>国产的FPGA有很多的,民用FPGA的高云还是比较流行的,性能也还行,现在国产芯片一步步好起来了</p>
【高云的原理图有点乱^_-,整理引脚得花好多时间啊】难道这是国产的通病吗
页:
[1]