r/FPGA • u/Quirky_Voice_7582 • 19h ago
Gowin Related Open-source DDR3 + AXI4 controller for Tang Primer 20K in SpinalHDL (no Gowin DDR3 IP, up to ~585-960 MB/s)
Hi everyone! I want to share a project that took me quite a bit of work and that I hope will help many of you working on Gowin FPGAs.
I am currently a Computer Science student passionate about generative AI and electronics, and I bought my first FPGA (a Tang Primer 20K) back in August this year. While working on a hardware AI accelerator project, I needed fast AXI4 access to the DDR3 RAM without relying on Gowin's proprietary DDR3 IP. Since (to my knowledge) there was no standalone open-source AXI4/bursting controller available yet without going through Gowin's IP or pulling in all of LiteX, I experimented on this for about two months (with a break in between) atop nand2mario's open-source DDR3 primitive bring-up, which deserves a big thank you ( https://github.com/nand2mario/ddr3-tang-primer-20k ). Here is where things stand today.
The result is an open-source SpinalHDL Open-Page DDR3 controller with a 32/64/128-bit AXI4 bridge (plus pre-generated Verilog in hw/gen/), reaching around 585 MB/s in 64-bit and 960 MB/s in 128-bit on real hardware. There is also a small visual demo ready to flash with a prebuilt .fs bitstream and a Python script for your Tang Primer 20K: https://github.com/Juste-Leo2/tang-primer-20k-ddr3-axi4
I really hope this project can also help open-source efforts like LiteDRAM and nextpnr.