Free Toolchain NotesThe free toolchain is an amazing achievement, but it has its issues.
It is slow. My Tugman project (an 18-bit CPU SOC taking up about 500 LUTs, ~6% of FPGA resources), builds in the Chinese IDE in 10 seconds flat on an 8th-gen I7 box. The free toolchain took 4 times as long. So I will not be using it for iterative develpment.
But it is a flexible tool for digging into the FPGA, viewing it in a way not possible in the IDE, and performing experiments to supplement our understanding of how it is wired up internally.
In particular, with some cajoling, it is possible to pull up an 'FPGA Editor'-like view of the fpga and trace BELs and wires.
But in order to do so, you need to use nextpnr-gowin (instead of the more up-to-date nextpnr-himbaechel) in --gui mode (because nextpnr-himbaechel does not show anything in gui mode!), and you need to patch nextpnr-gowin prior to compiling to prevent crashes... Yeah, I almost gave up on it but then figured it out anyway. The patch is documented here:
https://github.com/rfuest/nextpnr/commit/e4c09a1011f2df9b77f9360f14f58af6ab1f5e1c.
Anyway, the best starting point if you want to use it with Gowin is
https://learn.lushaylabs.com/os-toolchain-manual-installation/, except you want to add -DBUILD_GUI=ON (and make sure qt5 dependencies are met -- read the README.md). Also, build nextpnr-himbaechel, since you will be using that mostly, without gui).
There are a few hazards ahead -- getting the damn Python and pyenv to work, and in my case, having to `export LD_LIBRARY_PATH=~/.pyenv/versions/3.9.13/lib` anyway for some reason. I hate Python -- the most unstable crap language there is, but everything depends on it. When some jackass who maintains an unknown library decides to change the name of some variable from current_version to current-version, everything comes crashing down.
Apycula, the project reverse-engineering Gowin, has some interesting documentation, worth looking at on github.
https://github.com/YosysHQhttps://github.com/YosysHQ/nextpnrhttps://github.com/YosysHQ/apicula