Added examples/gowin/
authorClifford Wolf <clifford@clifford.at>
Mon, 7 Nov 2016 11:55:56 +0000 (12:55 +0100)
committerClifford Wolf <clifford@clifford.at>
Mon, 7 Nov 2016 11:55:56 +0000 (12:55 +0100)
examples/gowin/.gitignore [new file with mode: 0644]
examples/gowin/README [new file with mode: 0644]
examples/gowin/demo.cst [new file with mode: 0644]
examples/gowin/demo.sdc [new file with mode: 0644]
examples/gowin/demo.v [new file with mode: 0644]
examples/gowin/run.sh [new file with mode: 0644]

diff --git a/examples/gowin/.gitignore b/examples/gowin/.gitignore
new file mode 100644 (file)
index 0000000..823caa1
--- /dev/null
@@ -0,0 +1,6 @@
+demo.bit
+demo.out
+demo.rpt
+demo_syn.v
+demo_out.v
+demo_tr.html
diff --git a/examples/gowin/README b/examples/gowin/README
new file mode 100644 (file)
index 0000000..0194e9f
--- /dev/null
@@ -0,0 +1,17 @@
+Simple test project for Gowinsemi GW2A-55K Eval Board Mini.
+
+Follow the install instructions for the Gowinsemi tools below,
+then run "bash run.sh" in this directory.
+
+
+Install instructions for gowinTool_linux
+----------------------------------------
+
+1.) extract gowinTool_linux.zip
+
+2.) set GOWIN_HOME env variable to the full path to the
+gowinTool_linux directory
+
+3.) edit gowinTool_linux/bin/gwlicense.ini. Set lic="..." to
+the full path to the license file.
+
diff --git a/examples/gowin/demo.cst b/examples/gowin/demo.cst
new file mode 100644 (file)
index 0000000..0b14b5b
--- /dev/null
@@ -0,0 +1,17 @@
+IO_LOC "clk"    D11;
+IO_LOC "led1"   D22;
+IO_LOC "led2"   E22;
+IO_LOC "led3"   G22;
+IO_LOC "led4"   J22;
+IO_LOC "led5"   L22;
+IO_LOC "led6"   L19;
+IO_LOC "led7"   L20;
+IO_LOC "led8"   M21;
+IO_LOC "led9"   N19;
+IO_LOC "led10"  R19;
+IO_LOC "led11"  T18;
+IO_LOC "led12"  AA22;
+IO_LOC "led13"  U18;
+IO_LOC "led14"  V20;
+IO_LOC "led15"  AA21;
+IO_LOC "led16"  AB21;
diff --git a/examples/gowin/demo.sdc b/examples/gowin/demo.sdc
new file mode 100644 (file)
index 0000000..6c90325
--- /dev/null
@@ -0,0 +1 @@
+create_clock -name clk -period 20 -waveform {0 10} [get_ports {clk}]
diff --git a/examples/gowin/demo.v b/examples/gowin/demo.v
new file mode 100644 (file)
index 0000000..e1a2f19
--- /dev/null
@@ -0,0 +1,11 @@
+module demo (
+       input clk,
+       output led1, led2, led3, led4, led5, led6, led7, led8,
+       output led9, led10, led11, led12, led13, led14, led15, led16
+);
+       localparam PRESCALE = 20;
+       reg [PRESCALE+3:0] counter = 0;
+       always @(posedge clk) counter <= counter + 1;
+       assign {led1, led2, led3, led4, led5, led6, led7, led8,
+               led9, led10, led11, led12, led13, led14, led15, led16} = 1 << counter[PRESCALE +: 4];
+endmodule
diff --git a/examples/gowin/run.sh b/examples/gowin/run.sh
new file mode 100644 (file)
index 0000000..738e845
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -ex
+yosys -p "synth_gowin -top demo -vout demo_syn.v" demo.v
+$GOWIN_HOME/bin/gowin -d demo_syn.v -cst demo.cst -sdc demo.sdc -p GW2A55-PBGA484-6 \
+               -warning_all -out demo_out.v -rpt demo.rpt -tr demo_tr.html -bit demo.bit