# Validation plan and oracle inventory ## The blunt answer first **No hardware-tier oracle for the TMS34010 exists.** Not a single-step corpus, not a bench capture, not a logic-analyser trace, not a TI conformance suite. This was investigated on 2026-09-12 rather than assumed, and the negative is documented below with what was searched and what came back. It is not going to change by looking harder. So the judge for this core is: > the *TMS34010 User's Guide* (SPVU001A, 1988), sections 12 and 13 and > appendix C, **plus** MAME 0.285 lockstep as a detector, **plus** the > Midway boards' own power-on self tests and the Y-Unit factory test ROM as > an end-to-end gate. That is a weaker foundation than any other core in this set has, and the right response is to say so in the README and in every claim, not to dress up an emulator's agreement as verification. ## The rule for ranking oracles Rank an oracle by **where its expected values came from**: 1. **hardware-captured** — a real chip ran it and its outputs were logged; 2. **hardware-corrected** — a model or a self-checking program whose disagreements with real hardware were found and fixed; 3. **emulator-derived** — another program's opinion; 4. **documentation** — the manufacturer's stated behaviour. A lower-tier oracle is a **detector**, never a **judge**: it may raise a difference for investigation; a higher-tier source decides. Every oracle below states its tier. For this processor, tier 1 is **empty**, and tier 2 contains only end-to-end evidence (programs that ran on real boards and reported pass or fail), never per-instruction state. --- ## What does not exist, and how that was established ### No SingleStepTests corpus (confirmed 2026-09-12) The SingleStepTests organisation's repositories, enumerated from `https://api.github.com/orgs/SingleStepTests/repos?per_page=100` (22 repos, one page, so the list is complete): `ProcessorTests`, `8088`, `8086`, `80186`, `80286`, `80386`, `v20`, `65x02`, `65816`, `680x0`, `m68000`, `z80`, `sm83`, `spc700`, `huc6280`, `sh4`, `ARM7TDMI`, `r3000`, `ares_r3000_ssts`, `tlcs900h`, `ares_tcls900h_ssts`, `GameboyCPUTests`. **No TMS34010, no TMS340xx, no GSP.** An issue search for `org:SingleStepTests tms34010` returns nothing, and none of the 42 open issues mentions it. The archived `ProcessorTests` README explains why one is unlikely: their method needs a generating implementation that already passes other published sets, and for this chip there is neither a prior set to bootstrap from nor a capture rig. ### No test suite anywhere else A GitHub repository search for `tms34010` returns **twelve** repositories in total; `tms34020` returns two; `tms340 test` returns none. The twelve are documentation archives, disassemblers, Ghidra plugins, HDL reimplementations and a development-environment project. None is a test suite in the SingleStepTests sense. ### TI never shipped a CPU exerciser TI's *TMS34010 Software Development Board User's Guide* (SPVU002A, 1987) documents a "Demo & Diagnostic" floppy holding `SDBDIAG.EXE`, `SDBDIAGT.EXE` and `SDBDIAG.OUT`. Appendix C reproduces its passing output — memory address-pattern and data-pattern tests over the frame buffer, shadow RAM and program RAM, then a "TMS34010 Execution Test", then `DIAGNOSTIC COMPLETE: ERROR COUNT = 0`. Read section C.2.4 before getting excited. The "TMS34010 Execution Test" loads `SDBDIAG.OUT`, sets up an NMI vector through the host port, triggers the NMI, and then *the host and the TMS34010 exchange packets of data*; the test fails if the host receives wrong data or times out. It is a board liveness and host-port handshake check. It is not an instruction-set test. And **the binary is lost anyway**: it is not in `tms34010guy/tms34010-sdk` (74 files, tree enumerated) nor in `birdybro/TMS34010_Info`'s `tools/original-disks/` (40+ disk images, tree enumerated), and it is not on anyone's wanted list. What *is* preserved from TI: the 1985 Assembly Language Package (including TI's own PC-hosted **GSP simulator**), the 1987 Sample Function Library, the Graphics Math Function Library, GSP Paint, and the 1990 TMS340 Family SDK. Recording the gap here because nobody else has: **the SDB "Demo & Diagnostic" disk is unpreserved**, as are SPVU008 and SPVU028, the XDS emulator guides that would document TI's own silicon bring-up method. **There is no on-chip self-test.** The full OCR text of the 1988 User's Guide (1,169,432 bytes) contains zero occurrences of "self-test", "diagnostic", "test mode", "scan path" or "emulation pin". The only version-introspection facility on the chip is the `REV` instruction, and MAME returns a hardcoded 0x0008 for it. --- ## The oracles that do exist ### 1. The *TMS34010 User's Guide*: documentation, and the judge by default | | | | --- | --- | | Document | TI, *TMS34010 User's Guide*, **SPVU001A**, August 1988 | | URL | (33,400,761 bytes; HTTP 200 confirmed 2026-09-12) | | OCR text | (1,169,432 bytes) — use this for grep, not the PDF | | Licence | TI copyright. Cited, never redistributed; no PDF is committed here. | | What matters | **Section 12** the alphabetical instruction set; **section 13** instruction timings in machine states; **appendix A** the TMS34010 data sheet reproduced whole; **appendix C** "Software Compatibility with Future GSPs" | | First edition | SPVU001, 1986, at (12,504,602 bytes, 200 OK) — not on bitsavers | | TMS34020 | (doc 2564006-9721, Aug 1990, 62.8 MB) | | Also on bitsavers | SDB User's Guide SPVU002A 1987 (12.0 MB), Assembly Language Tools SPVU004 1987 (23.8 MB), SDB Pocket Reference 1987, TMS34020 SDB Guide 2558670-9761B 1991, C Source Debugger SPVU021A 1991, and the Graphics Library **SPUV027** (that spelling is bitsavers' own typo in the filename; SPVU027 404s) | **Two corrections to this project's commission.** There is **no "TMS340 Family Data Manual"** on bitsavers under that or any other name — the complete `components/ti/TMS340xx/` directory (23 PDFs, three subdirectories) plus `_dataBooks/` and `_dataSheets/` were enumerated and it does not exist. There is also no standalone TMS34010 data sheet PDF there; SPVS002A/C survive only in third-party GitHub archives, and appendix A of the User's Guide is the same content. Cite the User's Guide. *Practical note*: bitsavers returns **403 Forbidden** to curl's default user agent. Send a browser one. ### 2. Midway arcade self-tests: hardware-corrected, end-to-end This is the strongest evidence available and it is worth taking seriously despite being coarse. Midway's boards ship with a diagnostic that walks the CPU board chip by chip, reports per-chip pass or fail on screen, and **halts on a mismatch**. It ran on real hardware, for years, in the field. That makes it hardware-corrected: the expected values were adjusted until real boards passed. **Verified here, by running MAME 0.285 headless on 2026-09-12:** | Game | What was observed | | --- | --- | | `smashtv` (Smash T.V., Y-unit) | Runs the full POST unconditionally on a fresh NVRAM. Draws a CPU board diagram with every chip rectangle labelled by U-number, turns them green one at a time, and finishes with **`CPU BOARD OK`** before attract mode. | | `mk` (Mortal Kombat, T-unit) | At MAME's default DIP settings the full POST is skipped, but the boot summary still prints `REVISION 5.0 T-UNIT 3/19/93`, `CMOS INVALID -- FACTORY SETTINGS RESTORED`, `USING CMOS COINAGE`, and on a fresh NVRAM stops at **`ERRORS DETECTED -- ANY BUTTON TO CONTINUE`** in red. | | `mk` with the `Test Switch` DIP asserted | Enters `MORTAL KOMBAT TEST MENU` → `DIAGNOSTIC TESTS` → `SWITCH TEST / DIP SWITCH TEST / CPU BOARD TEST / SOUND BOARD TEST / MONITOR PATTERNS / BURN-IN TEST`. `CPU BOARD TEST` was driven from a Lua script and reached the board diagram with `CHECKING SCRATCH RAMS`, chips green. | The failure mode is what makes it an oracle: it does not degrade gracefully, it stops on a red line and waits. A core with a broken `ADDC` or a wrong field extension will not reach `CPU BOARD OK`. **The `BURN-IN TEST` in the same menu repeats the CPU board test indefinitely and logs cycles to the audit table** — a ready-made soak test for a finished core. ### 3. The Y-Unit Test ROM (`yunittst`): hardware-corrected, end-to-end, the best of them A **standalone Midway factory diagnostic program**, dumped and supported by MAME as its own machine (`midway/midyunit.cpp`, TMS34010 @ 40 MHz). It is not a game with a test mode; it is nothing but tests. Verified here by running it headless: ```text Y-UNIT TEST ROM V1.40 6 BIT Y-UNIT DS1-1 RAM TEST DS2-1 SEE DS2-2 DS1-2 CMOS TEST DS2-2 DISPLAY TYPE DS1-3 QUICK DMA TEST DS2-3 SCREEN ALIGNMENT DS1-4 HARSH DMA TEST DS2-4 SEE DS2-5 DS1-5 ROM CHECKSUMS DS2-5 SCREEN FILLS DS1-6 SWITCH INPUT TEST DS2-6 N/U DS1-7 COIN COUNTER TEST DS2-7 N/U DS2-8 WILLIAMS LOGO -- RESET TO END TESTS -- ``` Each test is selected by a DIP switch. With `RAM Test` asserted through MAME's `:DSW` port it produced a chip-by-chip result screen — `U5`/`U23` COLOR RAM, `U10`-`U15` and `U28`-`U33` VIDEO RAM, `U66`-`U69` SCRATCH RAM, all green — ending in **`-- DONE --`**. `ROM CHECKSUMS` is the most CPU-intensive of them: it sums every program ROM and compares against values stored in the ROMs. That exercises field addressing, the ALU, and control flow over megabytes of data, with a single pass/fail answer. It is the cheapest meaningful end-to-end gate this project has. **Its limitation is written on its own menu.** `QUICK DMA TEST` and `HARSH DMA TEST` are separate items because the blitter is a separate device — see below. ### 4. `birdybro/TMS34010_sv` vectors: emulator-derived, a detector The only machine-readable per-instruction corpus that exists for this CPU. | | | | --- | --- | | URL | , `sim/vectors/` | | Pinned revision | `94a258e80a07ceb4303ce0b99818df832e96007f` (2026-07-30, "Record Task 0174 completion commit") | | Licence | **MIT** (confirmed via the GitHub licence API) | | What it is | The vector corpus of a SystemVerilog reimplementation of the TMS34010 for FPGA | | Fetched here | 9 files, 1.92 MB, every one verified against its git blob SHA-1 from the contents API (`scripts/fetch_test_vectors.py`, 2026-09-12) | | **Provenance** | **The expected values were produced by running MAME**, pinned at MAME commit `70725158b4e9d2e1230c0515faec754f9cee86a2`. The repository's own `docs/mame_graphics_reference.md` says so, and its generator harness `tools/mame/tms34010_graphics_diff.cpp` "installs a RAM map, runs supplied programs, and serializes public architectural state". | | **Tier** | **emulator-derived.** It is a *differential* corpus, not a ground-truth one. It is MAME's opinion in a portable file format. Do not let the fact that it is a corpus, with hashes and a manifest, make it look like tier 1. | | Coverage | **137 cases, all graphics instructions**: 112 `PIXT` (every PPOP × every PSIZE, plus linear/XY/load/store/memory-to-memory), 14 `PIXBLT` (including B-form, direction/PBH/PBV, mixed, pitch), 8 `FILL`, 2 `LINE`, 1 `DRAV`; plus window, plane-mask, array-edge, zero-width/zero-height/singleton and interrupt-resume-endpoint cases | | Not covered | The entire general instruction set. ALU and control-flow coverage lives in 159 SystemVerilog testbenches under `sim/tb/`, which are self-checking against the manual but only runnable in a Verilog simulator. | | Timing | **None.** The project states cycle parity is an explicit non-goal. | **Record format**, checked against the fetched files: a header line `TMS34010_GRAPHICS_V1 89`, then per case `CASE `, `PROGRAM`, a list of 16-bit hex words; the expected side has `CASE `, `A <15 32-bit words>`, `B <15 32-bit words>`, `IO <6 16-bit words>`, `MEM `, `END`. Plain text, trivially parseable from Python, no dependencies. **The most valuable file in it is `mame_graphics_divergences.json`**, a curated list of the five classes where the RTL author decided MAME was wrong and the TI specification right, with a minimised reproducer for each and `"unexplained_mismatches": 0`: | Class | What it says | | --- | --- | | `endpoint_pc_observation` | MAME holds PC on `JRUC -1`; the RTL's PC is the post-fetch address. Affects all 137 cases. | | `atomic_reference_checkpoint_limit` | MAME executes a graphics opcode atomically and therefore cannot expose TI's mid-array checkpoint/resume images ([timing.md](timing.md) says the same thing from MAME's side). | | `array_terminal_context` | MAME exposes legacy array scratch context in the B registers at completion. | | `array_extent_and_terminal_context` | MAME interprets empty and terminal 16-bit extents differently from the TI definitions. | | `directional_array_context` | MAME and the RTL differ on PBH/PBV automatic corner selection. | A core that reproduces the TI-specified behaviour will *fail* those cases against `mame_graphics_expected.txt`, and that failure is correct. Use the divergence file as the expected-failure list. **The TI workload cases are metadata only.** Five cases run genuine TI COFF binaries — `rom_tutorial`, `sample_function_library`, `graphics_math_arcs`, `graphics_math_transfer`, `gsp_paint` — extracted from preserved 1985-1987 TI distribution floppies. The manifest pins each by `coff_sha256` and load-image hash, but states its own policy: "Metadata only; executables are extracted from preserved do-not-redistribute media into ignored work space." **This project does not have those media and must not obtain or commit them.** The manifest is useful as a description of what a serious workload test would look like; the cases are not runnable here. ### 5. MAME 0.285: emulator-derived, a detector | | | | --- | --- | | Binary | `/usr/games/mame`, reports `0.285 (unknown)` | | Source cited | `src/devices/cpu/tms34010/` at GitHub tag **`mame0285`** — BSD-3-Clause, copyright Alex Pasadyn and Zsolt Vasvari, "parts based on code by Aaron Giles". **Pin the tag**: these files moved from `src/mame/midway/` to `src/mame/williams/` after 0.285, and line numbers against `master` will not match. | | Recipe | [mame-oracle.md](mame-oracle.md), with a verified trace of `mk` | | How it was validated | **It was not.** MAME ships no CPU unit tests and there are no test files in that directory. The core was made correct by running arcade games until they looked right. | | Known limits | No plane masking at all; window-check modes 1 and 2 incomplete; interlace fatal; invented cycle counts (`COUNT_UNKNOWN_CYCLES`); atomic graphics ops; a `Cool Pool`-specific DPYINT workaround; a broken `ADDC` carry-out; `write_pixel_32` dropping its top word. The full list with citations is [undocumented-behavior.md](undocumented-behavior.md). | | Still moving | AJR committed "tms34010: Fix 32-bit pixel writes" on 2026-02-01. This core is not settled code. | ### 6. FBNeo: an independent second opinion, emulator-derived `FBNeo/src/cpu/tms34010/` is a **genuinely independent** TMS34010 core — header "Copyright (c) 2015, Marcos Medeiros / Licensed under BSD 3-clause", its own file decomposition (`tms34010_memacc.h`, `_ctrl`, `_mov`, `_arithm`, `_jump`, `_shift`, `_gfx`, a 148 KB `tms34010_optable.cpp`), its own namespace. It is not a MAME port. Directory listing confirmed via the GitHub API on 2026-09-12. That matters because it is the only way to get a *second* emulator-derived opinion. When MAME and the manual disagree, FBNeo is the tiebreaker that says whether MAME's reading is idiosyncratic. It does not raise the evidence above tier 3 — two emulators agreeing is still two programs agreeing — but a three-way disagreement localises the question. Other independent implementations, for completeness: `birdybro/TMS34010_sv` (MIT, the RTL behind the corpus above), `birdybro/TMS34020_sv`, `srg320/TMS34020` (with a testbench and an opcode spreadsheet), `giancarloerra/tms34010-fit`. MAME derivatives (`historic-mame`, `mame4all-pi`, `libmame`) add nothing. ### 7. The GSP toolchain: a test-program generator, not an oracle Andrew Morton's 1994 GNU port survives on the Wayback Machine and both tarballs still return 200: `https://web.archive.org/web/20050712200301/http://www.zip.com.au/~akpm/gsp.tar.gz` (399,210 bytes — assembler, linker, disassembler, a realtime kernel and an almost-complete video game) and `.../20050716223720/http://www.zip.com.au/~akpm/gspcc.tar.gz` (4,868,438 bytes — GCC/G++ 2.5.8). GPL of that era; the compiler *driver* is permanently lost, by the author's own note. Useful for **writing** test programs whose expected results come from the manual. It produces no expected values of its own, so it is not an oracle. --- ## Which games actually exercise the graphics instructions This is the finding that most changes the shape of the plan, and it was measured here, not inferred. **Midway's Y-, T- and Wolf-unit boards do not use the TMS34010's graphics instructions for sprites.** They have a separate custom DMA blitter with its own register file, its own IRQ and its own timer (`midtunit_video_device`; `midyunit`'s `dma_draw`). The TMS34010 programs it and waits. The only `set_inputline` in the whole T-unit driver is the blitter's completion IRQ (`midtunit.cpp:609`). The Y-Unit Test ROM's menu confirms the split from the other direction: `QUICK DMA TEST` and `HARSH DMA TEST` are their own items, separate from `RAM TEST`. Counts of graphics-instruction executions in a two-frame MAME trace window (`scripts/mame/trace_mk.sh`, 2026-09-12): | Machine | Instructions traced | PIXT / PIXBLT / FILL / LINE / DRAV | | --- | --- | --- | | `xtheball` (Rare, *X the Ball*) | 61,868 | **2,739** — 2,632 `PIXT`, 77 `PIXBLT`, 30 `FILL` | | `tickee` (*Tickee Tickats*) | 61,823 | **73** — all `PIXBLT` | | `mk` (Mortal Kombat, attract) | 41,983 | 2 `PIXT`, both part of a shift-register transfer | | `exterm` (Exterminator) | 62,671 | 0 | | `lethalj` (Lethal Justice) | 53,479 | 0 | | `ultennis` (Ultimate Tennis) | 45,932 | 0 | | `coolpool` (Cool Pool) | 66,835 | 0 | Two consequences for the plan: 1. **Passing a Midway self test proves the general instruction set and the field machinery, and says almost nothing about PIXBLT.** Do not claim otherwise. 2. **`xtheball` is the end-to-end gate for the graphics instructions.** `tickee` is a lighter one. Both ROM sets are present in the local collection. --- ## Fetching what can be fetched ```text python3 scripts/fetch_test_vectors.py # fetch and verify, ~1.9 MB python3 scripts/fetch_test_vectors.py --check # re-verify what is on disk python3 scripts/fetch_test_vectors.py --summary # coverage and divergences ``` The script reads each file from `raw.githubusercontent.com` at the pinned commit and verifies its **git blob SHA-1** against the value recorded from the GitHub contents API; a mismatch aborts. The destination is `tests/tms34010_sv_vectors/`, which is gitignored. Record of the run on 2026-09-12 (Python 3.14.4, Linux x86_64): ```text birdybro/TMS34010_sv @ 94a258e8 (MIT), emulator-derived -- a DETECTOR, not a judge graphics cases: 137, generator tools/mame/generate_graphics_vectors.py pixt 112 pixblt 14 fill 8 line 2 drav 1 MAME pinned at 70725158b4e9, unexplained mismatches: 0 - array_extent_and_terminal_context - array_terminal_context - atomic_reference_checkpoint_limit - directional_array_context - endpoint_pc_observation TI workload cases: 5 (rom_tutorial, sample_function_library, graphics_math_arcs, graphics_math_transfer, gsp_paint) ``` MAME ROM sets are read in place with `-rompath` and are never copied. No ROM, corpus, trace, disk image or TI PDF is committed to this repository. --- ## The gates, in order | Gate | Oracle | Tier | What passing lets you say | | --- | --- | --- | --- | | 1 | Unit tests written from User's Guide section 12, one per instruction | documentation | The decoder, the field machinery, the flag rules and the interrupt sequence follow the manual. | | 2 | MAME 0.285 lockstep on `mk`, general instruction set only, 33 register fields per instruction | emulator-derived (detector) | N instructions with no undecided divergence, N stated, every divergence decided by the manual and recorded. | | 3 | `smashtv` reaches `CPU BOARD OK`; `yunittst` `RAM TEST` and `ROM CHECKSUMS` reach `-- DONE --` | hardware-corrected, end-to-end | The core runs real code on a real board's terms, over megabytes, without drifting. | | 4 | `birdybro/TMS34010_sv` 137 graphics cases, expected-failure list = the five divergence classes | emulator-derived (detector) | The graphics instructions agree with MAME except where the RTL author documented that MAME is wrong. | | 5 | MAME lockstep on `xtheball` | emulator-derived (detector) | The graphics instructions survive a real workload. | | 6 | `mk` CPU BOARD TEST, then BURN-IN TEST for N hours | hardware-corrected, end-to-end | A soak result with a cycle count. | | 7 | FBNeo consulted wherever MAME and the manual disagree | emulator-derived (tiebreaker) | The divergence list has a second opinion behind it. | State the MAME version, the corpus revision, the machine names, and the counts with every claim. A claim without those numbers is not reproducible. And **never** write "verified against hardware" in this repository, because nothing here is. ## What would change this page One person with a TMS34010 board, a logic analyser and a weekend. The architecture is friendlier to capture than most — the host port can halt the CPU, load a program, single-step it and read every register back (*User's Guide* appendix B documents exactly this for prototyping). A SingleStepTests-shaped corpus is *buildable*; it simply has not been built. If it ever is, it becomes the judge and most of this page becomes history.