initial commit

This commit is contained in:
2025-08-02 06:09:31 +03:00
commit 00015ffc03
85 changed files with 62051 additions and 0 deletions

30
BOARDS/run_gowin.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# --- CONFIGURATION ---
PROJECTNAME=SOC
DEVICE='GW2A-LV18PG256C8/I7'
BOARD='tangprimer20k'
BOARD_FREQ=27
CPU_FREQ=50
VERILOGS=$1
# --- Synthesis with Yosys ---
yosys -q -DPRIMER20K -DBOARD_FREQ=$BOARD_FREQ -DCPU_FREQ=$CPU_FREQ -D INV_BTN=0 -p "
read_verilog $VERILOGS;
synth_gowin -top $PROJECTNAME -json $PROJECTNAME.json -family gw2a" || exit 1
# --- Placement and Routing with nextpnr-himbaechel ---
nextpnr-himbaechel \
--json $PROJECTNAME.json \
--write $PROJECTNAME"_pnr.json" \
--device $DEVICE \
--vopt cst=BOARDS/$BOARD.cst \
--vopt family=GW2A-18 \
--freq $BOARD_FREQ || exit 1
# --- Bitstream Packing with gowin_pack ---
gowin_pack -d $DEVICE -o $PROJECTNAME.fs $PROJECTNAME"_pnr.json" || exit 1
# --- Programming with openFPGALoader ---
openFPGALoader -b tangprimer20k $PROJECTNAME.fs || exit 1