summaryrefslogtreecommitdiff
path: root/test/perf.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-26 09:56:04 -0300
committerGabriel Schneider <[email protected]>2026-08-26 09:56:04 -0300
commit27a749d3a2155419fb72bab66b1e78bcd99882ae (patch)
tree45659155877f017acae955d64ef789f0d1bd3c7d /test/perf.zig
parentfc263fc4b1ee36a3c4bfd7d730cccb57ebe1064a (diff)
downloadpardes-27a749d3a2155419fb72bab66b1e78bcd99882ae.tar.gz
pardes-27a749d3a2155419fb72bab66b1e78bcd99882ae.zip
Every literal in Peek, Poke and Hexdump is hex; boot the P4 into a tour of the bus
## Hex, always Base-0 parsing accepted `0x4ff40000` and `1341390848` and refused a bare `4ff40000`, on the grounds that guessing between hex and decimal would let one typo address somewhere else entirely. The reasoning was sound and the conclusion was still wrong: the ambiguity it guarded against is not a real one. Every address anybody has ever typed at these three words is hex - it came off a datasheet, a linker map, or a previous dump's own output, all of which print hex - so the base was never in doubt, and demanding `0x` on every one of them was a toll on the common case to protect a case that does not arise. The COUNTS go with them, and that is the part worth saying out loud rather than leaving as a surprise: `Hexdump 4ff40000 100` shows 0x100 bytes, which is 256, not one hundred. One rule for every literal beats two rules that each fit their own argument better, because the second kind has to be remembered at the moment you are concentrating on something else. What these words PRINT is hex too now, clamp notes included, so a number can go back in where it came out. ## And the board boots into somewhere worth looking The empty output buffer was honest and useless. The three words that make this port interesting all take an address, and a board's address space is precisely the thing you cannot guess - so the boot buffer is now a tour of it: the image's own rodata and code in flash, the firmware's data and the editor's heap in L2MEM, the mask ROM, UART0, the systimer, GPIO_OUT and an IO_MUX pad, and one harmless Poke. Every address comes from this repository rather than from memory, which is what makes them worth trusting: the flash and RAM figures are the linker script's own ORIGINs in `05-zig-p4/build.zig`, and the peripheral bases are the `DR_REG_*` values `05-zig-p4/src/hal` uses. Each command sits alone on its line because an argument list ends at the last argument - a trailing comment would be `ExtraArgument` - so the notes go above the lines they describe. Lines are kept inside 48 columns because the first draft wrapped every one of them at the 56-column grid, which reads like a bug. Verified on the die: the buffer renders one line per line, and putting the cursor on `Hexdump 40000020 60`, selecting with `x` and pressing Tab opens a dump whose first bytes are `32 54 cd ab` - 0xABCD5432, the ESP app-descriptor magic - with the version string right behind it. Bare hex, no prefix, reading real flash. snap 95/95, hxdiff 481/0, hxparity 561/0, unit-test, tty/p4/gui.
Diffstat (limited to 'test/perf.zig')
0 files changed, 0 insertions, 0 deletions