只是用PL核实现zedboard getting started with zynq里的LED控制demo。最终想要实现的效果如下。
-
新建工程
-
一路next,新建RTL Project然后不指定文件位置
-
继续next,板子选择Zedboard
-
添加源代码文件
module led_blink( output [7:0] leds, input sw, input clk, input rst ); reg [7:0] leds; reg [26:0] counter; always @(posedge clk) begin if (rst) begin counter <= 0; leds <= 8'b1; end else begin if (counter == 27'd5000000) begin if (sw) leds <= {leds[6:0], leds[7]}; else leds <= {leds[0], leds[7:1]}; counter <= 0; end else begin counter <= counter + 26'b1; end end end endmodule
-
添加端口描述文件
和上面添加源代码文件一样,create file
-
依次进行综合和实现
- 点击Open Implemented,注意选择
I/O Planning
布局
然后进行端口分配
- 最后生成比特流,Program到板子上就能看了。