aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/gowin/.gitignore6
-rw-r--r--examples/gowin/README17
-rw-r--r--examples/gowin/demo.cst17
-rw-r--r--examples/gowin/demo.sdc1
-rw-r--r--examples/gowin/demo.v11
-rw-r--r--examples/gowin/run.sh5
6 files changed, 57 insertions, 0 deletions
diff --git a/examples/gowin/.gitignore b/examples/gowin/.gitignore
new file mode 100644
index 000000000..823caa1d7
--- /dev/null
+++ b/examples/gowin/.gitignore
@@ -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
index 000000000..0194e9f09
--- /dev/null
+++ b/examples/gowin/README
@@ -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
index 000000000..0b14b5bd6
--- /dev/null
+++ b/examples/gowin/demo.cst
@@ -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
index 000000000..6c90325fa
--- /dev/null
+++ b/examples/gowin/demo.sdc
@@ -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
index 000000000..e1a2f19ec
--- /dev/null
+++ b/examples/gowin/demo.v
@@ -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
index 000000000..738e845e5
--- /dev/null
+++ b/examples/gowin/run.sh
@@ -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