# The vector units, VU0 and VU1, and where their core lives Sources: Sony's VU User's Manual 6.0 (2002; marked SCE CONFIDENTIAL; "VUM", facts only, cited by section), the EE User's Manual ch. 6 (VPU, VIF), ECUM §1.3.4, §2.10; ps2tek "Vector Unit (VU)" (tier 3); ps2autotests `cpu/vu0_macro/*` and `vu/*` (ISC, TEST ROM). BigBoss's community "Vector Unit Instruction Manual" (2003, in the pinned PS2 programming documents) restates Sony's manual; it is not an independent witness. ## What they are | | VU0 | VU1 | Source | | --- | --- | --- | --- | | Modes | **macro** (COP2 of the EE Core, 32-bit MIPS COP2 instructions) and **micro** (stand-alone, started by VCALLMS/VCALLMSR) | micro only, started by the EE (CMSAR1) or by VIF1's MSCAL/MSCALF/MSCNT | VUM §1.2, §1.3 | | Micro memory / data memory | 4 KB / 4 KB | 16 KB / 16 KB | VUM §1.1.5-1.1.6 | | Units | 4 FMACs, FDIV, LSU, IALU, BRU, RANDU | the same plus the **EFU** (P register) | VUM §1.1 | | Outputs | its data memory; VU1's registers are mapped into VU0's data space at 4000h-43FFh | **XGKICK** to the GIF (PATH1) | VUM §1.1.5, §1.1; EE UM ch. 7 | | Clock | the EE's, 294.912 MHz | the same | ps2tek "VU Architecture" (tier 3); MAME lists both at 294,912,000 Hz (OBSERVED) | Micro instructions are 64-bit LIW words: an upper instruction for the FMACs and a lower one for FDIV, LSU, IALU, BRU or EFU, both issued each cycle; up to six units run at once (VUM ch. 3). 32 vector registers VF00-VF31 of four floats (VF00 is 0,0,0,1), 16 16-bit integer registers (VI00 = 0), ACC, I, Q, R and on VU1 P; MAC, status and clipping flags (VUM §3.1, §3.3). Macro mode has 90 instructions against micro mode's 127, cannot issue upper and lower together, and has no EFU (VUM §1.2 table). **Arithmetic** is the FPU's kind (docs/fpu.md): single precision, no NaN, infinity or denormals, rounding "similar to a 0 direction truncation" whose least significant bit "may vary", overflow to +-MAX and underflow to +-0 with flags, never a trap (VUM §2.2-2.4). Whether the VU's truncation is bit-identical to COP1's is **U17**; the two units are different hardware. **Timing is part of the programming model.** Every FMAC instruction has latency 4 and throughput 1; DIV 7/7; the EFU functions from 11/12 (ERCPR) to 53/54 (EATAN); integer loads 1/4; branches 2/2 (VUM §7.4). Hazards stall, but the flags and the Q and P registers are read at defined pipeline positions (VUM §3.4: "Hazards", "Priority for writing to a register", one section per unit pipeline), and hand-scheduled microcode depends on those positions. XGKICK has its own pipeline and synchronisation rules (VUM §3.4.9 and the XGKICK reference, revised in this edition). The specification therefore models the VU pipeline at **cycle level**: each unit's stages, the write-priority rules and the flag pipeline, stated from VUM ch. 3 as data. The RSP (rsp-python) is the family's precedent for a cycle-level LIW-like vector core. **Macro mode** couples VU0 to the EE pipeline: COP2 operate instructions issue to the C2 pipe beside I1 (ECUM §1.3.4-1.3.5); QMFC2/QMTC2/CFC2/CTC2 with the interlock bit (`.I`) wait for a running micro subroutine; VCALLMS starts one; a macro instruction issued while VU0 runs a micro subroutine stalls the EE (VUM §1.3.2). That coupling is a socket in the EE core: `Coprocessor2` with `move_from`, `move_to`, `operate(word)`, `call_micro(addr)`, `busy_until()`, and the `.I` synchronisation as a method the core calls before the move (decision E5). ## The CPU rule, applied The charter: CPUs always get their own core repository; other chips stay in the board until a second family board needs them. - **VU1 is a CPU** in every sense the rule cares about: it fetches its own instruction stream from its own memory, has a program counter, branches, subroutine calls, its own pipeline and its own clocked execution independent of the EE (VUM §1.2: "functions as a stand-alone processor"). - **VU0 is the same core** in a smaller configuration, plus the COP2 front end (VUM §1.2; the instruction sets are shared, VUM ch. 4 and 6). - **Other family users**: the PlayStation 2 board; the arcade boards built on it (Namco System 246/256, Konami Python, both listed by MAME 0.285 with the same VU devices, OBSERVED) would be machine variants of ps2-python, not new boards. The PSP's VFPU (allegrex-python) is a different design. So the second-user test does not decide; the CPU rule does. - **Precedent**: the N64's RSP has its own repository (rsp-python) beside vr4300-python, for the same reasons: its own instruction stream, its own pipeline, its own Rust speed work (SIMD lanes), and its own domain on its own thread. - **The GTE counter-example** (r3000a-python keeps the GTE as a module) does not carry over: the GTE runs only COP2 commands issued by the CPU and has no instruction stream; VU0 and VU1 run programs. **Recommendation (decision E6): a separate core repository `vu-python` (package `vu_python`), one core with two configurations, `VU0` (4 KB/4 KB, macro-mode front end, no EFU) and `VU1` (16 KB/16 KB, EFU, XGKICK port).** ee-python's COP2 socket takes a `vu_python.VU0`; ps2-python wires VU1 to VIF1 and the GIF. The **VIF stays in the board** (chip rule: a DMA-fed unpacker that only the PS2 uses), as does the GIF. This page moves to vu-python with its history when Aubrey agrees, and that repository gets its own Phase 0 (validation ladder with ps2autotests `vu/` and `cpu/vu0_macro`, a MAME recipe on the `vu0`/`vu1` devices, which MAME exposes with full register state; docs/mame-oracle.md). ## Speed, in one line VU1 runs microprograms of hand-scheduled four-lane float code at up to 294.912 M LIW instructions/s; it is the PS2's second-largest compute load after the EE, and in geometry-heavy games possibly the largest. Its numbers are in ps2-python docs/execution-architecture.md. ## Unknowns U17 VU vs COP1 truncation; U18 the exact cycle at which a macro-mode COP2 move sees a result from a running micro subroutine without `.I`; U19 what VU0 reads at 4000h-43FFh while VU1 runs (VU1's registers mid-update); U20 the EFU's precision per function (VUM §7.2 gives the algorithms' outline, not bit-exact results).