From 6cf5157fe7a8f4299a002f1be6c95ba5507a2cd4 Mon Sep 17 00:00:00 2001 From: Pepijn de Vos Date: Wed, 4 Sep 2019 10:52:28 +0200 Subject: Update example for GW1NR-9 This uses the Trenz TEC0117 on Gowin IDE 1.8.4 --- examples/gowin/demo.cst | 51 ++++++++++------------------------------------- examples/gowin/demo.v | 5 +---- examples/gowin/device.cfg | 16 +++++++++++++++ examples/gowin/run.sh | 3 +-- 4 files changed, 28 insertions(+), 47 deletions(-) create mode 100644 examples/gowin/device.cfg (limited to 'examples') diff --git a/examples/gowin/demo.cst b/examples/gowin/demo.cst index 22d7eb668..c8f89dcf8 100644 --- a/examples/gowin/demo.cst +++ b/examples/gowin/demo.cst @@ -1,41 +1,10 @@ -// 50 MHz Clock -IO_LOC "clk" D11; - -// LEDs -IO_LOC "leds[0]" D22; -IO_LOC "leds[1]" E22; -IO_LOC "leds[2]" G22; -IO_LOC "leds[3]" J22; -IO_LOC "leds[4]" L22; -IO_LOC "leds[5]" L19; -IO_LOC "leds[6]" L20; -IO_LOC "leds[7]" M21; -IO_LOC "leds[8]" N19; -IO_LOC "leds[9]" R19; -IO_LOC "leds[10]" T18; -IO_LOC "leds[11]" AA22; -IO_LOC "leds[12]" U18; -IO_LOC "leds[13]" V20; -IO_LOC "leds[14]" AA21; -IO_LOC "leds[15]" AB21; - - -// 7-Segment Display -IO_LOC "seg7dig[0]" E20; -IO_LOC "seg7dig[1]" G18; -IO_LOC "seg7dig[2]" G20; -IO_LOC "seg7dig[3]" F21; -IO_LOC "seg7dig[4]" J20; -IO_LOC "seg7dig[5]" H21; -IO_LOC "seg7dig[6]" H18; -IO_LOC "seg7dig[7]" D20; -IO_LOC "seg7sel[0]" C19; -IO_LOC "seg7sel[1]" B22; -IO_LOC "seg7sel[2]" C20; -IO_LOC "seg7sel[3]" C21; - -// Switches -IO_LOC "sw[0]" AB20; -IO_LOC "sw[1]" AB19; -IO_LOC "sw[2]" AB18; -IO_LOC "sw[3]" AB17; +IO_LOC "clk" 35; +//IO_LOC "rst_n" 77; +IO_LOC "leds[0]" 79; +IO_LOC "leds[1]" 80; +IO_LOC "leds[2]" 81; +IO_LOC "leds[3]" 82; +IO_LOC "leds[4]" 83; +IO_LOC "leds[5]" 84; +IO_LOC "leds[6]" 85; +IO_LOC "leds[7]" 86; \ No newline at end of file diff --git a/examples/gowin/demo.v b/examples/gowin/demo.v index 6ea108384..3cb782fa7 100644 --- a/examples/gowin/demo.v +++ b/examples/gowin/demo.v @@ -1,9 +1,6 @@ module demo ( input clk, - input [3:0] sw, - output [15:0] leds, - output [7:0] seg7dig, - output [3:0] seg7sel + output [15:0] leds ); localparam PRESCALE = 20; reg [PRESCALE+3:0] counter = 0; diff --git a/examples/gowin/device.cfg b/examples/gowin/device.cfg new file mode 100644 index 000000000..f6ab82159 --- /dev/null +++ b/examples/gowin/device.cfg @@ -0,0 +1,16 @@ +set JTAG regular_io = false +set SSPI regular_io = false +set MSPI regular_io = false +set READY regular_io = false +set DONE regular_io = false +set RECONFIG_N regular_io = false +set MODE regular_io = false +set CRC_check = true +set compress = false +set encryption = false +set security_bit_enable = true +set bsram_init_fuse_print = true +set download_speed = 250/100 +set spi_flash_address = 0x00FFF000 +set format = txt +set background_programming = false diff --git a/examples/gowin/run.sh b/examples/gowin/run.sh index 33a7b5c37..cd260101e 100644 --- a/examples/gowin/run.sh +++ b/examples/gowin/run.sh @@ -1,8 +1,7 @@ #!/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 +$GOWIN_HOME/bin/gowin -d demo_syn.v -cst demo.cst -sdc demo.sdc -p GW1NR-9-QFN88-6 -pn GW1NR-LV9QN88C6/I5 -cfg device.cfg -bit -tr -ph -timing -gpa -rpt -warning_all # post place&route simulation (icarus verilog) if false; then -- cgit v1.2.3 From 072367245184528de0907f48ed45af79901d93eb Mon Sep 17 00:00:00 2001 From: Pepijn de Vos Date: Wed, 4 Sep 2019 10:58:48 +0200 Subject: Add demonstration of breakage Unused outputs lead to undriven buffers, which lead to syntax errors. --- examples/gowin/demo.v | 1 + 1 file changed, 1 insertion(+) (limited to 'examples') diff --git a/examples/gowin/demo.v b/examples/gowin/demo.v index 3cb782fa7..f5c001893 100644 --- a/examples/gowin/demo.v +++ b/examples/gowin/demo.v @@ -1,6 +1,7 @@ module demo ( input clk, output [15:0] leds + //,output unused ); localparam PRESCALE = 20; reg [PRESCALE+3:0] counter = 0; -- cgit v1.2.3 From 06062090dacf868b2a4eda32152c188a1b8be089 Mon Sep 17 00:00:00 2001 From: Pepijn de Vos Date: Wed, 4 Sep 2019 14:47:59 +0200 Subject: add broken TCL run script --- examples/gowin/pnr.cfg | 8 ++++++++ examples/gowin/run.tcl | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 examples/gowin/pnr.cfg create mode 100644 examples/gowin/run.tcl (limited to 'examples') diff --git a/examples/gowin/pnr.cfg b/examples/gowin/pnr.cfg new file mode 100644 index 000000000..a1b43cc3b --- /dev/null +++ b/examples/gowin/pnr.cfg @@ -0,0 +1,8 @@ +-sdf +-oc +-ibs +-posp +-o +-warning_all +-tt +-timing diff --git a/examples/gowin/run.tcl b/examples/gowin/run.tcl new file mode 100644 index 000000000..7bb5648e5 --- /dev/null +++ b/examples/gowin/run.tcl @@ -0,0 +1,10 @@ +# gw_sh run.tcl +exec yosys -p "synth_gowin -top demo -vout demo_syn.v" demo.v +add_file -cst demo.cst +add_file -sdc demo.sdc +add_file -vm demo_syn.v +add_file -cfg device.cfg +add_setting -pnr pnr.cfg +set_option -device GW1NR-9-QFN88-6 +set_option -pn GW1NR-LV9QN88C6/I5 +run_pnr -- cgit v1.2.3 From d65a47c86d4ccc89db419638896fefd3b2324588 Mon Sep 17 00:00:00 2001 From: Pepijn de Vos Date: Wed, 4 Sep 2019 15:35:33 +0200 Subject: fix tcl script --- examples/gowin/run.tcl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/gowin/run.tcl b/examples/gowin/run.tcl index 7bb5648e5..39da11cee 100644 --- a/examples/gowin/run.tcl +++ b/examples/gowin/run.tcl @@ -4,7 +4,6 @@ add_file -cst demo.cst add_file -sdc demo.sdc add_file -vm demo_syn.v add_file -cfg device.cfg -add_setting -pnr pnr.cfg set_option -device GW1NR-9-QFN88-6 set_option -pn GW1NR-LV9QN88C6/I5 -run_pnr +run_pnr -opt pnr.cfg -- cgit v1.2.3 From ae93c034adc8a7d14a9f39175dacdddda75ea7a2 Mon Sep 17 00:00:00 2001 From: Pepijn de Vos Date: Wed, 4 Sep 2019 16:29:40 +0200 Subject: set undriven pads to zero --- examples/gowin/demo.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/gowin/demo.v b/examples/gowin/demo.v index f5c001893..485fec97f 100644 --- a/examples/gowin/demo.v +++ b/examples/gowin/demo.v @@ -1,7 +1,7 @@ module demo ( input clk, - output [15:0] leds - //,output unused + output [15:0] leds, + output unused ); localparam PRESCALE = 20; reg [PRESCALE+3:0] counter = 0; -- cgit v1.2.3