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):
| Granularity | Word Count | Bit Slice | Description |
|---|---|---|---|
| Page | 256 words (\(2^8\)) | <7:0> offset, <31:8> 24-bit VPN | Atomic unit of PHT mapping, protection, and dirty tracking |
| Quantum | 65,536 words (\(2^{16}\), 256 pages) | <31:16> | Area allocation unit |
| Ephemeral Half-Level | 2,097,152 words (\(2^{21}\)) | Zone 0 <24:21> | Ephemeral GC generation half-level (32 half-levels in Zone 0) |
| Zone | 134,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 PHT1ephemeral_referencewrite 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) — WiredVMA=PMAWindow:- 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.
- Bypasses the PHT completely. Hardware strips the top 5 bits:
DTP-PHYSICAL-ADDRESS(#o40) — Full 32-Bit Physical Bypass:- Memory instructions (
MEMORY-READ,MEMORY-WRITE,BLOCK-n-READ/WRITE, etc.) given a pointer taggedDTP_PHYSICAL_ADDRESSbypass 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.,0x0800000082C54 PIT,0x09000000MK48T02 NVRAM/TOD,0x0A00000CMerlin-II IRQ register,0x40000000IO0 64 KW SRAM,0x44014000..0x4402D001IO0 DUSCC/DMAC/WD33C93A/ESDI/Video/82586,0x48000000monochrome VRAM,0x80000000..0x8FF80000VME/VIC068).
- Memory instructions (
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)
| Bits | Field | Lisp Constant | Description |
|---|---|---|---|
<3:0> | age | %%PHT0-AGE | 4-bit page replacement age |
<5:4> | _spare | — | Reserved / spare |
<6> | pending | %%PHT0-PENDING | Page I/O pending |
<7> | fault_request | %%PHT0-FAULT-REQUEST | If 1, triggers IVORY_TRAP_PAGE_FAULT_REQUEST (#o5121) on access |
<31:8> | vpn | %%PHT0-VPN | 24-bit Virtual Page Number (0xFFFFFF = IVORY_PHT_INVALID_VPN empty slot) |
<37:32> | data_type | %%Q-DATA-TYPE | DTP_FIXNUM (#o10) |
<38> | end_collision_chain | %%PHT0-CHAIN | 1 = end of probe chain (stop rehashing on miss); 0 = continue probing |
<39> | _cdr_hi | CDR<1> | Upper CDR bit |
Word 1: PHT1 (Physical Page Number & Protection)
| Bits | Field | Lisp Constant | Description |
|---|---|---|---|
<3:0> | ephemeral_reference | %%PHT1-EPHEMERAL-REFERENCE | 4-bit GC ephemeral-reference tracking bits |
<4> | transport_trap | %%PHT1-TRANSPORT-TRAP | If 1, page access triggers GC transport check |
<5> | cache_inhibit | %%PHT1-CACHE-INHIBIT | If 1, inhibits hardware memory caching |
<6> | write_protect | %%PHT1-WRITE-PROTECT | If 1, writes trigger IVORY_TRAP_PAGE_WRITE_FAULT (#o5122) |
<7> | modified | %%PHT1-MODIFIED | Dirty bit; set by hardware/software on first write |
<31:8> | ppn | %%PHT1-PPN | 24-bit Physical Page Number (supports up to 4 GW physical space) |
<37:32> | data_type | %%Q-DATA-TYPE | DTP_FIXNUM (#o10) |
<39:38> | cdr_code | %%Q-CDR-CODE | CDR 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
vpnand the bucket's collision-chain bit allows continuation, the next probe state advances viaivory_pht_rehash_next(state) = (state * 17U) + 1U, shifted and masked intopht_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 usingvpshufbitqmb(AVX-512 BITALG), andivory_pht_probe_bucket_avx512()probes all 4PHT0entries of a 64-byte bucket in a singleZMMload.
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 aPHT1mapping for the VMA inBAR0..3.LOAD-MATCHING-MAP-0..3(#o052,#o252,#o452,#o652): Updates an existing Map Cache entry only if its VPN matchesBAR0..3(used to updatemodified/write_protectbits without allocating a new slot).INVALIDATE-MAP-0..3(#o032,#o232,#o432,#o632): Invalidates the entry matchingBAR0..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)
- Translation Epoch (
mem->map_epoch): Any Map Cache flush, entry invalidation, or entry load incrementsmem->map_epoch, immediately invalidating the CPU's 64-entry L0 decoded instruction-page cache. - 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 callsivory_mem_note_ram_write_pma(), which updates the dirty-page bitmap and callsivory_dcache_invalidate_ppn()in O(1) time so JIT/Lisp-compiled functions, world loads, and FEP overlays are always coherent without stale decoded slots.
- VTC / Cypress VIC068A —
cypress_VIC068A_VAC068A_users_guide.pdf(mirror) - Intel 82586 —
intel_82586_lan_coprocessor.pdf(mirror) - Intel 82586 —
intel_82586_reference_manual_1983.pdf(mirror) - Intel 82C54 —
intel_82C54_pit.pdf - Signetics SCN68562 / SCN26562 —
signetics_1991_IC019_data_comm_SCN68562.pdf(mirror) - Mostek MK48T02 / ST M48T02 —
st_M48T02_MK48T02_timekeeper.pdf - Western Digital WD33C93A —
wd_WD33C93A_datasheet_and_appnotes_1990.pdf(mirror) - Western Digital WD33C93A —
wd_WD33C93A_scsi_datasheet.pdf(mirror)