1280x1024 display: 80x32 big font or 132x64 (DECCOLM)

The display runs at 1280x1024 60 Hz from a second MMCM (108 MHz pixel
clock), one pixel per clock through a four-stage pipeline. 80 columns
show 80x32 cells of 16x32 pixels (the 8x16 font doubled); CSI ?3 h
switches to 132x64 cells of 8x16 pixels, centred, and CSI ?3 l back,
both clearing the screen and margins as a VT100 does. The 320x240
graphics layer is drawn 4x4 in the top 960 lines, so 80-column row r
still meets graphics line 8(r-1).

The terminal engine has 6-bit rows and 8-bit columns, a 132-cell row
stride in both layouts (so the copy engine is unchanged), 132 tab stops
and 3-digit cursor reports. The character RAM holds two 132x64 pages
(normal and alternate) and is read on the pixel clock.

BASIC's LOCATE takes rows up to 64 and columns up to 132. terminfo has
basys3 (80x32) and basys3-w (132x64). The testbench reads the 132-cell
layout, checks 1280x1024 sync timing, captures 1280x1024 frames and
tests DECCOLM both ways.

Timing met (0.044 ns at 90 MHz CPU, 108 MHz pixel); 46 of 50 BRAMs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-11-28 12:24:21 -08:00
1 parent 634e314010
commit 88b5942da5
12 files changed
+354 -220

No files matched your search

+14 -4
View File
@@ -3,8 +3,10 @@
Turns a Digilent Basys 3 (Artix-7 XC7A35T) into a stand-alone VT220-compatible
serial terminal with ANSI colour:
- **Screen**: VGA port, 640x480 @ 60 Hz, 80 columns x 30 rows, 8x16 CP437 font,
16 colours, underline, blink, reverse video, optional smooth scrolling.
- **Screen**: VGA port, 1280x1024 @ 60 Hz. 80 columns x 32 rows in a 16x32
font (the 8x16 CP437 font doubled), or 132 columns x 64 rows in the 8x16 font
after `ESC[?3h` (DECCOLM). 16 colours, underline, blink, reverse video,
optional smooth scrolling.
- **Keyboard**: a USB keyboard in the **USB HID host** port (J2). The board's
PIC24 presents it to the FPGA as a PS/2 keyboard.
- **Serial line**: the micro-USB **PROG/UART** port (the FTDI chip), 8N1. Bytes
@@ -45,6 +47,12 @@ printf '[Service]\nExecStart=\nExecStart=-/usr/sbin/agetty -L 115200 %%I basys3\
sudo systemctl daemon-reload && sudo systemctl restart serial-getty@ttyUSB1.service
```
For 132 columns, switch the terminal and tell the PC its size:
```bash
printf '\033[?3h'; export TERM=basys3-w; stty rows 64 cols 132
```
The getty sets `TERM=basys3` for the login session. Programs find the entry in
`~/.terminfo` once you're logged in. Without the entry, `TERM=vt220` works but
has no colour.
@@ -130,7 +138,9 @@ For the fastest terminal:
approximated to the 16 colours.
- **Modes**: `DECCKM` (cursor keys), `DECKPAM`/`DECKPNM` (keypad), `LNM`,
`DECTCEM` (cursor on/off), `DECSCLM` (smooth scroll), alternate screen
(`CSI ?47 h`/`l`, a second page; graphics are hidden while it is shown).
(`CSI ?47 h`/`l`, a second page; graphics are hidden while it is shown),
`DECCOLM` (`CSI ?3 h`/`l`: 132x64 / 80x32, clearing the screen as a VT100
does).
- **Replies to the host**:
- `DA` gets `ESC[?62;22c` (a VT220 with colour)
- Secondary `DA` gets `ESC[>1;10;0c`
@@ -459,5 +469,5 @@ which Vivado needs on newer distros.
| `rtl/uart.v` | UART receiver and transmitter |
| `rtl/fifo.v`, `rtl/sevenseg.v` | Helpers |
| `font/font.mem` | 256x16 font ROM, made by `tools/psf2mem.py` from the Linux console fonts |
| `terminfo/basys3.ti` | terminfo entry: VT220 plus 16 colours, 30 lines |
| `terminfo/basys3.ti` | terminfo entries: `basys3` (VT220, 16 colours, 80x32) and `basys3-w` (132x64) |
| `constraints/basys3.xdc` | Pin assignments |