Steward
分享是一種喜悅、更是一種幸福
微處理器 - Gowin GW1NZ-LV1QN48C6/I5 (Lichee Tang Nano 1K) - Verilog - LED
參考資訊:
https://github.com/sifferman/tangnano_example
https://github.com/racerxdl/tangnano-yosys-hello
main.v
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | module main ( input clk, output reg led ); reg [23:0] clk_cnt; always @( posedge clk) begin if (clk_cnt == 24'd10000000) clk_cnt <= 24'd0; else clk_cnt <= clk_cnt + 1; if (clk_cnt == 24'd10000000) led <= ~led; end endmodule |
main.cst
IO_LOC "led" 9; IO_LOC "clk" 47;
Makefile
all: yosys -p "synth_gowin -json main.json -top main" main.v nextpnr-gowin --json main.json --write main.pack --device GW1NZ-LV1QN48C6/I5 --cst main.cst gowin_pack -d GW1NZ-LV1QN48C6/I5 -o main.fs main.pack ram: openFPGALoader -m -b tangnano1k main.fs flash: openFPGALoader -f -b tangnano1k main.fs clean: rm -f *.json *.fs *.pack
編譯、下載
$ make $ make ram
完成