velxio/test/test_intel/autosearch
David Montero f7223b4965 test_intel: phase D — 4001 ROM chip with 4004 integration
The 4001 is the canonical ROM partner of the 4004/4040. 16-pin DIP,
256 bytes of mask-programmed ROM accessed over the 4-bit multiplexed
nibble bus, plus 4 I/O port lines (WRR/RDR — not yet wired).

Implementation: ~140 LOC clean-room from MCS-4 manual §V. The chip
has its own timer at 1351 ns (matching the 4004's clock period), with
a state machine that walks the 8-phase frame in lockstep with the
4004:
  S_IDLE → (SYNC↑) → S_SAMPLE_LOW (A1 nibble) → S_SAMPLE_MID (A2) →
  S_SAMPLE_HIGH (A3, addr complete) → S_DRIVE_HI (M1, drive opcode
  high nibble) → S_DRIVE_LO (M2, drive low nibble) → S_POST (X1..X3
  idle) → wait for next SYNC.

Timing trick: the 4001 must be added to the board BEFORE the 4004
so its tickTimers fires first per advanceNanos. The 4001 then runs
one frame "behind" the 4004 — sampling what the 4004 drove last
frame and driving what the 4004 will read this frame. Documented in
the chip's source and the master plan.

Integration test (`test_buses/4001-rom.test.js`) wires both chips on
the same board and verifies the 4004 actually fetches and executes
opcodes from the 4001 (PC walks 0, 1, 2 with the embedded NOP image).
This is the first end-to-end test of the 4-bit multiplexed bus
working between two real WASM chips on the canvas, not just JS
helpers — proving the bus model scales.

Deferred for the next Phase D iteration: 4002 RAM (similar shape +
SRC chip-select latching), 4004 SRC/WRM/RDM wiring to exchange data
with the 4002, and the Busicom 141-PF integration once both ROM and
RAM chips are real.

Tests: total test_intel 98 → 99 passing, 0 failed, 11 todo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 20:44:17 +02:00
..
pdfs autosearch: Intel 8086 + 8282 spec + reference impls 2026-04-30 03:53:36 +02:00
00_README.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
01_velxio_chip_capabilities.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
02_intel_chips_overview.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
03_emulation_strategy.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
04_open_source_emulator_references.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
05_open_questions.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
06_8080_authoritative_spec.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
07_reference_implementations_8080.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
08_27c256_eprom_pinout.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
09_hm62256_sram_pinout.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
10_z80_authoritative_spec.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
11_z80_reference_implementations.md autosearch — Research notes for Intel + Z80 custom-chip emulation 2026-04-29 22:24:02 +02:00
12_4004_authoritative_spec.md autosearch: Intel 4004/4040 spec + reference impls 2026-04-29 22:37:16 +02:00
13_4040_authoritative_spec.md autosearch: Intel 4004/4040 spec + reference impls 2026-04-29 22:37:16 +02:00
14_4004_4040_reference_implementations.md autosearch: Intel 4004/4040 spec + reference impls 2026-04-29 22:37:16 +02:00
15_8086_authoritative_spec.md autosearch: Intel 8086 + 8282 spec + reference impls 2026-04-30 03:53:36 +02:00
16_8086_reference_implementations.md autosearch: Intel 8086 + 8282 spec + reference impls 2026-04-30 03:53:36 +02:00
17_8282_pinout.md autosearch: Intel 8086 + 8282 spec + reference impls 2026-04-30 03:53:36 +02:00
18_complete_emulation_plan.md test_intel: phase D — 4001 ROM chip with 4004 integration 2026-04-30 20:44:17 +02:00