Repository navigation
Enable the yosys flow for Gowin boards - #405
Merged
Merged
Conversation
hendrikmennen
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The yosys toolchain could not build for Gowin FPGAs: nextpnr-himbaechel needs a CST constraint
file and writes its result as JSON, and gowin_pack produces an
.fsbitstream. None of theseformats were supported.
What 1.
CST changes
New constraint file type
cst. Likeccf, it is generated from the project's PCF file (whichthe pin planner writes) into
build/constraints.cstand passed to nextpnr as-o cst=....ConstraintFileHelpernow shares one PCF conversion between CCF and CST. Only the constraintline format and the comment marker differ (
#for CCF,//for CST). CCF output isbyte-identical to before. The PCF check and the "Converting ..." message moved into a small
helper in
YosysServicethat both cases use.API change:
ConstraintFileHelper.Convertis got split into toConvertPcfToCcf, next to the newConvertPcfToCst. It is public in the OneWare.OssCadSuiteIntegration package; I found nocallers outside this module. The old one still works, but I added a deprecated flag, in case there are extensions using it.
What 2.
JSON, .fs changes
These were already supported by yosys and oss cad suite, but were not possible to access.
New place & route output type
json, written with--write build/pnr.jsonand used as thepack tool's input.
New pack output format
fs(build/pack.fs). gowin_pack takes the output file as-o <file>, while icepack and ecppack take it as the second argument, so-ois only addedfor gowin_pack.
cst,jsonandfsare selectable in the Toolchain Settings dialog and documented in thefpga-toolchain-yosysskill. openFPGALoader already supportedfs.Example board settings (Tang Nano 9K)
The TangNano9K package 0.4 ships these defaults.