Starter kit for the Sipeed Tang Primer 20K (Gowin GW2A-LV18PG256C8/I7) on the Dock carrier: a verified pinout, working example designs with self-checking testbenches, a command-line build/sim/program flow, and Claude Code skills. Use it as the starting point for new Tang Primer 20K projects.
- Copy the closest example as a template (e.g.
knight_rider/for plain logic,hdmi/for video):cp -r knight_rider my_design && rm -rf my_design/impl - Edit
src/top.v, take pins fromdocs/pinout.mdintosrc/top.cst, and list every source file inbuild.tcl. - Write
sim/tb_top.vso it printsPASSand exits 0 ($fatal(1, ...)on failure); run it. gw_sh build.tcl, checkimpl/pnr/top.logand the timing summary, then load into SRAM.
With Claude Code, ask the fpga-engineer agent to do the whole loop.
All verified on hardware. Each has src/, a self-checking testbench in sim/, and build.tcl.
| Project | What | Uses |
|---|---|---|
knight_rider/ |
Larson scanner across the 6 LEDs with a fading PWM tail | LEDs, S1 |
neopixel/ |
Rainbow on the onboard WS2812B; reusable ws2812.v driver |
WS2812 (T9), S1 |
hdmi/ |
720×480p colour bars, caption + drop-frame timecode, 1 kHz tone over HDMI audio | HDMI, rPLL, OSER10, TLVDS |
docs/pinout.md— every Dock/SOM pin: banks and voltages, LEDs, keys, switches, HDMI, Ethernet, USB PHY, LCD, camera, audio, mic, PMODs, SD, shared-pin conflicts, required build options.docs/Schematics/— Dock + SOM schematics, Gowin UG290 programming guide.
| Tool | Path |
|---|---|
| Gowin EDA 1.9.12.04 | C:\Gowin\Gowin_V1.9.12.04_x64 (IDE\bin\gw_sh, Programmer\bin\programmer_cli) |
| Icarus Verilog 12 + GTKWave | C:\iverilog\bin, C:\iverilog\gtkwave\bin |
Typical loop, from a project directory:
/c/iverilog/bin/iverilog -g2012 -o sim/tb.vvp sim/tb_top.v src/*.v && /c/iverilog/bin/vvp -n sim/tb.vvp /c/Gowin/Gowin_V1.9.12.04_x64/IDE/bin/gw_sh build.tcl cd /c/Gowin/Gowin_V1.9.12.04_x64/Programmer/bin && ./programmer_cli -d GW2A-18C --run 2 --fsFile "<abs path>\impl\pnr\top.fs"
--run 2 loads SRAM (temporary); --run 36 writes the boot flash.
- Skills in
.claude/skills/:tp20k-build,tp20k-sim,tp20k-program. - Agent in
.claude/agents/:fpga-engineer— spec → RTL → sim → build → program.
- LEDs are active low; keys S2–S5 and SW2–5 are on the 1.5 V bank (
LVCMOS15). set_option -use_sspi_as_gpio 1is required for T10 (S1/reset), T9, C10, N9, M8.- Keep DIP SW1 ON at power-up — it's wired to RECONFIG_N.
Kept locally, excluded by .gitignore:
- Dock 3D models (
docs/3D model/*.step, ~100 MB each, over GitHub's file limit) — from Sipeed's Tang Primer 20K downloads: https://dl.sipeed.com/shareURL/TANG/Primer_20K - Gowin UG290 Programming and Configuration Guide — https://www.gowinsemi.com (Documentation)
MIT © 2026 Terence Ang — covers the HDL, testbenches, scripts, skills and docs written here.
hdmi/src/hdmi/ and hdmi/sim/include/ come from the author's Apple_TN20K project, also MIT.
Third-party material is not covered by the MIT license and remains its owners' property:
the Sipeed schematics in docs/Schematics/ (© Shenzhen Sipeed Technology Co., Ltd.), included
for reference. docs/pinout.md is derived from them.