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>
BASIC gets SAVE, LOAD, RUN "NAME", DIR and DEL, storing program listings
in the configuration flash from 240000h (448 x 4 KB blocks, 64 files,
32 KB each). The directory is kept in two alternating blocks with a
sequence number and checksum, new data is written before the directory
switches to it, and every page is verified after programming.
rtl/flash_spi.v drives the flash through STARTUPE2 on ports 40h/41h. It
only passes read, status, WREN/WRDI, RDID, page program and 4 KB erase,
and abandons any program or erase below 240000h before the address
reaches the chip. Tested on the board: an erase at 0 and a write at
200000h were refused and left the flash unchanged.
With SW14 up, the Z-80's output is also copied to the PC's serial port,
and tools/get-bas.py uses that to LIST a program into a file or run
commands and print the replies.
Also fixes port 10h returning the previous millisecond latch (the first
read after reset was undefined). Simulation adds a model flash and a
save/load/run/protection test. Manual and README updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SW15 switches the terminal from the PC's serial line to a Z-80 running at
90 MHz from its own clock, with 64 KB of block RAM preloaded with BASIC.
- rtl/z80_cpu.v: Z-80 built for speed (one clock per memory access, next
byte read during decode), full documented instruction set plus the
common undocumented forms; no interrupts.
- rtl/z80_system.v: RAM, console/timer/7-segment ports, toggle handshakes
to the terminal clock.
- basic/: BASIC interpreter in C for SDCC, start-up code, prebuilt image.
- tools/z80emu.py, tools/cputest.py, scripts/cpusim.sh: reference emulator
and random tests comparing the CPU after every instruction.
- SW14 feeds the PC's UART into the Z-80 for pasting programs; BTND
resets the Z-80 only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>