XL1200-EMU Symbolics XL1200 Emulator
Architecture & Guides docs/paging-system.md

Ivory Virtual Memory & Page Hash Table (PHT) Architecture

This document summarizes the Symbolics Ivory virtual memory architecture, 32-bit VMA space, hardware Page Hash Table (PHT) layout, grouped bit-run BAR hash box, Map Cache, and emulator cache coherence (emu/src/mem.c, emu/src/cpu_decode.c, emu/src/cpu_zen4_avx512.c, emu/include/ivory_hw.h).

For the full hardware reference including the 13-cycle memory matrix, ephemeral/dynamic GC barriers, and Merlin-II physical address decoding, see Volume 3: Virtual Memory, Paging & GC.

Primary Reference Sources (local-only when present):

  • genera-original/sys.sct/i-sys/sysdef.lisp — PHT0/PHT1 fields, zones, and 13 memory cycle types.
  • genera-original/sys.sct/i-sys/sysdf1.lisp — PHT internal registers (#o1007..#o1011, LOAD-MAP, INVALIDATE-MAP, PHT-HASH-0..3).
  • I_Machine/I-Machine_Architecture_Specification.pdf — Pages 85–89 (Virtual Memory, Table 13, Hardware BAR Hash Box).

1. Address Space Geometry

Ivory addresses memory in 40-bit Lisp words (not bytes). A 32-bit Virtual Memory Address (VMA) spans 4 GigaWords (\(2^{32}\) words):

GranularityWord CountBit SliceDescription
Page256 words (\(2^8\))<7:0> offset, <31:8> 24-bit VPNAtomic unit of PHT mapping, protection, and dirty tracking
Quantum65,536 words (\(2^{16}\), 256 pages)<31:16>Area allocation unit
Ephemeral Half-Level2,097,152 words (\(2^{21}\))Zone 0 <24:21>Ephemeral GC generation half-level (32 half-levels in Zone 0)
Zone134,217,728 words (\(2^{27}\), 128 MW)<31:27> (32 zones: 0..31)Top-level GC and addressing partition

Special Zones & Physical Address Bypass

  • Zone 0 (0x00000000–0x07FFFFFF) — Ephemeral Space: Subject to the 32-bit %REGISTER-EPHEMERAL-OLDSPACE (#o16) read barrier and PHT1 ephemeral_reference write barrier.
  • Zones 1..30 (0x08000000–0xF7FFFFFF) — Dynamic / Static Virtual Space: Demand-paged through the PHT and on-chip Map Cache; subject to %REGISTER-ZONE-OLDSPACE (#o17).
  • Zone 31 (0xF8000000–0xFFFFFFFF, #o37000000000–#o37777777777) — Wired VMA=PMA Window:
    • Bypasses the PHT completely. Hardware strips the top 5 bits: PMA = VMA & 0x07FFFFFF (27-bit window = 128 MW).
    • Top 128 KW (0x07FE0000–0x07FFFFFF) is reserved for the wired Boot Communication Area (0x07FE0000–0x07FE003F) and Boot PROM (0x07FE0040–0x07FEFFFF, 64 KW) plus I-Bus space (0x07FF0000–0x07FFFFFF).
    • Therefore, the architectural maximum contiguous RAM directly reachable through Zone 31 is 127.875 MW (0x00000000–0x07FDFFFF); standard XL1200 hardware equips 8 MW (0x00000000–0x007FFFFF).
    • RAM beyond 128 MW (up to the full 24-bit PPN / 4 GW architectural limit) is addressed via PHT virtual mappings in Zones 1..30.
  • DTP-PHYSICAL-ADDRESS (#o40) — Full 32-Bit Physical Bypass:
    • Memory instructions (MEMORY-READ, MEMORY-WRITE, BLOCK-n-READ/WRITE, etc.) given a pointer tagged DTP_PHYSICAL_ADDRESS bypass both PHT translation and the 27-bit Zone 31 mask, emitting the full 32-bit PMA directly onto the Merlin-II physical bus (e.g., 0x08000000 82C54 PIT, 0x09000000 MK48T02 NVRAM/TOD, 0x0A00000C Merlin-II IRQ register, 0x40000000 IO0 64 KW SRAM, 0x44014000..0x4402D001 IO0 DUSCC/DMAC/WD33C93A/ESDI/Video/82586, 0x48000000 monochrome VRAM, 0x80000000..0x8FF80000 VME/VIC068).

2. Page Hash Table (PHT) Entry Layout (IvoryPhtEntry)

The PHT resides in wired Zone 31 memory pointed to by scratchpad registers %REGISTER-PHT-BASE (#o1007) and %REGISTER-PHT-MASK (#o1010). It is organized into 8-word buckets containing 4 two-word entries (PHT0, PHT1) per bucket (sizeof(IvoryPhtEntry) == 16 host bytes).

Exact bitfield layout from sysdef.lisp:1312-1344 and ivory_hw.h:

Word 0: PHT0 (Virtual Tag & Collision Chain)

BitsFieldLisp ConstantDescription
<3:0>age%%PHT0-AGE4-bit page replacement age
<5:4>_spare—Reserved / spare
<6>pending%%PHT0-PENDINGPage I/O pending
<7>fault_request%%PHT0-FAULT-REQUESTIf 1, triggers IVORY_TRAP_PAGE_FAULT_REQUEST (#o5121) on access
<31:8>vpn%%PHT0-VPN24-bit Virtual Page Number (0xFFFFFF = IVORY_PHT_INVALID_VPN empty slot)
<37:32>data_type%%Q-DATA-TYPEDTP_FIXNUM (#o10)
<38>end_collision_chain%%PHT0-CHAIN1 = end of probe chain (stop rehashing on miss); 0 = continue probing
<39>_cdr_hiCDR<1>Upper CDR bit

Word 1: PHT1 (Physical Page Number & Protection)

BitsFieldLisp ConstantDescription
<3:0>ephemeral_reference%%PHT1-EPHEMERAL-REFERENCE4-bit GC ephemeral-reference tracking bits
<4>transport_trap%%PHT1-TRANSPORT-TRAPIf 1, page access triggers GC transport check
<5>cache_inhibit%%PHT1-CACHE-INHIBITIf 1, inhibits hardware memory caching
<6>write_protect%%PHT1-WRITE-PROTECTIf 1, writes trigger IVORY_TRAP_PAGE_WRITE_FAULT (#o5122)
<7>modified%%PHT1-MODIFIEDDirty bit; set by hardware/software on first write
<31:8>ppn%%PHT1-PPN24-bit Physical Page Number (supports up to 4 GW physical space)
<37:32>data_type%%Q-DATA-TYPEDTP_FIXNUM (#o10)
<39:38>cdr_code%%Q-CDR-CODECDR code

3. Hardware BAR Hash Box (ivory_pht_hash) & Collision Rehashing

Reading %REGISTER-PHT-HASH-0..3 (#o007, #o207, #o407, #o607) returns the hardware 26-bit PHT word offset (bits <2:0> forced to 0, aligned to 8-word buckets) computed from the corresponding Block Address Register BAR0..3.

Exact grouped bit-run equations (I-Machine Architecture Specification pp. 86–87, implemented in ivory_hw.h):

h<7:3>   = rev(vma<12:8>)  ^ vma<31:27>
h<8>     = vma<13>         ^ vma<20>
h<10:9>  = vma<15:14>      ^ {vma<21>, vma<22>}
h<14:11> = vma<19:16>      ^ rev(vma<26:23>)
h<19:15> = rev(vma<12:8>)  ^ vma<20:16>
h<22:20> = vma<15:13>      ^ vma<27:25>
h<25:23> = vma<23:21>      ^ rev(vma<31:29>)
  • Bucket Index: bucket_vma = pht_base + (hash & pht_mask).
  • Collision Rehash: When none of the 4 entries in a bucket match vpn and the bucket's collision-chain bit allows continuation, the next probe state advances via ivory_pht_rehash_next(state) = (state * 17U) + 1U, shifted and masked into pht_mask.
  • Emulator Vectorization: On AVX-512 hosts (emu/src/cpu_zen4_avx512.c), ivory_pht_hash_avx512() computes the entire 26-bit hash in 4 instructions using vpshufbitqmb (AVX-512 BITALG), and ivory_pht_probe_bucket_avx512() probes all 4 PHT0 entries of a 64-byte bucket in a single ZMM load.

4. Map Cache & Emulator Coherence (IvoryDcache)

Ivory includes a hardware virtual-to-physical Map Cache managed via internal registers:

  • LOAD-MAP-0..3 (#o033, #o233, #o433, #o633): Installs a PHT1 mapping for the VMA in BAR0..3.
  • LOAD-MATCHING-MAP-0..3 (#o052, #o252, #o452, #o652): Updates an existing Map Cache entry only if its VPN matches BAR0..3 (used to update modified / write_protect bits without allocating a new slot).
  • INVALIDATE-MAP-0..3 (#o032, #o232, #o432, #o632): Invalidates the entry matching BAR0..3.
  • %REGISTER-MAP-CACHE-CONTROL (#o026): Global flush / enable control.
  • %REGISTER-COUNT-MAP-RELOADS (#o1011): Diagnostic reload counter incremented on Map Cache fills.

Emulator Coherence Invariants (emu/src/mem.c, emu/src/cpu_decode.c)

  1. Translation Epoch (mem->map_epoch): Any Map Cache flush, entry invalidation, or entry load increments mem->map_epoch, immediately invalidating the CPU's 64-entry L0 decoded instruction-page cache.
  2. Self-Modifying / Dynamically Loaded Code (IvoryDcache): The 256-page decoded instruction cache (IvoryDcache) is physically tagged by 24-bit PPN using a 1 KiB L1d-resident 2-way tag directory (uint64_t ppn_pair[128]). Every RAM write calls ivory_mem_note_ram_write_pma(), which updates the dirty-page bitmap and calls ivory_dcache_invalidate_ppn() in O(1) time so JIT/Lisp-compiled functions, world loads, and FEP overlays are always coherent without stale decoded slots.
Related Chip Datasheets (8)All Component Datasheets →