# The DSPP: CLIO's audio processor (a CPU core candidate) Sources: '383 = WO1994016383A1 "Digital signal processor architecture" (3DO Co., Gray and Needle, filed 1993-01-06; its appendices I-III are the fetch, operand-loader and compute state machines in pseudo-code, (c) 1992 3DO; describe, never copy); '641 V.B and table I; SDK music and audio guide and reference (`ppgfldr/mgsfldr/mpgfldr`, `mprfldr`), CD-ROM mastering pages (`smmfldr/cdmfldr`); wiki opera_dsp (tier 3). The patent PDFs are image scans; the ALU and shifter tables and figures 7, 9 and 10 were read from rendered pages. All DOC unless marked. ## Programmer's model - Memories (1K-word data space, 16-bit words): EI 000-0FF (CPU writes, DSP reads; 128 words mirrored; 13 tied to input DMA), I 100-1FF (internal, DSP only; mirror 200-2FF), EO 300-3FF (DSP writes; 16 "quick-out" words CPU-readable). Instruction memory N: 512 words (SDK `10mpg001`) though the PC and branch fields are 10 bits (C10). Memories are not cleared by reset; registers are. - Special addresses: 0EA noise generator, 0EB audio output status, 0EC/0ED semaphore status and data, 0EE PC, 0EF clock counter; 0F0-0FC input FIFOs (13, DMA-fed; reading pops), 0FD-0FE two serial-fed FIFOs; 070-07E peek a FIFO without popping; 0D0-0DE, 0E0-0E3 FIFO status; 3EB AUDLOCK, 3EC semaphore ack, 3ED semaphore write, 3EE interrupt the CPU (the data is the interrupt word), 3EF clock reload, 3F0-3F3 output FIFOs, 3FD flush, 3FE/3FF left/right out. - Formats (first word an instruction stating how many operand words follow): control (bit 15 = 1: MODE, flag select, flag mask, 10-bit branch address), arithmetic (bit 15 = 0: operand count, multiplier input select, ALU A/B input selects, ALU op, shifter op), immediate operand (13-bit, left- or right-justified), direct/indirect address operand (with write-back flag), one/two-register operand, three-register operand. Figure 7 draws arithmetic bit 15 as 1; the text and pseudo-code say 0 (C11). - Datapath: fractional ([-1, 1)); 16 x 16 multiplier keeping product bits 30:11 as a 20-bit result; 20-bit ALU (16 functions: A, -B, A+B, A+carry, A-B, A-borrow, A+1, A-1, and eight logic ops); 20-bit barrel shifter (left 1-5, 8; right 1-5, 8, 16; clip on overflow; load shift from an operand); 20-bit accumulator written back as bits 19:4. Flags N V C Z X (Z on bits 19:4, X "exact" on bits 3:0). - Control: JUMP, JSR (one level), BFM, MOVE, MOVEREG; NOP, BAC (branch to ACC 13:4), RBASE, RMAP, RTS, OP_MASK, SLEEP. Conditional branches on N/V/C/Z/X combinations (the pseudo-code is authoritative; the wiki's table disagrees in two places, C12). One delay slot after a taken branch. - Register addressing: 4-bit register numbers mapped into EI/I/EO through RBASE and RMAP (figure 9/10 table). ## Timing - One tick = the ~25 MHz system clock; the DSP is reset to PC 0 every 568 ticks by a counter reloaded with 565 ("various delays add three ticks"), so it runs one program pass per 44.1 kHz sample. Programs may use 565 ticks less the system's 45 (SDK `10mpg001`). AUDLOCK ties the reset to the DAC's word-select edge instead. - Per the pseudo-code: one tick per word fetched, +1 for indirection; compute 1 tick (transfer), 2 (ALU or multiply), 3 (multiply + ALU); results written at the end of the next tick. Shipped silicon may differ (U25; the pseudo-code itself notes "RED" and "BLUE" chip bugs). ## Around it - 13 input DMA FIFOs and 4 output FIFOs, 16 bits x 8 deep; a FIFO asks for DMA at two samples left; bursts of 3 words; one more channel loads N/EI memory in 4-word bursts (table I; SDK says N, '641 says EI: C13). - Output: I2S, 16 bits per channel, a two-pair output stack, at 44.1 kHz ('641 V.B). - CPU interface: N and EI writes, EO quick-out reads, the semaphore, the interrupt word; CLIO addresses of these are U26 (MAME's register taps show CPU writes at CLIO 0x1800-0x19A8 at start-up). - Programs are 3DO IFF `FORM DSPP` files (code, knobs, resources, relocations) loaded and relocated by the OS; the emulator sees only memory writes. ## What it costs to emulate About 25 M ticks per second, of which programs use up to ~520 per sample (22.9 M/s worst case); a per-instruction model runs perhaps 5-10 M DSP instructions per second at full load (DERIVED; instruments in the SDK cost 6-49 ticks each). This is the 3DO's second-most expensive part after the cel engine, and more instructions per second than the ARM60 itself. ## Why a core of its own It is a processor (chip rule), its programs are arbitrary user code (no high-level model can stand in), and MAME places the same device in the 3DO M2 (a second consumer if the family ever builds an M2 board). Proposed: `dspp-python`, a Phase 0 of its own, with this page and '383 as its start. Until then the board keeps a socket for it. ## Unknowns and contradictions U25 shipped encodings and tick costs vs the patent; U26 CLIO addresses of N/EI/EO/semaphore/ control; U27 bit layouts of 0EB and the FIFO status words; U28 A+1/A-1 granularity; U29 flags before or after the shifter; U30 the N/EI DMA word layout; U31 8-bit sample unpacking; U32 the CD-DA path into the DSP. C10 N memory 512 vs 10-bit PC; C11 arithmetic bit 15; C12 branch conditions (wiki vs pseudo-code); C13 the internal DMA's target.