# The physical memory map, and how each region answers Source: n64brew: Memory map (revision 5763), Parallel Interface, Serial Interface, RDRAM Interface (CC BY-SA 4.0, facts only, tier 3). The wiki's statements are mostly unattributed observations; where it says "?" or "further testing needed" we say U. The CPU-side segments (kseg0/kseg1/kuseg) are in vr4300-python's start-here.md. | Physical range | Region | Notes | | --- | --- | --- | | 0x00000000-0x03EFFFFF | RDRAM (through the RI) | 4 MiB, 8 MiB with the Expansion Pak; reads beyond installed RAM return 0, writes ignored, no mirroring (RDRAM Interface; one measured oddity: RDRAM register values leak in every 0x80 bytes in a repeating window, "not fully investigated") | | 0x03F00000-0x03F7FFFF | RDRAM registers | per-chip; odd registers need MI "upper" mode | | 0x03F80000-0x03FFFFFF | RDRAM registers, broadcast | write-only | | 0x04000000-0x04000FFF | RSP DMEM | mirrored over 0x04000000-0x0403FFFF (mask 0x3E000) | | 0x04001000-0x04001FFF | RSP IMEM | as DMEM | | 0x04040000-0x040BFFFF | RSP registers (SP_*), SP_PC at 0x04080000 | mirror mask 0x7FFE0 | | 0x040C0000-0x040FFFFF | unmapped | **any access freezes the CPU**: the RCP never answers | | 0x04100000-0x041FFFFF | RDP command registers (DPC_*) | mirror every 0x20 | | 0x04200000-0x042FFFFF | RDP span (test) registers (DPS_*) | mirror "?" | | 0x04300000 | MI | mirror mask 0x1FFFF0 (only the low 4 bits decode) | | 0x04400000 | VI | 0x1FFFC0 | | 0x04500000 | AI | 0x1FFFE0 | | 0x04600000 | PI | 0x1FFFC0 | | 0x04700000 | RI | 0x1FFFE0 | | 0x04800000 | SI | 0x1FFFC0 | | 0x04900000-0x04FFFFFF | unmapped | freezes the CPU | | 0x05000000-0x05FFFFFF | 64DD registers (PI) | domain 1 or 2: the two pages disagree (C1) | | 0x06000000-0x07FFFFFF | 64DD IPL ROM (PI domain 1) | runs instead of IPL3 when a 64DD is attached | | 0x08000000-0x0FFFFFFF | cartridge SRAM / FlashRAM (PI domain 2) | | | 0x10000000-0x1FBFFFFF | cartridge ROM (PI domain 1) | | | 0x1FC00000-0x1FC007BF | PIF ROM (IPL1, IPL2), 1984 bytes (SI) | reads 0 after the lockout | | 0x1FC007C0-0x1FC007FF | PIF RAM, 64 bytes (SI) | the joybus and boot command area | | 0x1FC00800-0x1FCFFFFF | PIF pattern mirrors / reserved | "use unknown" (U) | | 0x1FD00000-0x7FFFFFFF | PI domain 1, no known device | PI open bus; above 0x20000000 reachable only by TLB or xkphys | | 0x80000000-0xFFFFFFFF | not decoded by the RCP | writes ignored, **reads lock the CPU** (left for "external SysAD devices": dev boards, Aleck64) | ## How each kind of region answers (the board's bus responder) - **RDRAM**: every access size works (the RDRAM builds a byte mask); the only region where cached access is allowed. A cached access to anything else **freezes the CPU until a hard reset**. - **RCP registers**: the access size is ignored; reads return the 32-bit word (so byte and halfword reads come out right); **64-bit reads freeze** (the second word never comes); 8- and 16-bit writes write the CPU's pre-shifted bus word whole to the aligned address, so other bits of the register change (wiki example: SB of 0x12345678 to 0x04600011 writes 0x56780000 to 0x04600010); 64-bit writes store only one word (which one: C3). A typical access costs 5-6 PClocks, the MI about 2 (unattributed). - **SI (PIF) region**: 32-bit uncached only; writes are posted (the SI latches the value, sets IO_BUSY, frees the CPU); a write during a pending write is **dropped**; a read waits for the pending write; a direct write also raises the SI interrupt as a DMA would. - **PI region**: writes are posted (PI_STATUS IO busy); a write during a pending one is dropped; **a read during a pending write returns the value being written**; every access is two 16-bit bus cycles (address with bit 0 clear, then +2), so a 16-bit read at 0x10000002 returns the halfword at 0x10000004 (the wiki's quirk). **Open bus**: with no device, a read returns the low 16 bits of the address in both halves (0x6666DCBA reads 0xDCBADCBA). These are the cases that freeze or corrupt: the board must model the freezes as freezes (the test ROMs probe some of them: nemu64-test `sp_memory`, `pif_memory`, `cart_memory`, `rdram`, `mi`), not as exceptions, and must not invent mirrors. ## Contradictions - C1: 64DD registers in PI domain 1 (Memory map) or 2 (Parallel Interface > Domains). - C3: sub-word and 64-bit write data on SysAD: the SysAD Interface page says data is "aligned ... and repeated" and 64-bit writes send the LSB word first; the Memory map page says the CPU shifts the value and 64-bit writes go MSB first. Judge: nemu64-test's memory tests.