The core no longer hard-codes 2.1/2.2's c418: Bridge._v8_dispatch_addresses
finds every copy of the dispatcher by signature over the resident bank and
each declared overlay, and set_v8_dispatch_pcs hands them to the core, which
now also reports which one fired as v8_dispatch_pc.
_find_call_overlay requires the candidate to be pre-linked for the
destination - first branch target == 0xc418 + 0x0d. 2.1/2.2's stored copy
satisfies it; the self-linked resident copies on 302/403 do not, so nothing
is published there any more.
Measured on a 403 linked pair against the old behaviour as a control: every
V.8 number identical, only call_overlay_available moves, so the gate changed
nothing observable. The dispatcher does run, at 0xba0b, 22,471 times - but
@48, @4a and @4d are all zero, so every entry branches to program 0, and
v8_rx_peak and the audio rms are zero on both sides in the baseline too.
Artifacts in artifacts/v8-dispatcher-403-01/.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`dsp_originated_tags` polls `io_port_stats` once a batch and then reads
whatever `io_output` holds, which samples an asynchronous stream: it
counts polls that saw a change, not messages, and can pair one
message's tag with another's word. The general I/O event log cannot
stand in for it either - it is unfiltered and capped at 8192, and the
datapump's transmit writes to port 0x50 run to half a million per call,
so it holds nothing but PCM by the time anyone reads it.
Keep a separate log of the writes to 0x5e..0x60 in the core, and decode
it in the bridge on the resident sender's own boundary: the tag goes to
0x5e and the words follow on 0x5f (0x83eb, 0x83ee, 0x83f6), so a write
to 0x5e opens a message. `status().dsp_mailbox_log` is the ordered
result, with the pc and instruction count of each send.
On a leased pair it confirms what the poll had reported, so the poll was
not in fact tearing here: the answerer sends exactly two messages in
150M instructions and the originator one.
a 92,860,533 tag 006b words 0000 4321
a 112,636,450 tag 0034 words 0000 0005
b 99,940,384 tag 006b words 0000 4321
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
m_io_events was an unbounded std::vector that grew by one entry per
DSP I/O operation — millions per second of simulated time. Over a
long interactive session this alone consumed tens of gigabytes and
triggered the macOS OOM killer. Switch to a std::deque with a rolling
window; the per-port aggregate stats in PortStat are unaffected.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
op_clrc_intm() calls check_interrupts() inline, which is right at an
instruction boundary and wrong inside a delay slot: it pushed the return
address and set the PC to the vector, and then the enclosing op_calld's
CHANGE_PC(pma) overwrote the PC and left the push behind. One orphaned
stack entry per execution.
SPRU056D 4.9 has a delayed branch and its delay slots complete as a unit,
with no interrupt serviced between them, so the pending interrupt should
simply be taken at the next boundary.
This firmware guards every host-port access with the same idiom -
setc intm ; calld 80e8 ; lar ar1, #xx ; clrc intm
at 80eb, 8103, 82c6, 82d5, 8323 and 83c4, so the stack drifted a level on
every port read. The visible damage was in the datapump's receive delivery:
8320's RETD at 8330 popped the stale 8327 its own CALLD had pushed, re-
entering the routine at 8327 with ARP still 1 from the `sacl *+, ar1`. AR1
holds 0x6f there, so the delivery wrote the assembled character over @6f -
its own flag word - clearing bit 3 and disabling receive delivery, after
reading that same cell as if it were the host status port.
With the FSK loopback running the firmware's own loop, that is the
difference between 14 characters delivered and 1211, and @6f now reaches
008c - carrier, receive delivery and transmit data all enabled - instead of
being knocked back to 0007.
Also adds stack_entry()/NativeC5x.stack(), which is what made the orphaned
push visible.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
C5xCore::data() answers from m_data, which for an address below 0x60 is a
cell that no memory-mapped register keeps up to date. DM_READ16 routes those
through cpuregs_r; the inspection accessor never did. So every harness that
reached for a register got zero however the firmware had set it, and said so
confidently:
PMST reads 0000, is 00b0 - iptr 0, MP/MC 0, OVLY, RAM and AVIS all set
CBSR1 reads 0000, is 0bc0 - the datapump's output buffer
CBER1 reads 0000, is 0bdf
CBCR reads 0000, is 00ef - circular buffer 1, AR7, enabled, 32 words
TDXR reads 0000 - whatever INTR 17's handler has been writing
Reading those four was what led to "the firmware never sets up a circular
buffer" and "TDXR never changes". Both were the accessor, not the firmware.
register_value() answers from the register and has no side effects, which is
the difference that matters for an inspection path: cpuregs_r pops the codec
queue on DRR and clears the ready flag on TRCV. data() keeps its meaning, so
nothing that already treats low addresses as scratch changes behaviour.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AT&T1 is local analogue loopback: the codec's transmit comes back to its
own receive, and the DSP modulates and demodulates against itself to
exercise the analogue side. It is not meant to reach the line, so the
on-hook DAA in the last run was correct and the silence on the socket was
never the fault.
The loop was simply not modelled. c5x_core decoded the AC01's loopback
bit from register 5 and reported it, and the receive sample came from
m_codec_rx unconditionally, so a run with no peer fed the datapump
silence. docs/ac01-codec-protocol.md already said the setting "does not
yet alter the samples".
Nor is there anything to key it off. Running AT&T0, AT&T1 and AT&T8
standalone, &T1 and &T8 send byte-identical mailbox sequences - the same
33 messages in the same order, ending 0071:0003 0077:0000 0076:0000
0002:9d00 0002:dc00 0004:0000 0010:5001 001f:0000 0019:0000 - and leave
register 5 at its boot 0x05, IN+/IN- selected, loopback bit clear. Only
the B register moves, 20 -> 18, which is overlay 6 selecting 10266.67 Hz
from the negotiated symbol rate. The hardware capture agrees: the four
ports asic_ports.py records as moving between idle and &T8 are the
mailbox status pair and live signal, not a path select.
So the return is the analogue front end, not a command. The codec's
output reaches its own input through the hybrid, attenuated by how well
the hybrid is terminated: on hook the DAA isolates the line and the
hybrid looks into an open, so nearly all of it comes back, which is the
path &T1 tests and why it needs no bit of its own.
Modelled core-side, flat, with a short delay. codec_transmit taps the
analogue output into a delay line; codec_frame sums it into the analogue
input ahead of the input gain, so it shares the gain with the line. The
scale is set from hook state by the bridge - 240/256 on hook, 26/256 off,
the latter a stand-in for a real hybrid's 20 dB trans-hybrid loss and not
a measurement of this board - and applied outside the line guard, because
a standalone &T1 has no line and is the case that needs it.
Measured, AT&T1 standalone at 200M instructions:
hybrid_frames 445,781 loop carries every primary frame
hybrid_peak 12,123 against a transmit peak of 12,135
codec_rx_peak 24,246 after the +6 dB input gain, no clip
drr_reads 379,805 the ISR is consuming it
&T1 has no start-up to complete: it is a data-mode test, the modulator
sending a sequence into the loop and the demodulator recovering it. There
is no handshake to wait on and no originate/answer role, so an earlier
draft of this message that guessed at one is withdrawn.
What closing the loop changes is one extra DSP-to-host report, 0004:0000,
present with the loop closed and absent with it open against an otherwise
identical run at 200M. The demodulator sees the signal and says something
about it.
Nothing else moves. Queuing 16 bytes of data behind the command leaves
serial_input_remaining at 16 - the firmware never takes them, so the DTE
data path is never opened - and serial_text is empty, so not even a
result code comes back. CD stays off. The HS LED does light, at
i=35,293,183, but it lights identically with the loop open, so it says
nothing about the loop; checked against 144c95c rather than assumed.
So the loop is closed and carries the modulator at a sane level, the
demodulator consumes it and reports once, and the firmware does not
declare the test up. Whether the demodulator recovers the sequence is
still unmeasured. Next: what tag 04 is, and what the supervisor waits for
before it opens the DTE path.
47 tests pass; the leased pair is unchanged, both ends still loading
['9d00', 'dc00'] with 0 unreadable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Scott confirms the board clocks the DSP at 20.16 MHz. The core carried
25 MHz, picked to reproduce a shipped frame-period constant of 3472
cycles rather than measured from anything.
The sample rate is unaffected - the clock cancels out of
MCLK / (2 x A x B) - so this moves no frequency and is not the 1.2 in
codec-sample-rates.md. What it moves is the frame period: 2520 cycles
where the board has 2520, against 3125 before. The DSP had been getting
24% more compute per sample than the part it models.
The pre-programming stand-in goes from 3472 to 2800, which is the same
7200 Hz it always meant, now at the right clock.
Behaviour is unchanged where it can be compared: the 302
`--exchange-hotline` run still loads overlay 8 and still transmits
continuously at the same level, and the leased pair still holds its
tones. Captures get longer for a given instruction budget, because more
frames now fit in one, so recorded sample counts and hashes move.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two counters: how often the datapump wrote the ASIC line-DAC slot, and
how many codec frames collected those writes. Their ratio is how many
datapump samples the model folds into one line sample.
They answer that immediately, and not the way the code reads: across a
whole leased-pair run both are zero. The branch whose comment says "the
line slot carries the datapump's own DAC accumulation and nothing else"
never executes on this route - it is gated on call-TDM being active, and
it is not. Every line sample is pushed from the generic write hook
instead, at C52 program 0x818f, one per line-frame interrupt.
So the accumulate-and-average DAC model does not produce the line on the
path that matters, and the 1.2 in codec-sample-rates.md is not hiding in
it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`--dsp-write-watch` recorded nothing on 302 or 403. The bridge arms the
trace when it builds the core, and these images then reset the core
during boot - which cleared the flag. Every watch since has been
reporting an empty list rather than "no writes".
What is traced, and which cell, is the caller's diagnostic, not device
state the reset line owns.
With it kept, watching 0x39a shows the answering end of a leased pair
re-running its own init mid-handshake, which is how the transmit
teardown was found.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
courier_c5x_get_io_port_stats answered every query by walking the whole
m_io_events vector once per port. That vector is only cleared at reset, so
the scan was linear in the length of the run, and the bridge's ROM-load and
overlay-commit loops ask for the stats once per single-step: the cost of
committing a block grew with how much had already been committed.
Keep the six figures per port in IO_READ16 and IO_WRITE16 instead, the way
m_data_write_counts already does for data writes, and make the query an
array lookup. Replaying the event log over a five-million-instruction run
reproduces the new counters exactly, and a twenty-million-instruction run
of MAIN_2.3.31 gives byte-identical output.
At 139k events the sixteen-port query drops from 599us to 21us and stops
growing; a step(1) loop that samples one port goes from 0.12 to 0.52M
instructions per second.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The flag hunt at e8ba has a driver at e63a that sets TREG2 = 15 and @7c = 7
before calling it, so the hunt eats the byte one bit per call and trips its
pop/ret - discarding the bit helper's return address to land on the driver's -
when TREG2 reaches @7c. The per-frame cycle is the resident splitting a
received word, calling the handler the overlay installed at 088c/088d, that
handler at eb39 bit-reversing the octet, the hunt eating eight bits, and the
pop/ret bringing control home.
It never came home because TREG2 was only half a register here. cpuregs_w
bound TREG1, TREG2 and DBMR; cpuregs_r bound TREG0 and stopped - the exact
split the comment above case 0x0c warns about, left half-applied. lamm @0e
read a dead cell, so sub @7c was never equal, and samm @0e wrote ffff back
every time: bitt tested bit 15 for 3,186,292 iterations while the counter it
waited on never moved.
With the read side bound, the modem answers, synchronises on the far end's
flags and idles the link with 6,937 of its own - HDLC 7e, not noise - the 5e
command is consumed, and the whole call runs to a clean l4_DISCONN and NO
CARRIER once the far end proves to have nothing above framing to say. The DSP
ends at IDLE with the mailbox drained 39 of 39.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The DSP's serial port is in sixteen-bit word format - the firmware writes
SPC = 40c8 and FO is bit 2, the same bit docs/quad-dsp-pcm-path.md already
separates the two products on. Sixteen bits every 125 us is 128 kbit/s: two
eight-bit peripheral-port time slots, where one B channel is 64. The core had
a comment claiming byte format and clocked one octet per frame into the low
byte, leaving the high byte - the half the firmware's own splitter at
80db..80de reads for this call - permanently zero.
The core now reads FO out of SPC rather than assuming it. FO=1 keeps one octet
per frame, which is the Quad's path (SPC = 40cc) and is unchanged. FO=0
exchanges a whole word, MSB first, so the frame's first slot is the high byte
at both ends - which is what decides the mapping rather than a preference.
Am79C30.peripheral_slots() says which channel is in which slot, taking them in
the order the MCRs list their connections. PPCR1 and PPCR2 are recorded and
not decoded: nothing in the image has shown what their fields mean.
ImodemDsp._sync_pcm exchanges one MUX frame per pair of octets, so B1 still
carries one octet per 125 us.
A call programs MCR1 = 16h and nothing else, so B1 takes the first slot and
the second is unconnected. DRR now reads 7eff against a flag-carrying far end:
the B-channel octet in the high half from Bd, idle in the low half from a slot
the MUX has nothing on. The deadlock at e8ba is unmoved, as expected - but the
byte it is stuck on is now the right byte.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Added codec_rx_size, line_frame_irq, frame_period, line_frame_next_cycle and
cycles to codec_state(), and surfaced the core's codec state as `core_codec` on
the bridge status, which nothing reported before. One instrumented dial answers
what three commits of reading the code could not:
line_frame_irq 5
frame_period 3472
line_frame_next_cycle 3472
cycles 0
codec_rx_size 228480
frames_clocked 0
pc / instructions 0 / 0
active False
bootstraps 1
m_cycles is zero because the C52 never executes an instruction. The frame
driver compares m_cycles against m_line_frame_next_cycle, 0 >= 3472 is never
true, codec_frame() never runs, and the queue fills to 228,480 undrained.
The reason is bridge.py:1327. A DSP reset closes the core, builds a fresh
NativeC5x and sets active = False; active only returns when a re-download
reaches bootstrap_target_size, and that second download never comes -
bootstraps stays at 1 - so the part is held dead for the rest of the dial.
Under ATX0 the supervisor skips the wait, loads the call overlay, and the DSP
comes back, which is why that path has always worked.
So the dial-tone failure is not a missing detector, not a missing flag and not
a gated ISR. Three separate conclusions in this document said otherwise and all
three were reached by reading code rather than by asking the core what it was
doing. The instrumentation is kept for that reason.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The core carried hand-written sin() in C++ that stood in for the datapump's
DAC output: a DTMF pair generator, a 1300 Hz V.8 calling indicator and a
2100 Hz ANSam approximation, armed from the bridge through set_dtmf_digits
and gated by set_synthetic_line. While it ran it also *discarded* the C52's
own DAC accumulation to make room, so the assist did not merely supplement
the firmware, it displaced it.
It is gone. dtmf_sample(), m_dtmf_digits, m_synthetic_line and the three
substitution sites (the 0xb2e5 write guard, the call-TDM V.8 branch and the
idle branch) are removed, along with the C API exports, the Python bindings
and the bridge's arming calls. V8Mode stays: the role still gates the
receive-side indicator qualification, which observes the line rather than
driving it.
Nothing is lost on the image that matters. Rerunning the 3.0.13 capture with
the generator deleted produces line audio byte-identical to the reference
(sha256 ccad9c62...), and decoding it independently at 7200 Hz returns
5551212 - the number the firmware was asked to dial. The C52 was already
doing the work; only the stand-in's presence obscured that.
The three tests that covered the generator went with it. They asserted on
main211, which is not modelled well enough to be a behavioural reference.
The bridge tests that used core.dtmf as a proxy for reaching the dial phase
now assert on bridge.dial_digits and daa.operation instead.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
--dsp-write-watch ADDR records every write to one C52 data cell with the
program address that made it. The write trace was unfiltered and its
4096-event buffer covers milliseconds; the read side also traces a fixed
set of cells and floods the buffer on its own. Both honour the filter now.
Watching 39a across a 403 dial gives four arm/restore pairs, one per
digit: ee2b writes 8743, and about 2.3M instructions later - roughly the
tone's duration - 86dc restores 8128. That is a one-shot callback
lifetime, not a clobber, so the end-of-run 8128 was just the idle state.
Watching 3c0 inside one of those windows shows the phase advancing by
0x2f81 per sample, exactly the increment tblr loaded into 3f2. The
oscillator runs at the right rate from the right table entry.
So the mailbox-to-oscillator path is sound and the tone is generated but
never reaches the line. What is left is the mixer's output path: the
work pointer at 390 reads 0bd8 in the full-board run where audio312,
which does produce output from this ROM, supplies 0bc0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The core's PC trace was two hardcoded ranges. set_pc_trace_range adds a
third, settable one, exposed as --dsp-trace-range FIRST:LAST. Pointed at
ee00:ef00 it catches 3.1.2's tag 0x13 handler four times in a dial, once
per digit, and the handler is correct: it indexes the frequency table at
ee34, loads both increments, installs 8743 - the DTMF pair generator -
in the mixer's callback slot at 39a, sets the amplitude and clears both
phases. Every cell is one answer-tone.md already named.
So the silence is downstream of the handler. --dsp-peek reads C52 data
cells at the end of a run, and after a 403 dial the increments are still
loaded while 39a holds 8128 rather than 8743. Whether that is the
firmware restoring a silence generator after the tone or something
writing one cell low is not separable from an end-of-run value; it needs
39a sampled while a tone plays.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adds arcr/indx to State so the auxiliary-register compare that gates the
resident's block-level work can be observed rather than inferred.
With them visible: over a 600,000-instruction warm start, ARCR changes exactly
once - the reset to zero - and is never written again. AR7 meanwhile cycles the
mailbox ring 0x0bd0-0x0bde under the circular-buffer registers, so cmpr eq at
0x80d1 can never match and the block holding the mailbox poll never runs.
CMPR itself is confirmed correct in the core: it compares m_ar[arp] against
m_arcr, and ARP is 7 there, set by the mar *, ar7 before the loop's delayed
branch.
Also records what the idle state actually is, which was misread earlier as the
DSP being stuck: 0x822b sets @1a to 0x8139, a bare ret, and @1b to 0x8138, which
is intr 17 - vectoring through ROM 0x0022 to @69 = 0x81b7. That accounts for the
two largest slices of the PC histogram. A dozen sites across the resident reset
@1a to idle when a task ends, so the cells are a task pointer and the firmware
is idling by design, waiting to be given work.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
XRDY says DXR can accept another word, which becomes true when a frame sync
moves the last one into the transmit shift register. It was reported set
whenever XRST was set, so the firmware's reset handshake at 0x8097 - write DXR,
spin on XRDY, write again - fell straight through instead of waiting a frame.
It now clears on a DXR write, sets on a frame sync, and is released by a 0 -> 1
edge on XRST.
Scoped to the AC01 path: the legacy TDM path models no framing on this port, so
nothing there would set XRDY again after a write and a spin would never end.
That is a limit of this model rather than hardware behaviour, and it is
commented as such.
Also records what the boot table sharing the port actually rests on. TI's
application guide puts the AC01 on the primary serial port and leaves the TDM
port pulled to COM, which the firmware agrees with; the ROM loader is on that
same port and is receive-only. The datasheet holds DOUT in high impedance until
the eighth primary frame sync, and the firmware issues exactly eight primary
frames first - two priming writes plus six register writes - so the ASIC can
drive DR with the boot table unopposed until the codec is fully programmed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
DRR was filled lazily, when the firmware happened to read it, so a run whose
receive queue was empty returned the same stale word every frame - 28,212 reads
of one value in the survey run.
codec_frame now runs at every frame sync:
- one ADC word per primary frame (section 2.4, "one word for each primary
communication interval"), delivering a zero for a quiet line rather than
repeating the last word;
- no sample on a secondary frame, which carries the addressed register when a
read was requested and zeros otherwise, so a readback arrives with the frame
rather than with the host's read;
- the secondary frame sync half a frame period after the primary that asked for
it, which is Figure 2-1's (B/2) FCLK periods given fs = FCLK/B;
- RRDY following a word having been clocked in.
The ROM boot table shares the port but is not the sample stream: a frame sync
consuming those words breaks the download. queue_codec_boot keeps them in their
own queue, drained only by the loader's polls.
302 boot measures 1911 frame syncs and 1911 samples consumed, one each, with
DRR carrying live audio.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The rate was hardcoded: 3472 cycles in the core and 9600 Hz in every generator
that filled the receive queue. The firmware retunes register 2 at runtime for
each V.34 symbol rate, so a constant is wrong by construction - and the two
figures disagreed with each other, making the DSP hear every frequency scaled
by 4/3.
C5xCore now decodes DXR the way the part does. Which kind of frame a word
belongs to is decided by the previous frame's control bits, which replaces a
test against two hardcoded ISR addresses that recognised the samples of two
known builds and nothing else. Secondary words are parsed into a nine-register
file; writing register 1 or 2 recomputes fs = MCLK/(2 x A x B) and the frame
period with it. Register reads, the no-op register, forced secondary and
software reset are handled.
bridge.LineToCodec resamples line audio to whatever rate the codec currently
reports, so the harness can keep carrying the line at a fixed rate without that
rate reaching the DSP. A 2100 Hz tone now measures 2100 Hz after conversion
instead of 1575.
Booting 302 through the ROM recovers the six reset registers, 7200 Hz, and a
frame period of 3472 - the constant it replaces, now derived.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The previous commit claimed the resident performs no data read in
0x8000-0xfeff but the bldp's. That count was taken on the boot path alone, and
taking it for the whole firmware was wrong: the V.34 arming path reads data
0xfea1 six times from 0xd668, walking the capability descriptor list.
That read is not evidence against the shared model - 0xfea1 is above the
resident's 0xec3d and above the highest overlay's 0xf8b5, so it is free RAM in
use as data, which is what one memory answering both spaces predicts. What it
exposed was a harness split: set_data and data() reached m_data while the
running program reached m_program, two arrays for one RAM, so a staged
descriptor was invisible to the code that read it. Both accessors follow the
window now.
main211.xmf is a different matter. It offers a first segment at origin 0x0000
alongside one at 0x8000, and which is its real payload is unresolved, so the
harness cannot say where its RAM sits; with the window on, its call-overlay run
never armed IMR. NativeC5x now switches the window off when any program segment
origin is below 0x8000, leaving such an image exactly as it was. The window is
a fact about the 20.16 MHz ROM downloads, whose segments are all at 0x8000 or
above, and an open question elsewhere.
Seven tests across test_v34.py and test_bridge.py were failing on the previous
two commits and pass again. 302 is unchanged by the gating: one bootstrap, idle
at 0x814d, 120 shared-window accesses.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
302's prologue block-moves its mailbox cell-read helper into SARAM with `bldp`
from data 0x80f5, which only yields code if a data read there returns the
downloaded program. An earlier attempt at that was reverted as a regression.
The measurement that note asked for - every data access at or above 0x2c00,
logged with its PC - says the revert was wrong. Across a 2M instruction run the
302 resident touches exactly twenty-five sites: writes at 0xfff0-0xfff7 and
0xff51-0xff5f from the prologue, reads of 0xff60/0xff61, and three reads of
0x80f5-0x80f7 by the bldp. In 0x8000-0xfeff there is no read but the bldp's, so
there is no second read that could depend on getting something other than
program words.
data_region now returns a Shared region for 0x8000-0xfeff, backed by the
program storage in both directions, and the memory map reports data_shared
alongside data_external. The window stops below 0xff00 because the firmware's
own ASIC pages are DP 0x1fe/0x1ff; its exact edges are not otherwise measurable
from a run.
The effect on 302 is not subtle. Copying zeros into 0x23f0 made the
dispatcher's calld execute nothing and the part fall into unloaded low memory
and re-enter its own reset prologue - four passes in 200k instructions, PC at
0x0115 after 20M, 16.3M external program fetches. It now boots once, runs the
real helper out of SARAM, and parks in the idle at 0x814d waiting for a frame
interrupt the harness does not yet deliver: 67k external fetches, 7155 SARAM.
403 is byte-identical either way, with data_shared zero, because it keeps the
same helper in-bank at 0x80e8 and never reads program space as data.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
SPRU056D puts the 9K part's SARAM at 0x0800-0x2bff in program space when
PMST.RAM is set and at the same addresses in data space when PMST.OVLY is set.
That is one physical memory seen from both spaces, and the core backed the two
with separate 64K arrays, so a data store into the window was invisible to a
fetch from it - which is what the firmware's own block moves rely on.
program_region and data_region now return a Saram region for that window under
the respective bits, fetches and program writes there go to the data storage,
and the memory map reports program_saram and data_saram counts alongside the
existing ones.
No behaviour change on the 302 mailbox probe: @57 still reads a000 and ATY12
still times out. SARAM is RAM, so something still has to fill 0x23f0 before
the dispatcher's calld reaches code, and on hardware that is the firmware's
own block moves, which only run once it gets that far.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The core decoded PMST as iptr = bits 15-11 with the vector base at iptr << 11,
and avis at bit 7. SPRU056 puts IPTR at bits 15-7 with the base at IPTR << 7
and AVIS at bit 6; bits 5-0 were already right. This firmware's own prologue
does apl @07, #07f8 then opl @07, #00b0, which leaves bit 7 set - IPTR 1, a
vector base of 0x0080 - and the old layout read that bit as AVIS and kept IPTR
at zero, so every interrupt vectored to 0x0000.
Measured effect on a 302 run: the DSP now reaches its wait routine at 0x8149
and executes at the configured vector, where before neither appeared in a PC
sample. Pointing the frame interrupt at the ISR entry 0x816b then puts the
histogram on the ISR body, 0x817d..0x8196, with 1000 samples parked on the
idle poll at 0x814d.
Still not a working transfer: @6b is never cleared, because the ISR stores a
continuation in @65 for the next interrupt to run and a fixed configured vector
re-enters 0x816b every time instead. ATY12 still times out.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Four measurements on an answered call with the synthesizers off.
The overlay runs and stalls where this file already said: 89 dispatches at
c418, 14 entries to the c853 loop, and a PC trace dominated by it.
The frame ISR at 0x0228 is the polyphase resampler, not a DAC writer. It runs
about ten times per codec sample - 10.09 writes per sample to fffd, fffb and
ffff, 20.2 to fffa, 30.3 to fffc - which is the TDM slot rate against 9.6 kHz.
It takes the slot from @52, indexes four descriptors at program 824d, and
filters the ADC pair @78/@79 into the 32-bit accumulator @7c/@7d. So fffd is a
phase accumulator's low word, which is why reading it as the DAC measured as
noise.
Nothing in the ASIC block is a waveform. De-interleaved by TDM phase - which
line_phase_samples now makes possible - slot ffff carries two to four distinct
values in every phase, peak/rms 0.066. The whole overlay writes 723 cells, and
every one outside fff8..ffff fewer than 200 times in 98,237 codec samples.
And the reason a known far-end tone appears nowhere is not the firmware. With
the ADC injection routed through DM_WRITE16 it becomes visible: 0xfff8 is
written once per codec sample, 24,979 times, every write the same value.
codec_rx_queued 495,360 against codec_rx_consumed 101,020 - the queue fills
about five times faster than the DSP drains it, so the datapump is hearing
silence from about forty seconds ago. That is a harness bug, and it invalidates
any earlier reading that assumed the datapump had heard the line.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
With a modeled line attached the core's DTMF and V.8 generators are switched
off. They are hand-written sin() in C++ - 1300 Hz gated 500/500 for calling,
2100 Hz with 15 Hz AM and 450 ms reversals for answering - and while they run
they discard the datapump's own DAC accumulation to make room, so the firmware's
output was computed and thrown away. set_synthetic_line(False) ends that, and
is reapplied to every core, including the one a line operation reloads.
The bridge's own DTMF renderer is gone with them. It recorded the digits the
supervisor commands and played none of them, so exchange.dialed - what the line
actually heard - is now the measurement rather than an echo of the harness.
With the tones off, an answered call reaches the overlay: ring the line, let
the firmware answer, and the recovered bank executes. What it writes is not
audio. The frame ISR at 0x0228 keeps a 32-bit phase accumulator in @7c/@7d,
which at DP 0x1ff is 0xfffc/0xfffd - and 0xfffd is what the core read as the
DAC. That is why the output measured as noise: it is a linear ramp stepping
-14704 per sample and wrapping, about 2.15 kHz at the codec rate. The word the
ISR computes from it goes out through @7a to 0xffff, and that slot carries two
distinct values, near DC. Neither is a waveform. set_line_dac_slot makes the
choice measurable instead of assumed; the default is unchanged.
Also here: the exchange drives the ring detector on port 0x14, publishes the
board's call-up edge when it puts a call through, and takes a hotline route
that answers on seizure.
So the datapump runs and where its PCM leaves the C52 is unresolved. The tblr
at 0x022e against a table based at 0x824d is the next thread. V.21 is generated
nowhere and never has been.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A first host-to-DSP write attempt wrote the four data registers and observed
nothing. The supervisor's own mailbox interrupt at 0fda9 explains why, and the
DSP's dispatcher at 839b explains it better still.
The wire format was never the problem. What was missing is the commit: bit 0
of port 1c is the board's standing request, and the interrupt answers it by
writing the status back with that bit still set, clearing it first only on the
path that had nothing to send. An idle unit reads 1c as fd forever because the
supervisor in command mode never has traffic.
With the commit supplied, a tag is repeatable and predictable. Tag 07's
handler is three instructions and reports 8031; tag 62 reports 8069; the tags
that reach the bare ret at 8222 are a null control. Every prediction was fixed
from the disassembly before the runs and held in both directions, and tag 62
even returned its own saturation constant.
That also refutes the shape the emulator models. A mailbox tag is a command
index into a 121-entry jump table bounded at 7f, not a destination address, so
writing an arbitrary DSP data cell through it was never possible. Only 27
handlers store the host's word at all, each at one fixed address, and none of
them is an index either program reader uses. host_write() is kept as a way to
seed modelled state, with a comment saying it is not the board's protocol.
The 60/62 window's producer is now identified as the DSP: 84b7 is out *, 0060
followed by a status bit 2 that the supervisor's interrupt answers by calling
its chain vector. Acknowledging that bit is what pumps it, and pumping tag 46's
streamer returned sixteen words whose first four are DSP program memory,
matching the flash image at addresses predicted beforehand and reproducing
across two runs. So a readback channel exists and works end to end.
What is missing is a reader whose address the host can choose. Both known ones
are shut: 032a's readers compute an unmasked program address but both writers
clamp it below the six-entry jump table it indexes, and 03db's only writer
stores ae12's return, which is a six-way priority encoder and so cannot exceed
five whatever feeds it - tested on hardware by unmasking its one host-writable
AND term, ffb1, which left the index at zero.
The hardware also corrected a reading: tblr *+ post-increments the auxiliary
register, not the accumulator, so tag 46's paired table reads fetch one address
twice rather than consecutive words.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>