# Start here: the Allegrex ## What the chip is - **Where:** inside Tachyon, the PSP's system-on-chip (Sony part numbers on the first mainboards: CPU core CXD2962GG/CXD2967GG; YAPSPD 3.1). A second copy sits in the Media Engine block (YAPSPD 5; Copetti, "Media Engine": "the same CPU found in the system group, but without the vector coprocessor"). - **Clock:** variable, 1-333 MHz (Copetti: "from 33 MHz to 333 MHz"; DOC). Games run at 222 or 333 MHz as the kernel's power library sets it (scePowerSetClockFrequency in pspsdk `src/power`; DOC). The core models time in **its own cycles**; the board owns the ratio to the bus clock (U13). - **Endianness:** little-endian only (YAPSPD 1.3: "the allegrex cpu ... is little endian"). - **Registers:** 32 x 32-bit GPRs, HI/LO, PC. No 64-bit operations (no MIPS III). - **Pipeline:** 7 stages (Copetti, citing an unofficial source: HYPOTHESIS for the model's purposes). Single issue, interlocked: no load-delay slot as on the R3000A (pspautotests `cpu/delayslot`; to be confirmed by rung 2). - **Coprocessors:** CP0 (system control, **no TLB**: YAPSPD 4.3.1 marks registers 0-6, 10 and 20 "not available (TLB)"), CP1 (FPU, single precision only), COP2 = the VFPU on the main CPU only, no COP3 (vfpu-docs, "MIPS allegrex CPU"). - **Caches:** 16 KB I + 16 KB D (Copetti; the D-cache size is also visible in the PSP-1000 memory-latency run, which jumps between 16 KB and 32 KB buffers: vfpu-docs `reference-outputs/mem_cycles.txt`, MEASURED by its author). 64-byte lines, write-back, no snooping (YAPSPD 4.10). Associativity: unknown (U8). - **Memory protection, not translation:** fixed segments (KU0 cached / KU1 uncached at +0x40000000 / K0 / K1 / K2 / K3, YAPSPD 7.1). Physical address = virtual & 0x1FFFFFFF in every segment (YAPSPD 7.1, "physical address 0x0......."). The kernel/user checks are by segment and by the board's protection registers at 0xBC000000 (YAPSPD 8.1), which belong to psp-python, not the core. ## What the ISA is: a contradiction to keep open The task brief calls the Allegrex "MIPS32 R2-based". Copetti writes that Sony "presumably acquired a license of the MIPS32 4k" (HYPOTHESIS in his own words). The VFPU documentation calls it "a MIPS CPU based on the MIPS II architecture" with "some extra MIPS32r2 instructions" (DOC, community). The instruction set itself decides it (C1 in the brief): it has MIPS II's 32-bit integer set, LL/SC, branch-likely, MOVZ/MOVN, the R2 bit operations (EXT, INS, SEB, SEH, WSBH, ROTR, ROTRV) with R2 encodings, but **CLZ, CLO and MADD/MSUB in SPECIAL rather than SPECIAL2**, Sony's MIN, MAX, WSBW, BITREV, and Sony's HALT, MFIC, MTIC in the SPECIAL2 opcode (0x1C) that MIPS32 uses for MUL, MADD, CLZ (isa.md). So it is neither a MIPS32 R2 core nor a plain MIPS II core: the specification describes the part, and cites MIPS32 R2 (MD00086 rev 2.50) only for the semantics of the instructions it shares, instruction by instruction. ## The boundary (proposal) - **The core owns:** GPRs, HI/LO, PC and the branch-delay state, CP0 (Status, Cause, EPC, ErrorEPC, BadVAddr, Count/Compare, PRId, Config, EBase, SCCode, CPUId, TagLo/TagHi and the debug registers), the interrupt-controller latch reached by MFIC/MTIC, CP1, the VFPU (as a module, enabled per instance), both caches with their tags, the scratchpad's address decode (or not: U7), the segment decode, exceptions. - **The board owns:** RAM, eDRAM/VRAM, every I/O block at 0xBC000000-0xBFFFFFFF, the protection registers, the interrupt controller's sources, the ME's control block, the clock ratio, DMA, bus arbitration. - **Time:** CPU cycles, integers. The bus returns a duration per transaction. ## Reuse first: the family's MIPS cores and why none fits | Core | ISA | What it shares with the Allegrex | Why not a variant | | --- | --- | --- | --- | | r3000a-python (PlayStation; Phase 0 done 2026-11-25) | MIPS I + GTE (COP2) | the 32-bit integer core, little-endian, a COP2 vector unit beside the CPU, a scratchpad | load-delay slots; no LL/SC, branch-likely, MOVZ/MOVN, R2 bit ops; a different COP2; no FPU | | vr4300-python (N64; Phase 0 2026-11-25) | MIPS III, 64-bit | branch-likely, LL/SC, CACHE, the FPU's MIPS encodings | 64-bit registers and operations, a TLB, big-endian, a double-precision FPU | | ee-python (PS2 Emotion Engine; Phase 0 running 2026-11-26) | MIPS III/IV subset + MMI, 128-bit GPRs, VU0 macro mode as COP2 | MIN/MAX-like multimedia ops (different encodings), a COP2 vector unit, single-precision non-IEEE FPU | 128-bit GPRs, a TLB, dual issue; the VFPU is not VU0 | The recommendation (handoff brief, decision A1) is a **new core repository**, built in r3000a-python's and vr4300-python's shape (generated decode from a cited table, one handler per row, timing as data), copying nothing. The shared MIPS semantics are small enough (an ADDU is an ADDU) that a shared library would cost more in pins than it saves. ## Read next isa.md, cop0-and-caches.md, fpu.md, vfpu.md, validation.md, mame-oracle.md, provenance.md, handoff-brief.md.