|
| 1 | + |
| 2 | +# FPGA settings |
| 3 | +FPGA_PART = xcvu13p-fhgb2104-2-e |
| 4 | +FPGA_TOP = fpga |
| 5 | +FPGA_ARCH = virtexuplus |
| 6 | + |
| 7 | +# Files for synthesis |
| 8 | +SYN_FILES = rtl/fpga.v |
| 9 | +SYN_FILES += rtl/fpga_core.v |
| 10 | +SYN_FILES += rtl/eth_xcvr_phy_wrapper.v |
| 11 | +SYN_FILES += rtl/eth_xcvr_phy_quad_wrapper.v |
| 12 | +SYN_FILES += rtl/debounce_switch.v |
| 13 | +SYN_FILES += rtl/sync_signal.v |
| 14 | +SYN_FILES += rtl/i2c_master.v |
| 15 | +SYN_FILES += pll/si5341_i2c_init.v |
| 16 | +SYN_FILES += lib/eth/rtl/eth_mac_10g_fifo.v |
| 17 | +SYN_FILES += lib/eth/rtl/eth_mac_10g.v |
| 18 | +SYN_FILES += lib/eth/rtl/axis_xgmii_rx_64.v |
| 19 | +SYN_FILES += lib/eth/rtl/axis_xgmii_tx_64.v |
| 20 | +SYN_FILES += lib/eth/rtl/eth_phy_10g.v |
| 21 | +SYN_FILES += lib/eth/rtl/eth_phy_10g_rx.v |
| 22 | +SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_if.v |
| 23 | +SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_frame_sync.v |
| 24 | +SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_ber_mon.v |
| 25 | +SYN_FILES += lib/eth/rtl/eth_phy_10g_rx_watchdog.v |
| 26 | +SYN_FILES += lib/eth/rtl/eth_phy_10g_tx.v |
| 27 | +SYN_FILES += lib/eth/rtl/eth_phy_10g_tx_if.v |
| 28 | +SYN_FILES += lib/eth/rtl/xgmii_baser_dec_64.v |
| 29 | +SYN_FILES += lib/eth/rtl/xgmii_baser_enc_64.v |
| 30 | +SYN_FILES += lib/eth/rtl/lfsr.v |
| 31 | +SYN_FILES += lib/eth/rtl/eth_axis_rx.v |
| 32 | +SYN_FILES += lib/eth/rtl/eth_axis_tx.v |
| 33 | +SYN_FILES += lib/eth/rtl/udp_complete_64.v |
| 34 | +SYN_FILES += lib/eth/rtl/udp_checksum_gen_64.v |
| 35 | +SYN_FILES += lib/eth/rtl/udp_64.v |
| 36 | +SYN_FILES += lib/eth/rtl/udp_ip_rx_64.v |
| 37 | +SYN_FILES += lib/eth/rtl/udp_ip_tx_64.v |
| 38 | +SYN_FILES += lib/eth/rtl/ip_complete_64.v |
| 39 | +SYN_FILES += lib/eth/rtl/ip_64.v |
| 40 | +SYN_FILES += lib/eth/rtl/ip_eth_rx_64.v |
| 41 | +SYN_FILES += lib/eth/rtl/ip_eth_tx_64.v |
| 42 | +SYN_FILES += lib/eth/rtl/ip_arb_mux.v |
| 43 | +SYN_FILES += lib/eth/rtl/arp.v |
| 44 | +SYN_FILES += lib/eth/rtl/arp_cache.v |
| 45 | +SYN_FILES += lib/eth/rtl/arp_eth_rx.v |
| 46 | +SYN_FILES += lib/eth/rtl/arp_eth_tx.v |
| 47 | +SYN_FILES += lib/eth/rtl/eth_arb_mux.v |
| 48 | +SYN_FILES += lib/eth/lib/axis/rtl/arbiter.v |
| 49 | +SYN_FILES += lib/eth/lib/axis/rtl/priority_encoder.v |
| 50 | +SYN_FILES += lib/eth/lib/axis/rtl/axis_fifo.v |
| 51 | +SYN_FILES += lib/eth/lib/axis/rtl/axis_async_fifo.v |
| 52 | +SYN_FILES += lib/eth/lib/axis/rtl/axis_async_fifo_adapter.v |
| 53 | +SYN_FILES += lib/eth/lib/axis/rtl/sync_reset.v |
| 54 | + |
| 55 | +# XDC files |
| 56 | +XDC_FILES = fpga.xdc |
| 57 | +XDC_FILES += lib/eth/syn/vivado/eth_mac_fifo.tcl |
| 58 | +XDC_FILES += lib/eth/lib/axis/syn/vivado/axis_async_fifo.tcl |
| 59 | +XDC_FILES += lib/eth/lib/axis/syn/vivado/sync_reset.tcl |
| 60 | + |
| 61 | +# IP |
| 62 | +IP_TCL_FILES += ip/eth_xcvr_gt.tcl |
| 63 | + |
| 64 | +# Configuration |
| 65 | +CONFIG_TCL_FILES = ./config.tcl |
| 66 | + |
| 67 | +include ../common/vivado.mk |
| 68 | + |
| 69 | +program: $(FPGA_TOP).bit |
| 70 | + echo "open_hw" > program.tcl |
| 71 | + echo "connect_hw_server" >> program.tcl |
| 72 | + echo "open_hw_target" >> program.tcl |
| 73 | + echo "current_hw_device [lindex [get_hw_devices] 0]" >> program.tcl |
| 74 | + echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> program.tcl |
| 75 | + echo "set_property PROGRAM.FILE {$(FPGA_TOP).bit} [current_hw_device]" >> program.tcl |
| 76 | + echo "program_hw_devices [current_hw_device]" >> program.tcl |
| 77 | + echo "exit" >> program.tcl |
| 78 | + vivado -nojournal -nolog -mode batch -source program.tcl |
| 79 | + |
| 80 | +%_primary.mcs %_secondary.mcs %_primary.prm %_secondary.prm: %.bit |
| 81 | + echo "write_cfgmem -force -format mcs -size 128 -interface SPIx8 -loadbit {up 0x0000000 $*.bit} -checksum -file $*.mcs" > generate_mcs.tcl |
| 82 | + echo "exit" >> generate_mcs.tcl |
| 83 | + vivado -nojournal -nolog -mode batch -source generate_mcs.tcl |
| 84 | + mkdir -p rev |
| 85 | + COUNT=100; \ |
| 86 | + while [ -e rev/$*_rev$$COUNT.bit ]; \ |
| 87 | + do COUNT=$$((COUNT+1)); done; \ |
| 88 | + COUNT=$$((COUNT-1)); \ |
| 89 | + for x in _primary.mcs _secondary.mcs _primary.prm _secondary.prm; \ |
| 90 | + do cp $*$$x rev/$*_rev$$COUNT$$x; \ |
| 91 | + echo "Output: rev/$*_rev$$COUNT$$x"; done; |
| 92 | + |
| 93 | +flash: $(FPGA_TOP)_primary.mcs $(FPGA_TOP)_secondary.mcs $(FPGA_TOP)_primary.prm $(FPGA_TOP)_secondary.prm |
| 94 | + echo "open_hw" > flash.tcl |
| 95 | + echo "connect_hw_server" >> flash.tcl |
| 96 | + echo "open_hw_target" >> flash.tcl |
| 97 | + echo "current_hw_device [lindex [get_hw_devices] 0]" >> flash.tcl |
| 98 | + echo "refresh_hw_device -update_hw_probes false [current_hw_device]" >> flash.tcl |
| 99 | + echo "create_hw_cfgmem -hw_device [current_hw_device] [lindex [get_cfgmem_parts {s25fl512s-spi-x1_x2_x4_x8}] 0]" >> flash.tcl |
| 100 | + echo "current_hw_cfgmem -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl |
| 101 | + echo "set_property PROGRAM.FILES [list \"$(FPGA_TOP)_primary.mcs\" \"$(FPGA_TOP)_secondary.mcs\"] [current_hw_cfgmem]" >> flash.tcl |
| 102 | + echo "set_property PROGRAM.PRM_FILES [list \"$(FPGA_TOP)_primary.prm\" \"$(FPGA_TOP)_secondary.prm\"] [current_hw_cfgmem]" >> flash.tcl |
| 103 | + echo "set_property PROGRAM.ERASE 1 [current_hw_cfgmem]" >> flash.tcl |
| 104 | + echo "set_property PROGRAM.CFG_PROGRAM 1 [current_hw_cfgmem]" >> flash.tcl |
| 105 | + echo "set_property PROGRAM.VERIFY 1 [current_hw_cfgmem]" >> flash.tcl |
| 106 | + echo "set_property PROGRAM.CHECKSUM 0 [current_hw_cfgmem]" >> flash.tcl |
| 107 | + echo "set_property PROGRAM.ADDRESS_RANGE {use_file} [current_hw_cfgmem]" >> flash.tcl |
| 108 | + echo "set_property PROGRAM.UNUSED_PIN_TERMINATION {pull-none} [current_hw_cfgmem]" >> flash.tcl |
| 109 | + echo "create_hw_bitstream -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM_BITFILE [current_hw_device]]" >> flash.tcl |
| 110 | + echo "program_hw_devices [current_hw_device]" >> flash.tcl |
| 111 | + echo "refresh_hw_device [current_hw_device]" >> flash.tcl |
| 112 | + echo "program_hw_cfgmem -hw_cfgmem [current_hw_cfgmem]" >> flash.tcl |
| 113 | + echo "boot_hw_device [current_hw_device]" >> flash.tcl |
| 114 | + echo "exit" >> flash.tcl |
| 115 | + vivado -nojournal -nolog -mode batch -source flash.tcl |
| 116 | + |
0 commit comments