@@ -53,9 +53,35 @@ program: $(FPGA_TOP).bit
5353 echo " connect_hw_server" >> program.tcl
5454 echo " open_hw_target" >> program.tcl
5555 echo " current_hw_device [lindex [get_hw_devices] 0]" >> program.tcl
56- echo " refresh_hw_device -update_hw_probes false [lindex [get_hw_devices] 0 ]" >> program.tcl
57- echo " set_property PROGRAM.FILE {$( FPGA_TOP) .bit} [lindex [get_hw_devices] 0 ]" >> program.tcl
58- echo " program_hw_devices [lindex [get_hw_devices] 0 ]" >> program.tcl
56+ echo " refresh_hw_device -update_hw_probes false [current_hw_device ]" >> program.tcl
57+ echo " set_property PROGRAM.FILE {$( FPGA_TOP) .bit} [current_hw_device ]" >> program.tcl
58+ echo " program_hw_devices [current_hw_device ]" >> program.tcl
5959 echo " exit" >> program.tcl
6060 vivado -mode batch -source program.tcl
6161
62+ % .mcs : % .bit
63+ echo " write_cfgmem -force -format mcs -size 16 -interface SPIx4 -loadbit {up 0x0000000 $* .bit} -checksum -file $* .mcs" > generate_mcs.tcl
64+ echo " exit" >> generate_mcs.tcl
65+ vivado -mode batch -source generate_mcs.tcl
66+
67+ flash : $(FPGA_TOP ) .mcs
68+ echo " open_hw" > flash.tcl
69+ echo " connect_hw_server" >> flash.tcl
70+ echo " open_hw_target" >> flash.tcl
71+ echo " current_hw_device [lindex [get_hw_devices] 0]" >> flash.tcl
72+ echo " refresh_hw_device -update_hw_probes false [current_hw_device]" >> flash.tcl
73+ echo " create_hw_cfgmem -hw_device [current_hw_device] [lindex [get_cfgmem_parts {mt25ql128-spi-x1_x2_x4}] 0]" >> flash.tcl
74+ echo " set_property PROGRAM.FILES [list " $(FPGA_TOP ) .mcs" ] [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
75+ echo " set_property PROGRAM.ERASE 1 [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
76+ echo " set_property PROGRAM.CFG_PROGRAM 1 [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
77+ echo " set_property PROGRAM.VERIFY 1 [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
78+ echo " set_property PROGRAM.CHECKSUM 0 [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
79+ echo " set_property PROGRAM.ADDRESS_RANGE {use_file} [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
80+ echo " create_hw_bitstream -hw_device [current_hw_device] [get_property PROGRAM.HW_CFGMEM_BITFILE [ lindex [get_hw_devices] 0]]" >> flash.tcl
81+ echo " program_hw_devices [current_hw_device]" >> flash.tcl
82+ echo " refresh_hw_device [current_hw_device]" >> flash.tcl
83+ echo " program_hw_cfgmem -hw_cfgmem [get_property PROGRAM.HW_CFGMEM [current_hw_device]]" >> flash.tcl
84+ echo " boot_hw_device [current_hw_device]" >> flash.tcl
85+ echo " exit" >> flash.tcl
86+ vivado -mode batch -source flash.tcl
87+
0 commit comments