1
0
forked from tanchou/Verilog
This commit is contained in:
Gamenight77
2025-05-02 15:51:18 +02:00
parent 0faab53c30
commit f5e73d7379
105 changed files with 707398 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
@echo off
setlocal
rem === Config de base ===
set DEVICE=GW2AR-LV18QN88C8/I7
set BOARD=tangnano20k
set TOP=top_uart_loopback
set CST_FILE=%TOP%.cst
set SRC_FILE=../src/verilog/%TOP%.v
set JSON_FILE=%TOP%.json
set PNR_JSON=pnr_%TOP%.json
set BITSTREAM=%TOP%.fs
rem === Créer le dossier runs si nécessaire ===
if not exist ../runs (
mkdir ../runs
)
cd ../runs
echo === Étape 1 : Synthèse avec Yosys ===
yosys -p "read_verilog %SRC_FILE%; synth_gowin -json %JSON_FILE%"
if errorlevel 1 goto error
echo === Étape 2 : Placement & Routage avec nextpnr-himbaechel ===
nextpnr-himbaechel --json %JSON_FILE% --write %PNR_JSON% --device %DEVICE% --vopt cst=../constraints/%CST_FILE% --vopt family=GW2A-18C
if errorlevel 1 goto error
echo === Étape 3 : Packing avec gowin_pack ===
gowin_pack -d %DEVICE% -o %BITSTREAM% %PNR_JSON%
if errorlevel 1 goto error
echo === Étape 4 : Flash avec openFPGALoader ===
openFPGALoader -b %BOARD% %BITSTREAM%
if errorlevel 1 goto error
echo === ✅ Compilation et flash réussis ===
goto end
:error
echo === ❌ Une erreur est survenue ===
:end
endlocal
pause

View File

@@ -0,0 +1,4 @@
@echo off
echo === Nettoyage du dossier runs ===
rd /s /q runs
mkdir runs

View File

@@ -0,0 +1,3 @@
@echo off
echo === Lancement de GTKWave ===
gtkwave runs/uart_loopback.vcd

View File

@@ -0,0 +1,4 @@
@echo off
echo === Simulation avec Icarus Verilog ===
iverilog -g2012 -o runs/sim.vvp -s uart_tb src/verilog/*.v tests/verilog/*.v IP/verilog/*.v
vvp runs/sim.vvp