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>
This commit is contained in:
barantandClaude Opus 5.5 committed 2026-11-17 10:26:13 -08:00
commit 0e95a14cfe
18 files changed
+5596

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
`timescale 1ns / 1ps
// Small synchronous first-word-fall-through FIFO (dout is valid while !empty).
module fifo #(
parameter W = 8,
parameter A = 4 // depth = 2**A
) (
input clk,
input rst,
input [W-1:0] din,
input wr,
input rd,
output [W-1:0] dout,
output empty,
output full
);
reg [W-1:0] mem [0:(1<<A)-1];
reg [A:0] wp, rp;
assign empty = wp == rp;
assign full = wp[A] != rp[A] && wp[A-1:0] == rp[A-1:0];
assign dout = mem[rp[A-1:0]];
always @(posedge clk)
if (wr && !full) mem[wp[A-1:0]] <= din;
always @(posedge clk) begin
if (rst) begin
wp <= 0;
rp <= 0;
end else begin
if (wr && !full) wp <= wp + 1'b1;
if (rd && !empty) rp <= rp + 1'b1;
end
end
endmodule