25 lines
966 B
Tcl
25 lines
966 B
Tcl
# Run: vivado -mode batch -source targets/genesys2/scripts/program_fpga.tcl -tclargs [bitstream]
|
|
set script_dir [file normalize [file dirname [info script]]]
|
|
set target_dir [file normalize [file join $script_dir ..]]
|
|
set root_dir [file normalize [file join $target_dir .. ..]]
|
|
if {$argc > 0} {
|
|
set bitstream [file normalize [lindex $argv 0]]
|
|
} else {
|
|
set bitstream [file join $root_dir build genesys2 vivado max2771_recorder.bit]
|
|
}
|
|
if {![file exists $bitstream]} { error "Bitstream not found: $bitstream" }
|
|
|
|
open_hw_manager
|
|
connect_hw_server
|
|
open_hw_target
|
|
set devices [get_hw_devices -quiet -filter {PART =~ "xc7k325t*"}]
|
|
if {[llength $devices] == 0} { error "No xc7k325t JTAG device found" }
|
|
set device [lindex $devices 0]
|
|
current_hw_device $device
|
|
refresh_hw_device -update_hw_probes false $device
|
|
set_property PROGRAM.FILE $bitstream $device
|
|
program_hw_devices $device
|
|
refresh_hw_device $device
|
|
puts "Programmed $device with $bitstream"
|
|
close_hw_manager
|