Skip to content

Commit 352f52e

Browse files
committed
Add flash target to Arty example design
1 parent 3da3725 commit 352f52e

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

example/Arty/fpga/fpga.xdc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
# part: xc7a35t-csg324-1
33

44
# General configuration
5-
set_property CFGBVS VCCO [current_design]
6-
set_property CONFIG_VOLTAGE 3.3 [current_design]
7-
set_property BITSTREAM.GENERAL.COMPRESS true [current_design]
5+
set_property CFGBVS VCCO [current_design]
6+
set_property CONFIG_VOLTAGE 3.3 [current_design]
7+
set_property BITSTREAM.GENERAL.COMPRESS true [current_design]
8+
set_property BITSTREAM.CONFIG.CONFIGRATE 50 [current_design]
9+
set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 4 [current_design]
810

911
# 100 MHz clock
1012
set_property -dict {LOC E3 IOSTANDARD LVCMOS33} [get_ports clk]

example/Arty/fpga/fpga/Makefile

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)