2021-11-30 00:32:51 +00:00
dst := IP
2023-04-21 16:08:35 +00:00
2024-08-15 18:56:55 +00:00
all : ArtyA 7
2022-10-24 20:38:39 +00:00
2024-08-15 18:56:55 +00:00
.PHONY : ArtyA 7 vcu 118 vcu 108
2022-10-24 20:38:39 +00:00
2024-08-15 18:56:55 +00:00
ArtyA7 : export XILINX_PART := xc 7a 100tcsg 324-1
ArtyA7 : export XILINX_BOARD := digilentinc .com :arty -a 7-100:part 0:1.1
ArtyA7 : export board := ArtyA 7
2024-09-02 21:23:16 +00:00
ArtyA7 : export SYSTEMCLOCK := 20000000
2024-09-03 17:55:15 +00:00
ArtyA7 : export MAXSDCCLOCK := 5000000
2024-08-15 18:56:55 +00:00
ArtyA7 : FPGA_Arty
2021-11-30 00:32:51 +00:00
2024-08-15 18:56:55 +00:00
vcu118 : export XILINX_PART := xcvu 9p -flga 2104-2L -e
vcu118 : export XILINX_BOARD := xilinx .com :vcu 118:part 0:2.4
vcu118 : export board := vcu 118
2024-09-02 21:23:16 +00:00
vcu118 : export SYSTEMCLOCK := 71000000
2024-09-03 20:11:03 +00:00
vcu118 : export MAXSDCCLOCK := 1000000
2024-08-15 18:56:55 +00:00
vcu118 : FPGA_VCU
2023-04-21 16:08:35 +00:00
2024-08-15 18:56:55 +00:00
vcu108 : export XILINX_PART := xcvu 095-ffva 2104-2-e
vcu108 : export XILINX_BOARD := xilinx .com :vcu 108:part 0:1.7
vcu108 : export board := vcu 108
2024-09-02 21:23:16 +00:00
vcu108 : export SYSTEMCLOCK := 50000000
2024-09-03 20:11:03 +00:00
vcu108 : export MAXSDCCLOCK := 12500000
2024-08-15 18:56:55 +00:00
vcu108 : FPGA_VCU
2024-09-02 21:03:47 +00:00
# variables computed from config
EXT_MEM_BASE = $( shell grep 'EXT_MEM_BASE' ../../config/deriv/fpga$( board) /config.vh | sed 's/.*=.*h\([[:alnum:]]*\);/0x\1/g' )
EXT_MEM_RANGE = $( shell grep 'EXT_MEM_RANGE' ../../config/deriv/fpga$( board) /config.vh | sed 's/.*=.*h\([[:alnum:]]*\);/\1/g' | sed 's/\(.*\)/base=16;\1+1/g' | bc | sed 's/\(.*\)/0x\1/g' )
2023-04-21 16:08:35 +00:00
2024-08-15 18:56:55 +00:00
.PHONY : FPGA_Arty FPGA_VCU
2024-09-02 18:19:02 +00:00
FPGA_Arty : PreProcessFiles IP_Arty zsbl
2023-04-21 16:08:35 +00:00
vivado -mode tcl -source wally.tcl 2>& 1 | tee wally.log
2024-09-02 21:03:47 +00:00
FPGA_VCU : PreProcessFiles IP_VCU zsbl
2022-11-07 15:20:05 +00:00
vivado -mode tcl -source wally.tcl 2>& 1 | tee wally.log
2021-12-03 16:05:13 +00:00
2024-08-15 18:56:55 +00:00
# Generate IP Blocks
.PHONY : IP_Arty IP_VCU
2024-08-22 20:56:50 +00:00
IP_VCU : $( dst ) /sysrst .log \
2024-08-15 18:56:55 +00:00
MEM_VCU \
2024-08-22 20:56:50 +00:00
$( dst) /clkconverter.log \
$( dst) /ahbaxibridge.log
IP_Arty : $( dst ) /sysrst .log \
2024-08-15 18:56:55 +00:00
MEM_Arty \
2024-09-03 17:36:49 +00:00
$( dst) /mmcm.log \
2024-08-22 20:56:50 +00:00
$( dst) /clkconverter.log \
$( dst) /ahbaxibridge.log
2021-11-30 00:32:51 +00:00
2024-08-15 18:56:55 +00:00
# Generate Memory IP Blocks
.PHONY : MEM_VCU MEM_Arty
MEM_VCU :
2024-08-22 21:31:39 +00:00
$( MAKE) $( dst) /ddr4-$( board) .log
2024-08-15 18:56:55 +00:00
MEM_Arty :
2024-08-22 21:31:39 +00:00
$( MAKE) $( dst) /ddr3-$( board) .log
2023-01-20 20:35:46 +00:00
2024-08-15 18:56:55 +00:00
# Copy files and make necessary modifications
.PHONY : PreProcessFiles
2023-01-21 01:43:18 +00:00
PreProcessFiles :
2024-01-31 19:19:28 +00:00
$( MAKE) -C ../../sim deriv
2023-01-21 02:16:33 +00:00
rm -rf ../src/CopiedFiles_do_not_add_to_repo/
2023-02-02 22:14:11 +00:00
cp -r ../../src/ ../src/CopiedFiles_do_not_add_to_repo/
2024-07-19 20:48:20 +00:00
cp -r ../../addins/verilog-ethernet/*/*.sv ../src/CopiedFiles_do_not_add_to_repo/rvvi
cp -r ../../addins/verilog-ethernet/*/*/*/*.sv ../src/CopiedFiles_do_not_add_to_repo/rvvi
2023-11-13 23:48:28 +00:00
mkdir ../src/CopiedFiles_do_not_add_to_repo/config/
2024-08-29 23:12:58 +00:00
cp ../../config/deriv/fpga$( board) /config.vh ../src/CopiedFiles_do_not_add_to_repo/config/
2023-01-21 01:43:18 +00:00
./insert_debug_comment.sh
2023-12-02 00:59:18 +00:00
# This line allows the Bootloader to be loaded in a Block RAM on the FPGA
2024-04-22 15:42:01 +00:00
sed -i "s/bit \[DATA_WIDTH-1:0\].*ROM.*/(\* rom_style=\"block\" \*) &/g" ../src/CopiedFiles_do_not_add_to_repo/generic/mem/rom1p1r.sv
2024-10-30 21:01:11 +00:00
sed -i 's/$$WALLY/\.\.\/\.\.\//g' ../src/CopiedFiles_do_not_add_to_repo/generic/mem/rom1p1r.sv
sed -i 's/$$WALLY/\.\.\/\.\.\//g' ../src/CopiedFiles_do_not_add_to_repo/generic/mem/ram1p1rwbe.sv
2023-01-21 01:43:18 +00:00
2024-09-02 18:19:02 +00:00
# build the Zero stage boot loader (ZSBL)
2024-09-04 04:03:38 +00:00
.PHONY : zsbl
2024-09-02 18:19:02 +00:00
zsbl :
2024-09-02 21:23:16 +00:00
$( MAKE) -C ../zsbl clean
SYSTEMCLOCK = $( SYSTEMCLOCK) EXT_MEM_BASE = $( EXT_MEM_BASE) EXT_MEM_RANGE = $( EXT_MEM_RANGE) $( MAKE) -C ../zsbl
2024-09-02 18:19:02 +00:00
2024-08-15 18:56:55 +00:00
# Generate Individual IP Blocks
2021-11-30 00:32:51 +00:00
$(dst)/%.log : %.tcl
mkdir -p IP
cd IP; \
vivado -mode batch -source ../$* .tcl | tee $* .log
2021-11-30 00:42:28 +00:00
2024-08-15 18:56:55 +00:00
# Clean
.PHONY : cleanIP cleanLogs cleanFPGA cleanAll
2021-12-03 16:05:13 +00:00
cleanIP :
rm -rf IP
cleanLogs :
rm -rf *.jou *.log
cleanFPGA :
rm -rf WallyFPGA.* reports sim .Xil
cleanAll : cleanIP cleanLogs cleanFPGA
2024-08-15 18:56:55 +00:00
# Aliases
.PHONY : arty artya 7 VCU 118 VCU 108
arty artya7 : ArtyA 7
VCU118 : vcu 118
VCU108 : vcu 108