Files
Basys3Terminal/scripts/program.tcl
T
barantandClaude Opus 5.5 0e95a14cfe Basys 3 ASCII terminal: VGA 80x30 text, USB keyboard, UART
- VGA 640x480@60 text display, 8x16 CP437 font ROM from Linux console fonts
- USB HID keyboard (PS/2 via onboard PIC24), scan code set 2 to ASCII
  with xterm sequences for cursor/editing keys
- UART RX/TX with switch-selectable baud, local echo option
- Terminal engine: control codes, deferred wrap, hardware scroll,
  VT100/ANSI subset (cursor moves, erase, reverse video, cursor hide)
- Vivado build/program/flash scripts and xsim whole-design testbench

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:26:13 -08:00

32 lines
1.3 KiB
Tcl

# Program the Basys 3 over its USB-JTAG port.
# vivado -mode batch -source scripts/program.tcl (SRAM, lost at power-off)
# vivado -mode batch -source scripts/program.tcl -tclargs flash (QSPI flash, survives power-off)
set root [file normalize [file dirname [info script]]/..]
set mode [expr {[llength $argv] > 0 ? [lindex $argv 0] : "sram"}]
open_hw_manager
connect_hw_server
open_hw_target
set dev [lindex [get_hw_devices xc7a35t*] 0]
current_hw_device $dev
refresh_hw_device -update_hw_probes false $dev
if {$mode eq "flash"} {
create_hw_cfgmem -hw_device $dev [lindex [get_cfgmem_parts {s25fl032p-spi-x1_x2_x4}] 0]
set mem [get_property PROGRAM.HW_CFGMEM $dev]
set_property PROGRAM.FILES [list $root/build/basys3_terminal.mcs] $mem
set_property PROGRAM.ADDRESS_RANGE use_file $mem
set_property PROGRAM.ERASE 1 $mem
set_property PROGRAM.CFG_PROGRAM 1 $mem
set_property PROGRAM.VERIFY 1 $mem
create_hw_bitstream -hw_device $dev [get_property PROGRAM.HW_CFGMEM_BITFILE $dev]
program_hw_devices $dev
program_hw_cfgmem -hw_cfgmem $mem
puts "Flash programmed; set JP1 to QSPI and power-cycle (or press PROG)."
} else {
set_property PROGRAM.FILE $root/build/basys3_terminal.bit $dev
program_hw_devices $dev
puts "FPGA configured."
}
close_hw_manager