Tang Nano 9K - a (n almost) perfect 65(x)xx platform

Topics relating to PALs, CPLDs, FPGAs, and other PLDs used for the support or creation of 65-family processors, both hardware and HDL.
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: Tang Nano 9K - a (n almost) perfect 65(x)xx platform

Post by enso »

Command-line builds using GOWIN tools

Gowin tools have a built-in Tcl scripting capability. In particular, the binary gw-sh is a command-line version of the toolchain, which allows you to manually load the files, configure options, and run synthesis and/or pnr.

This would be very tedious, but you can send it a script containing something like:

Code: Select all

add_file -type verilog "/home/stack/Desktop/work/nano9k/ALUtest/src/top.v"
add_file -type cst "/home/stack/Desktop/work/nano9k/ALUtest/src/tangnano9k.cst"
set_device GW1NR-LV9QN88PC6/I5 -device_version C
set_option -synthesis_tool gowinsynthesis
set_option -output_base_name fpga_project
set_option -gen_text_timing_rpt 1
run all
If you find that tedious, just open an IDE project like you always do, select 'console' at the bottom, and enter saveto script.tcl (use a name that would make sense, of course). It will have everything except the final run all, which you should add yourself.

See the appropriate manual (SUG100-4.1E_Gowin Software User Guide.pdf), and explore by dumping your project from the IDE, using saveto -all_options <filename>. You may have to remove some options that cause errors for some reason, but you get the idea.

For an extra credit, create a Makefile. Now you are a real power user.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
User avatar
enso
Posts: 904
Joined: 29 Sep 2012

Re: Tang Nano 9K - a (n almost) perfect 65(x)xx platform

Post by enso »

I'm running out of steam.

I cleaned up my 65c02 system -- it now contains the bitstream, so you can
  • * load the provided .fs bitstream with OpenFPGALoader or whatever;
    * build using the opensource toolchain with the attached Makefile;
    * build using the GOWIN IDE - the project file is attached;
    * build using GOWIN's gw-sh command-line tcl tool, using the attached tcl script.
https://tildegit.org/stack/Tangnano9K-65c02-experiments
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
lak
Posts: 14
Joined: 11 Sep 2011
Location: Singapore

Re: Tang Nano 9K - a (n almost) perfect 65(x)xx platform

Post by lak »

Hi,
Tried out the 65c02 experiment core but nothing was seen on the Teraterm terminal. Any key presses will lit the led.
I also added the full path to the rom.init file and processed the project under Gowin Ide. The Gowin nano 9k uart examples all verified to be working.
enso1
Posts: 197
Joined: 30 Jul 2024

Re: Tang Nano 9K - a (n almost) perfect 65(x)xx platform

Post by enso1 »

I am away from the 9K board, and just got the 20K, so cannot test directly, but the same project (yes, the paths were off for the IDE) loaded into the 20K, and is showing "GOWIN 65c02 Send bin..."

Check that your terminal is set to 115200-8-N-1...

NOTE: copying the 9K files to the 20K, I had the reset button wired backwards, and the system ran as long as the button was held down! I can't verify if the 9K has the same issue -- give it a look. NO, the Nano20K buttons are wired to go high on press, while 9K buttons are grounded on press...
Post Reply