mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-07 16:28:40 -08:00
86 lines
3.9 KiB
Makefile
86 lines
3.9 KiB
Makefile
# SPDX-License-Identifier: MIT
|
|
#
|
|
# Copyright (c) 2025 FPGA Ninja, LLC
|
|
#
|
|
# Authors:
|
|
# - Alex Forencich
|
|
#
|
|
|
|
# FPGA settings
|
|
FPGA_PART = xcvu9p-flga2104-2L-e
|
|
FPGA_TOP = fpga
|
|
FPGA_ARCH = virtexuplus
|
|
|
|
# Files for synthesis
|
|
SYN_FILES = ../rtl/fpga.sv
|
|
SYN_FILES += ../rtl/fpga_core.sv
|
|
SYN_FILES += ../lib/taxi/rtl/eth/taxi_eth_mac_1g_fifo.f
|
|
SYN_FILES += ../lib/taxi/rtl/eth/us/taxi_eth_mac_25g_us.f
|
|
SYN_FILES += ../lib/taxi/rtl/lss/taxi_uart.f
|
|
SYN_FILES += ../lib/taxi/rtl/lss/taxi_mdio_master.sv
|
|
SYN_FILES += ../lib/taxi/rtl/sync/taxi_sync_reset.sv
|
|
SYN_FILES += ../lib/taxi/rtl/sync/taxi_sync_signal.sv
|
|
SYN_FILES += ../lib/taxi/rtl/io/taxi_debounce_switch.sv
|
|
|
|
# XDC files
|
|
XDC_FILES = ../fpga.xdc
|
|
XDC_FILES += ../lib/taxi/syn/vivado/taxi_eth_mac_fifo.tcl
|
|
XDC_FILES += ../lib/taxi/syn/vivado/taxi_axis_async_fifo.tcl
|
|
XDC_FILES += ../lib/taxi/syn/vivado/taxi_sync_reset.tcl
|
|
XDC_FILES += ../lib/taxi/syn/vivado/taxi_sync_signal.tcl
|
|
|
|
# IP
|
|
IP_TCL_FILES = ../ip/sgmii_pcs_pma_0.tcl
|
|
IP_TCL_FILES += ../lib/taxi/rtl/eth/us/taxi_eth_mac_25g_us_gty_25g_156.tcl
|
|
|
|
include ../common/vivado.mk
|
|
|
|
program: $(PROJECT).bit
|
|
echo "open_hw" > program.tcl
|
|
echo "connect_hw_server" >> program.tcl
|
|
echo "open_hw_target" >> program.tcl
|
|
echo "current_hw_device [lindex [get_hw_devices] 0]" >> program.tcl
|
|
echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> program.tcl
|
|
echo "set_property PROGRAM.FILE {$(PROJECT).bit} [current_hw_device]" >> program.tcl
|
|
echo "program_hw_devices [current_hw_device]" >> program.tcl
|
|
echo "exit" >> program.tcl
|
|
vivado -nojournal -nolog -mode batch -source program.tcl
|
|
|
|
$(PROJECT)_primary.mcs $(PROJECT)_secondary.mcs $(PROJECT)_primary.prm $(PROJECT)_secondary.prm: $(PROJECT).bit
|
|
echo "write_cfgmem -force -format mcs -size 256 -interface SPIx8 -loadbit {up 0x0000000 $*.bit} -checksum -file $*.mcs" > generate_mcs.tcl
|
|
echo "exit" >> generate_mcs.tcl
|
|
vivado -nojournal -nolog -mode batch -source generate_mcs.tcl
|
|
mkdir -p rev
|
|
COUNT=100; \
|
|
while [ -e rev/$*_rev$$COUNT.bit ]; \
|
|
do COUNT=$$((COUNT+1)); done; \
|
|
COUNT=$$((COUNT-1)); \
|
|
for x in _primary.mcs _secondary.mcs _primary.prm _secondary.prm; \
|
|
do cp $*$$x rev/$*_rev$$COUNT$$x; \
|
|
echo "Output: rev/$*_rev$$COUNT$$x"; done;
|
|
|
|
flash: $(PROJECT)_primary.mcs $(PROJECT)_secondary.mcs $(PROJECT)_primary.prm $(PROJECT)_secondary.prm
|
|
echo "open_hw" > flash.tcl
|
|
echo "connect_hw_server" >> flash.tcl
|
|
echo "open_hw_target" >> flash.tcl
|
|
echo "current_hw_device [lindex [get_hw_devices] 0]" >> flash.tcl
|
|
echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> flash.tcl
|
|
echo "create_hw_cfgmem -hw_device [current_hw_device] [lindex [get_cfgmem_parts {mt25qu01g-spi-x1_x2_x4_x8}] 0]" >> flash.tcl
|
|
echo "current_hw_cfgmem -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
|
|
echo "set_property PROGRAM.FILES [list \"$(PROJECT)_primary.mcs\" \"$(PROJECT)_secondary.mcs\"] [current_hw_cfgmem]" >> flash.tcl
|
|
echo "set_property PROGRAM.PRM_FILES [list \"$(PROJECT)_primary.prm\" \"$(PROJECT)_secondary.prm\"] [current_hw_cfgmem]" >> flash.tcl
|
|
echo "set_property PROGRAM.ERASE 1 [current_hw_cfgmem]" >> flash.tcl
|
|
echo "set_property PROGRAM.CFG_PROGRAM 1 [current_hw_cfgmem]" >> flash.tcl
|
|
echo "set_property PROGRAM.VERIFY 1 [current_hw_cfgmem]" >> flash.tcl
|
|
echo "set_property PROGRAM.CHECKSUM 0 [current_hw_cfgmem]" >> flash.tcl
|
|
echo "set_property PROGRAM.ADDRESS_RANGE {use_file} [current_hw_cfgmem]" >> flash.tcl
|
|
echo "set_property PROGRAM.UNUSED_PIN_TERMINATION {pull-none} [current_hw_cfgmem]" >> flash.tcl
|
|
echo "create_hw_bitstream -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM_BITFILE [current_hw_device]]" >> flash.tcl
|
|
echo "program_hw_devices [current_hw_device]" >> flash.tcl
|
|
echo "refresh_hw_device [current_hw_device]" >> flash.tcl
|
|
echo "program_hw_cfgmem -hw_cfgmem [current_hw_cfgmem]" >> flash.tcl
|
|
echo "boot_hw_device [current_hw_device]" >> flash.tcl
|
|
echo "exit" >> flash.tcl
|
|
vivado -nojournal -nolog -mode batch -source flash.tcl
|
|
|