Skip to content

Instantly share code, notes, and snippets.

@rniwase
Created January 30, 2024 17:07
Show Gist options
  • Save rniwase/d2d5b971b7e1c8e412d68dd786c76ae5 to your computer and use it in GitHub Desktop.
Save rniwase/d2d5b971b7e1c8e412d68dd786c76ae5 to your computer and use it in GitHub Desktop.
Build for Tang Primer 20K with yosys + nextpnr-himbaechel + apicula + openFPGALoader

Install dependencies

sudo apt-get install build-essential clang bison flex cmake libreadline-dev gawk tcl-dev \
                     libffi-dev git graphviz xdot pkg-config python3 libboost-all-dev zlib1g-dev \
                     python3-dev python3-pip clang-format libeigen3-dev

Install toolchains

  • apycula
pip3 install apycula
source ~/.profile
  • yosys
git clone https://github.com/YosysHQ/yosys.git
pushd ./yosys
make
sudo make install
popd
  • nextpnr-himbaechel
git clone https://github.com/YosysHQ/nextpnr.git
pushd ./nextpnr
cmake . -DARCH="himbaechel" -DHIMBAECHEL_GOWIN_DEVICES="all"
make -j$(nproc)
sudo make install
popd

Build blinky example

git clone https://github.com/YosysHQ/apicula.git
cd ./apicula/examples
yosys -D LEDS_NR=6 -D OSC_TYPE_OSC -p "read_verilog blinky.v; synth_gowin -json blinky.json"
nextpnr-himbaechel --json blinky.json --write pnrblinky.json --device GW2A-LV18PG256C8/I7 --vopt cst=primer20k.cst --vopt family=GW2A-18
gowin_pack -d GW2A-18 -o pack.fs pnrblinky.json
openFPGALoader -b tangprimer20k pack.fs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment