Monitor: wide 132x64 screen showing everything at once

On the 132x64 screen the monitor shows PC and all integer registers, all
float registers (hex and decimal) with FCSR decoded, mstatus/mepc/mcause/
mtval/cycle/instret and the breakpoint, 24 rows of disassembly beside the
stack, and 14 rows of memory, with changed registers highlighted; the 80x32
layout is unchanged. R takes float register names. The CPU's trap CSRs
start at 0, so reading them before the first trap no longer hangs the
simulated bus. send-hex accepts the prompt on any row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-12-02 00:00:43 -08:00
1 parent 1e44ce4383
commit addf0157fc
10 files changed
+3644 -3373

No files matched your search

+59 -1
View File
@@ -113,6 +113,14 @@ module tb_terminal;
end
endfunction
function [9:0] cellattr(input integer rr, input integer cc); // its colours
reg [17:0] v;
begin
v = dut.screen.cell_at((dut.alt_scr ? 8448 : 0) + rr * 132 + cc);
cellattr = v[17:8];
end
endfunction
function [7:0] cellch(input integer rr, input integer cc);
reg [7:0] v;
begin
@@ -381,6 +389,56 @@ module tb_terminal;
cellraw(8, 104), cellraw(8, 106), cellraw(9, 0));
errors = errors + 1;
end
// ---- the monitor's wide layout: everything at once
uart_str("\025MONITOR\015");
wait_at(0, 66, "STOPPED BY MONITOR COMMAND");
wait_at(2, 1, "REGISTERS");
wait_at(3, 1, " PC ");
wait_at(3, 16, " ZERO 00000000");
wait_at(2, 66, "FLOAT REGISTERS");
wait_at(3, 66, " FT0 ");
wait_at(18, 99, "FT11 ");
wait_at(19, 66, "FCSR ");
wait_at(13, 1, "CONTROL AND STATUS");
wait_at(14, 1, "MSTATUS ");
wait_at(15, 1, "MCAUSE ");
wait_at(16, 1, "CYCLE ");
wait_at(17, 1, "BREAKPOINT NONE");
wait_at(21, 0, " ADDR WORD INSTRUCTION");
wait_at(22, 0, ">");
wait_at(21, 66, "STACK");
wait_at(47, 0, " MEMORY");
wait_at(48, 1, " ");
wait_at(62, 0, " ENTER step");
wait_at(63, 0, "> ");
// a float register, in hex and decimal, without asking for it (F)
// (each command redraws the whole screen: give it time before the next)
uart_str("R FA0=3FC00000\015");
wait_at(13, 66, " FA0 3FC00000 1.500000E+00");
#300_000_000;
uart_str("R FA1=C2F6E979\015");
wait_at(14, 66, " FA1 C2F6E979 -1.234560E+02");
#300_000_000;
// a step that changes A0 shows it highlighted (A1 beside it is not)
uart_str("A 12000\015"); #300_000_000;
uart_str("LI A0,66\015"); #300_000_000;
uart_str("\015"); #300_000_000;
uart_str("R PC=12000\015"); #300_000_000;
uart_str("\015");
wait_at(0, 66, "STOPPED BY STEP");
wait_at(5, 46, " A0 00000042");
wait_at(3, 6, "00012004");
// (ZERO is never highlighted, and LI leaves A1 alone)
if (cellattr(5, 52) != cellattr(3, 23) && cellattr(6, 7) == cellattr(3, 23))
$display("PASS a register a step changed is highlighted");
else begin
$display("FAIL highlight: A0 %h, A1 %h, ZERO %h", cellattr(5, 52), cellattr(6, 7), cellattr(3, 23));
errors = errors + 1;
end
// F says the float registers are already there; M is the memory
#300_000_000;
uart_str("F\015");
wait_at(63, 66, "THE FLOAT REGISTERS ARE ALWAYS SHOWN");
if (errors == 0) $display("ALL TESTS PASSED");
else $display("%0d TESTS FAILED", errors);
$finish;
@@ -429,7 +487,7 @@ module tb_terminal;
"OUT 112,1:OUT 113,108:OUT 114,0:OUT 115,158:OUT 116,1:OUT 117,1\015"});
uart_str({"FILL 0,200,319,239,4:OUT 112,2:OUT 113,54:OUT 114,1:OUT 115,230:",
"OUT 116,2:OUT 117,3\015"});
#40_000_000;
#300_000_000;
@(posedge vs); @(posedge vs); @(posedge vs);
uart_str("LOCATE 30,1:PRINT INP(128);INP(129);INP(132)\015");
wait_row(29, " 3 0 4");