# CPU cores and the chip rule ## Reuse first: every chip, its family core, what it needs | Chip | Family core today | What it would need | Proposal | | --- | --- | --- | --- | | MC68EC020 (main, 24 MHz) | none: m68000-python's claims exclude "the 68010 and later" (its README) | a new core | **`m68020-python`**, its own Phase 0, shared with Taito F3 (below; decision 1) | | MC68000 (sound, 8 MHz) | **m68000-python** (`55d3d60`, v0.1.0), m68000-rust, m68000-rust-fast | nothing new: autovectored interrupts, per-access bus callbacks, RESET from the board are in its claims | pin it | | TMS57002 "DASP" | none (no DSP of this family among the siblings; dsp16-python, ssp1601-python, upd7725-python are other DSPs) | a new core | **`tms57002-python`** as its own core: it runs a program, and Taito G-NET/ZN boards in MAME use it too (decision 4) | | K054539 x 2 | none; konami68k-python (Phase 0) needs it for X-Men and Premier Soccer | - | **`k054539-python`** now that a second family board needs it (decision 3) | | K056800 MIRAC | none | - | in-board (no second family user yet) | | K056832, K055673/K053246, K055555, K054338, K053936, K053252 | none; konami68k-python needs the K053246 (with K053247) and the K053936 too | - | in-board, pin-shaped; a shared Konami video core is decision 5 | | 93C46 serial EEPROM | in-board on cps1/cps2, jaguar, lynx and others (konami68k's decision 6) | the 16-bit organisation | in-board; the shared serial-EEPROM core is konami68k's decision 6 | | ADC0834 (type 1) | none | - | in-board | | MSM6295 x 2 (the Sexy Parodius bootleg only) | **msm6295-python** (Phase 0) | - | pin it if the bootleg row is ever built (it is out of scope) | | ESC protection device | none; identity unknown | - | in-board, behind a socket ([protection.md](protection.md)) | ## The MC68EC020: `m68020-python` ### What the GX needs from it - The MC68020 instruction set as the EC020 implements it (M68000PM, the 68020 rows): the 68000's set plus 32-bit multiply and divide, bit fields, `CAS`/`CAS2`, `CHK2`/`CMP2`, `PACK`/`UNPK`, `EXTB`, `RTD`, `TRAPcc`, scaled-index and memory-indirect addressing, `MOVEC` with VBR, CACR and CAAR, the format-$0/$2/$9/$A/$B stack frames. `CALLM`/`RTM` are MC68020-only and the coprocessor interface has no coprocessor here. - **The EC020's differences** (DOC, MC68020/EC020 manual section 1): a 24-bit address bus (16 MB), and no `ECS`, `OCS`, `DBEN`, `IPEND` or `BGACK`. Two-wire bus arbitration (`BR`, `BG`; manual 5.7.2): **the GX's ESC uses exactly this** to take the bus (DOC, sheet page 29). - **Dynamic bus sizing** (`DSACK0/1`, `SIZ0/1`): the GX's 8-bit chips on `DB8-15` (K053252, K055555, K056800) and 16-bit ones answer with port-size acknowledges; the core must split accesses by port size and let the board give each access its size and wait. - The **256-byte instruction cache** (64 long words, section 4) with CACR enable, freeze and clear: it changes timing, and code copied into RAM (Racin' Force runs half its instructions from work RAM, OBSERVED) is exactly where a cache matters. - Autovectored interrupts (every GX level is autovectored, OBSERVED), `RESET` and `HALT` from the board (the 051550 and the ESC gate them, DOC). ### The modelling level: why "cycle" is not available Motorola's own timing for the 68020 is **three numbers per instruction**: best case (in cache, maximum overlap with the neighbours), cache case (in cache, no overlap) and worst case (not in cache, no overlap), all assuming a 32-bit bus with no waits (DOC, manual section 8.2). The real figure depends on the pipeline's overlap with the instructions around it, which the manual does not specify. So the 68020 cannot be specified at the bus-cycle level from documents alone, unlike the 68000. The evidence to do better: | Source | Tier | Licence | Can decide | Cannot decide | | --- | --- | --- | --- | --- | | MC68020/EC020 User's Manual (pinned) | 2 | Motorola, facts only | instruction semantics with M68000PM, bus protocol, cache, BC/CC/WC bounds | the overlap rules | | M68000PM (pinned) | 2 | Motorola, facts only | instruction semantics, flags | timing | | WinUAE's 68020 modes (closed box, `$EMU_TOOLS_GPL2/tools/winuae` is a 68000 driver today) | 5, partly fitted to real A1200 timing by its author | GPL-2.0-only | a detector for semantics and timing | a judge | | WinUAE cputest run on a real 68020/EC020 machine (an A1200 has a 68EC020) | 3 if run | test data generated by GPL code: closed box | semantics and exception frames on real silicon | nothing here until someone runs it (no hardware, Aubrey's rule) | | Musashi (MIT, in sources.md as "code OK") | 5 | MIT | semantics detector, decoder check | timing (its cycle tables are fixed per instruction) | | MAME's 68020 (Musashi-derived files `m68kcpu.cpp`, `m68kmusashi.h`: BSD-3-Clause, Karl Stenerud) | 5 | closed box here | detector | | **Proposal:** `m68020-python` specifies semantics exactly (instruction level) and timing at the **transaction level**: every bus access with its size, address, value and the clocks the board charges, instructions charged by the manual's cache-case/worst-case figures by cache state, the overlap modelled as FITTED where a detector shows it matters (U1). That is honest about the evidence and enough for the GX, whose games wait on vertical blank in tight loops ([domains-and-speed.md](domains-and-speed.md)). ### Who else needs it (MAME 0.285, parents with an MC68EC020) taito_f3 (35), konamigx (18), djmain (17), itech32 (12), cubo CD32 (12), namcos22 (11, a sub CPU), namconb1 (10), tasman (7), psikyo (5), dreamwld (5), atarigx2, atarigt, macrossp, fuukifg3, gaelco3d, plygonet, undrfire, amiga (A1200), Jaguar CD's CoJag, superchs, groundfx, gunbustr, galastrm and others: 166 parents. In the family: amiga-python's AGA rows (its decision 8), x68000-python's X68030 (a 68EC030: a later sibling), **taitof2-python's F3 rows (Phase 0 running tonight)** and this board. **Coordination with Taito F3.** taitof2-python's Phase 0 (read at its `599c910`, 2026-11-26) proposes the same core in its `docs/cores.md` and its open decision 2: "Start `m68020-python` with the 68EC020 as its first variant, F3 as its first board", one Phase 0 for the core coordinating the boards' needs (it counts Amiga AGA and the X68030 too). **This board agrees and asks to be the second board**, adding to that core's Phase 0: two-wire bus arbitration with an outside bus master (the ESC), code running from RAM under the instruction cache (Racin' Force), and the 8-bit ports on `D8-15` answered by dynamic sizing. Its sound side (68000 + ES5505 + ES5510 "ESP") has the same shape as the GX's (68000 + K054539s + TMS57002), and both Phase 0s propose the effects DSP as its own core with a pass-through first. Taito pinned the 68020/EC020 manual from nxp.com; this repository pinned another copy (the 1992 first edition; different bytes, perhaps a different revision, [sources.md](sources.md)): the core's Phase 0 should keep one. F3 adds nothing known to conflict (OBSERVED, `-listxml akkanvdr`: its 68EC020 runs at 16 MHz, its sound is a 68000 at 15.24 MHz with an ES5505 and an **ES5510 effects DSP**: the same shape as the GX's 68000, K054539s and TMS57002, so the two sound domains can share a design, not a chip). ## The TMS57002: `tms57002-python` A DSP that executes a 256-word program once per sample ([sound.md](sound.md)). Evidence is thin: the pin sheet (block diagram, no instruction set) and MAME's BSD-3-Clause core as a detector. The core's spec would be **functional at the sample level, instruction-exact against MAME** (tier 5) with every opcode's meaning tagged FITTED, unless a data manual turns up (U18). Its clock and rate come from the board (24 MHz, 512 fs, DOC). **Chip rule check:** it runs a program, so it is a processor and gets its own repository under the family's habit (dsp16-python, ssp1601-python, upd7725-python). If Aubrey prefers the "non-CPU chips stay in the board" reading for a fixed-function audio DSP, it stays in `konamigx_python/sound/` until a ZN or G-NET board arrives (decision 4).