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:
1 parent
1e44ce4383
commit
addf0157fc
10 files changed
+3644
-3373
No files matched your search
+61
-2
@@ -1019,6 +1019,65 @@ graphics come back exactly as they were.
|
||||
breakpoint.
|
||||
- The stack column shows the words at SP upwards.
|
||||
|
||||
**The wide screen.** When the terminal is 132 × 64, as it is from power-up,
|
||||
the monitor uses all of it and shows everything at once, with nothing to
|
||||
switch between. It goes by the width when it is entered, so after `ESC[?3l`
|
||||
(80 × 32) it draws the screen above. Its left half:
|
||||
|
||||
```
|
||||
RISC-V MONITOR
|
||||
REGISTERS
|
||||
PC 000065B4 ZERO 00000000 RA 00005364 SP 00013EF0
|
||||
GP 0000F8B8 TP 00000000 T0 0000000A T1 0000000A
|
||||
T2 00009000 S0 0000000A S1 000000AE A0 000000AE
|
||||
...
|
||||
T6 0000000A
|
||||
|
||||
CONTROL AND STATUS
|
||||
MSTATUS 00001880 MEPC 00012008 MTVAL 00000000
|
||||
MCAUSE 00000003 EBREAK
|
||||
CYCLE 000000000002C110 INSTRET 000000000002C27A
|
||||
BREAKPOINT NONE
|
||||
|
||||
ADDR WORD INSTRUCTION
|
||||
> 065B4 80CFF06F j 0x55c0
|
||||
065B8 8F8FD0EF jal 0x36b0
|
||||
...
|
||||
```
|
||||
|
||||
and its right half:
|
||||
|
||||
```
|
||||
STOPPED BY MONITOR COMMAND
|
||||
FLOAT REGISTERS
|
||||
FT0 00000000 0 FA6 00000000 0
|
||||
...
|
||||
FA0 42900000 7.200000E+01 FS10 00000000 0
|
||||
FA1 C2F6E979 -1.234560E+02 FS11 00000000 0
|
||||
...
|
||||
FA5 C7000000 -3.276800E+04 FT11 00000000 0
|
||||
FCSR 00000001 ROUNDING RNE FLAGS -- -- -- -- NX
|
||||
|
||||
STACK
|
||||
13EF0 00000000
|
||||
...
|
||||
```
|
||||
|
||||
- **Registers:** the PC and all 32 integer registers by name, and all 32 float
|
||||
registers by their ABI names, each as its bit pattern and as a number
|
||||
(to 7 digits). FCSR is shown whole and split into its rounding mode and
|
||||
its five flags (`NV` invalid, `DZ` divide by zero, `OF` overflow, `UF`
|
||||
underflow, `NX` inexact), a letter pair for each that is set.
|
||||
- **After a step,** or whenever the monitor comes back, the registers the
|
||||
program changed since the monitor last showed them are in bright yellow.
|
||||
- **Control and status:** `mstatus`, `mepc`, `mcause` (with what it means),
|
||||
`mtval`, the `cycle` and `instret` counters, and the breakpoint.
|
||||
- **Below them:** 24 rows of disassembly with the stack beside it, and 14 rows
|
||||
of memory, always there. `F` has nothing to switch, so it just says so; `M`
|
||||
and `D`, the arrow keys and Page Up and Page Down move the windows as on
|
||||
the narrow screen, and `DIR` and `ASM`'s errors use the memory window until
|
||||
`M`.
|
||||
|
||||
### Commands
|
||||
|
||||
Type a command on the bottom line and press Enter. Numbers are in hex, with
|
||||
@@ -1035,8 +1094,8 @@ or without `0x`.
|
||||
| `D addr` | Show the disassembly from *addr* (`D` alone: from PC) |
|
||||
| `M addr` | Show memory from *addr* |
|
||||
| `E addr bytes…` | Write bytes into memory: `E 12000 13 05 10 04` |
|
||||
| `R reg=value` | Set PC or a register, by name or number: `R A0=1234`, `R X10=1234`; a float register as its bit pattern: `R F1=3FC00000` (1.5), or `R FCSR=0` |
|
||||
| `F` | Show the float registers F0–F31 and FCSR, as bit patterns, in the memory window (`M` brings the memory back) |
|
||||
| `R reg=value` | Set PC or a register, by name or number: `R A0=1234`, `R X10=1234`; a float register as its bit pattern, by number or name: `R F1=3FC00000` (1.5), `R FA0=3FC00000`, or `R FCSR=0` |
|
||||
| `F` | On the 80 × 32 screen, show the float registers F0–F31 and FCSR, as bit patterns, in the memory window (`M` brings the memory back); the 132 × 64 screen always shows them |
|
||||
| `SAVE "NAME" start end` | Save memory *start* to *end* (inclusive) to a file in flash |
|
||||
| `LOAD "NAME"` | Load a memory file back to where it was saved from |
|
||||
| `LOAD "NAME" addr` | Load it at *addr* instead (A000 or above) |
|
||||
|
||||
Reference in new issue
Block a user