Skip to content

Enable the yosys flow for Gowin boards - #405

Merged
hendrikmennen merged 2 commits into
one-ware:mainfrom
timonix:feature/gowin-himbaechel
Oct 19, 2026
Merged

hendrikmennen merged 2 commits into
one-ware:mainfrom
timonix:feature/gowin-himbaechel

Conversation

@timonix

@timonix timonix commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

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 .fs bitstream. None of these
formats were supported.

What 1.
CST changes

New constraint file type cst. Like ccf, it is generated from the project's PCF file (which
the pin planner writes) into build/constraints.cst and passed to nextpnr as -o cst=....

ConstraintFileHelper now shares one PCF conversion between CCF and CST. Only the constraint
line format and the comment marker differ (# for CCF, // for CST). CCF output is
byte-identical to before. The PCF check and the "Converting ..." message moved into a small
helper in YosysService that both cases use.

API change: ConstraintFileHelper.Convert is got split into to ConvertPcfToCcf, next to the new
ConvertPcfToCst. It is public in the OneWare.OssCadSuiteIntegration package; I found no
callers 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.json and used as the
    pack 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 -o is only added
    for gowin_pack.

  • cst, json and fs are selectable in the Toolchain Settings dialog and documented in the
    fpga-toolchain-yosys skill. openFPGALoader already supported fs.

Example board settings (Tang Nano 9K)

yosysToolchainYosysSynthTool:     synth_gowin
yosysToolchainNextPnrTool:        nextpnr-himbaechel
yosysToolchainNextPnrFlags:       --device GW1NR-LV9QN88PC6/I5 --vopt family=GW1N-9C
yosysToolchainConstraintFileType: cst
yosysToolchainOutputType:         json
yosysToolchainPackTool:           gowin_pack
yosysToolchainPackFlags:          -d GW1N-9C
packToolOutputFormat:             fs

The TangNano9K package 0.4 ships these defaults.

@hendrikmennen
hendrikmennen merged commit 10fa28e into one-ware:main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants