Files
courier-emu/tests
Cryan209andClaude Opus 5 1bd6e836ef Give the ASIC a register table that holds both numberings
The gate array is the only thing on the 80186's I/O bus and is also the
DSP's entire external interface, so it has a decoder on each side and
they number independently. Only eight CPU data lines reach the package,
so one 16-bit DSP register is two 8-bit CPU ports. The two spaces
collide on 0x5e, where the CPU means the high byte of the word and the
DSP means the tag.

Nothing in the harness said so. `panel.py` models its corner of the chip
properly - pin, port, bit, and the firmware address each meaning came
from - but the mailbox was four constants and a hand-written mirror in
bridge.py, with the DSP half living in the C5x core's own port array. No
single place recorded that a CPU port and a DSP register are the same
piece of silicon, which is how `set_io(0x5E, 0x229E)` came to publish a
CPU-side latch into the part's tag register.

`asic.py` is that place. `bridge.py` derives DSP_TAG_PORT,
DSP_WORD_PORT, DSP_STREAM_PORT, HOST_STATUS_CELL, HOST_TAG_CELL,
HOST_WORD_CELL, DSP_RUNTIME_PORTS and MIRROR from it instead of
restating them, and `dsp_register()` raises for a register the DSP has
no path to rather than handing back an address to write into the part.

MIRROR is `asic.mirror("tag", "word")`, which is the four entries it
always had: the whole table also carries the status and stream, and
taking it wholesale would have started mirroring both. The panel rows
are recorded for completeness but `panel.py` is not driven from here.

Byte-identical on the leased ROM pair - mailbox log, messages taken, rx
peak, runtime messages and overlay downloads all unchanged on both ends.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 13:10:46 +12:00
..