# Memory maps, clocks and memory kinds Sources: Sony's EE User's Manual 6.0 ("EEUM", ch. 2, DOC, facts only), ps2tek "Memory Map" and "I/O Maps" (tier 3, facts only), ECUM §5 for the EE Core's address spaces (`../ee-python/docs/cop0-tlb-caches.md`). ## Clocks | Clock | Rate | Source | | --- | --- | --- | | EE Core, VU0, VU1 | 294.912 MHz | ps2tek "EE Architecture", "VU Architecture" (tier 3); MAME 0.285's device clocks (OBSERVED) | | EE bus (BUSCLK): DMAC, VIF, GIF, IPU, timers, SIF EE side; GS host interface | 147.456 MHz | EEUM §2.1.2 (bus error after 2048 cycles "by the bus clock (147.456MHz)"), §7.1.2 (GIF idle cycle "@147.456MHz") | | GS core | "150 MHz" in the GS User's Manual's bandwidth figures (§1.1.2); 147.456 MHz as the bus it sits on | C1 below | | IOP, SPU2 (PS2 mode) | 36.864 MHz | SPU2 Overview Manual §1.1.1 (the cores "operate at a frequency of 36.864 MHz", 48 kHz output); ps2tek "CDVD Reads and Seeks" (IOP_CLOCK ~36,864,000 Hz) | | IOP in PS1 mode | 33.8688 MHz, SPU2 output 44.1 kHz | ps2tek "BIOS PlayStation Compatibility" (tier 3) | | Video | NTSC 262 lines, 9,370 BUSCLK per line; PAL 312 lines, 9,436 BUSCLK per line | ps2tek "EE Timers" (tier 3) | **One integer time base.** 294.912 MHz is 2 x 147.456 MHz and 8 x 36.864 MHz, so in PS2 mode every domain's clock is an integer number of EE cycles: a bus cycle is 2, an IOP cycle 8 (arithmetic on the DOC rates). In PS1 mode the IOP's cycle is 294.912 / 33.8688 = 1280/147 EE cycles, so the time base becomes the EE cycle x 147 (an IOP cycle = 1,280 units, an EE cycle = 147), or the board steps the IOP by a rational accumulator, as psx-python does for its video clock. **C1.** The GS manual states rates at "150 MHz" (38.4 GB/s = 1024 bits x 150 MHz x 2) and its triangle rates as 150 M / cycles; the EE manual names 147.456 MHz for the bus the GS host interface is on. Whether the GS core runs at BUSCLK or on its own clock is **U1**. **C2.** MAME 0.285 clocks its IOP, IOP DMA and SPU at 33,868,800 Hz in PS2 mode (OBSERVED), against Sony's 36.864 MHz (DOC); Sony wins (charter: the manufacturer's document outranks an emulator), and MAME's choice is recorded. ## The EE's physical map (EEUM §2.1; ps2tek) | Physical | Size | What | Notes | | --- | --- | --- | --- | | 0000_0000 | 32 MB (retail) | main RAM (RDRAM) | EEUM allows up to 256 MB; TOOL units 128 MB (ps2tek) | | 1000_0000 | 64 KB | EE registers: timers, IPU, GIF, VIF0/1, FIFOs, DMAC, INTC, SIF, misc | EEUM §2.2.1 table; registers 32-bit and word-access only unless stated, FIFOs 128-bit and qword-only | | 1100_0000 | 4+4+16+16 KB | VU0 micro/data, VU1 micro/data | ps2tek: 11000000h, 11004000h, 11008000h, 1100C000h | | 1200_0000 | 8 KB | GS privileged registers | reached directly, never through the GIF (EEUM §7.1.5) | | 1C00_0000 | 2 MB | IOP RAM, as the EE sees it | ps2tek | | 1FC0_0000 | 4 MB | Boot ROM (rom0) | shared with the IOP | | 2000_0000-3FFF_FFF0, 8000_0000-FFFF_FFF0 | | bus error | EEUM §2.1.2 | Kernel-mode virtual windows (ps2tek): 00000000h cached RAM, 20000000h uncached, 30100000h uncached accelerated, 70000000h the scratchpad (through the TLB's S bit), 9FC00000h/BFC00000h the ROM cached/uncached. **A bus error** also follows when an SBUS access gets no RDY for 2048 bus cycles (EEUM §2.1.2), and when the GS does not answer a privileged-register access for 1024 cycles (EEUM §7.1.5). ## The IOP's physical map (ps2tek "IOP Physical Memory Map", tier 3) | Physical | What | | --- | --- | | 0000_0000 | 2 MB RAM (as on the PS1) | | 1D00_0000 | SIF registers | | 1F40_2000 | CDVD registers | | 1F80_0000 | 64 KB of I/O: interrupts (1070h), DMA (1080h-10F4h, 1500h-157Ch), timers (1100h, 1480h), SIO2 (8200h) | | 1F90_0000 | 1 KB SPU2 registers | | 1FC0_0000 | 4 MB Boot ROM (the same rom0 as the EE's) | | FFFE_0000 (KSEG2) | cache control | ## Other memories GS local memory 4 MB (GS manual §1.1.2); SPU2 work RAM 2 MB; memory card 8 MB (ps2tek "Additional Memory"). The IOP's 1 KB scratchpad and 4 KB I-cache are the CW33300's, if the IOP is the same core (iop.md, U-items there). ## Memory kinds (JIT proposal J2; for the cached interpreter and threads) | Region | Kind | Who writes it | Code there? | | --- | --- | --- | --- | | EE main RAM | RAM, shared | EE Core (through the D-cache: write-back), DMAC (every channel with memory as destination), the IOP? (no: the IOP reaches it only through SIF DMA) | **all game code**; the I-cache does not snoop, so DMA into code is seen only after software invalidates (ECUM §6.1) | | Scratchpad | RAM, core-private plus DMA | EE Core, DMAC ch. 8/9 | code cannot run from it (instruction fetch goes through the I-cache from memory; HYPOTHESIS, ECUM §6.4 describes data access only) | | VU micro memory | RAM, VU instruction store | VIF0/VIF1 MPG, the EE (mapped), DMA via SPR | VU microcode: **uploaded constantly by games** | | VU data memory | RAM, shared | VIF unpacks, the VU itself, the EE (mapped), DMA | no | | GS local memory | device-private RAM | the GS (drawing, host-to-local transfers) | no | | Boot ROM | ROM | nobody | the BIOS, both CPUs | | IOP RAM | RAM, shared | IOP, IOP DMA (SIF1, CDVD, SPU2, SIO2), the EE (mapped at 1C000000h) | IOP modules (IRX), loaded at boot and by games | | SPU2 RAM | device-private | SPU2 DMA, the SPU2 (capture buffers) | no | | EE and IOP registers | I/O, every access a sync point candidate | | no | ## Unknowns U1 the GS core clock; U2 the access cost of each EE region per access kind (RAM through the DRAMC: undocumented in cycles); U3 what the EE sees at 1C000000h while the IOP runs (coherency with the IOP's cache); U4 the bus arbitration between the EE Core and the DMAC beyond EEUM §5.3 (the RCYC delay after the bus is returned).