VT220 emulation with ANSI colour, underline and smooth scrolling

- Terminal engine rewritten for VT220: scroll regions, IL/DL/ICH/DCH/ECH,
  SU/SD, origin mode, insert mode, tab stops, DEC special graphics with
  G0/G1 and SO/SI, DECSC/DECRC, DECSTR, RIS, DECALN, DECLL LEDs
- Replies to DA, secondary DA, DSR and CPR over the UART
- 16-colour SGR (256-colour and RGB approximated), bold, underline,
  blink, reverse and conceal; cells are now 18 bits
- Smooth scrolling (SW8 or DECSCLM): the region slides per frame and
  rows are moved during vertical blanking; XON/XOFF holds the host back
- Keyboard: DECCKM, keypad application mode, F5-F12, VT220 Home/End,
  Alt as ESC prefix
- basys3 terminfo entry (vt220 + 16 colours, 30 lines)
- Flash script reboots the FPGA from flash after programming
- Testbench covers replies, modes, attributes, editing and smooth scroll

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
barantandClaude Opus 5.5 committed 2026-11-17 11:18:36 -08:00
1 parent a95062f42d
commit 6e54d75c56
10 files changed
+1173 -350

No files matched your search

+3 -1
View File
@@ -32,7 +32,9 @@ if {$mode eq "flash"} {
delete_hw_cfgmem $mem
}
if {!$done} { error "flash part not recognised" }
puts "Flash programmed; set JP1 to QSPI and power-cycle (or press PROG)."
# reload the FPGA from flash (works when JP1 is set to QSPI)
boot_hw_device $dev
puts "Flash programmed; with JP1 on QSPI the board now boots from it."
} else {
set_property PROGRAM.FILE $root/build/basys3_terminal.bit $dev
program_hw_devices $dev
+4 -1
View File
@@ -10,5 +10,8 @@ xvlog -d FONT_FILE="\"$ROOT/font/font.mem\"" "$ROOT"/rtl/*.v "$ROOT"/sim/tb_term
xelab -debug off tb_terminal -s tb_terminal
xsim tb_terminal -R
if command -v python3 >/dev/null; then
python3 -c "from PIL import Image; Image.open('frame.ppm').save('frame.png')" && echo "wrote sim/work/frame.png"
for f in frame_*.ppm; do
python3 -c "import sys; from PIL import Image; Image.open(sys.argv[1]).save(sys.argv[2])" \
"$f" "${f%.ppm}.png" && echo "wrote sim/work/${f%.ppm}.png"
done
fi