XL1200-EMU Symbolics XL1200 Emulator

Volume 3: Virtual Memory, Paging, Merlin-II Physical Map & Garbage Collection

This volume specifies the Ivory 32-bit virtual memory architecture, the proven XL1200 Merlin-II physical address map, the Page Hash Table (PHT) and hardware BAR hash box, the 13 hardware memory cycle types (Table 13), generational/ephemeral GC barriers, and emulator Map Cache / IvoryDcache coherence.

All addresses, bitfields, and cycle rules match ivory_hw.h and emu/src/{mem.c,cpu_decode.c,cpu_zen4_avx512.c}.

Primary Reference Sources (local-only when present):

  • genera-original/sys.sct/i-sys/{sysdef.lisp,sysdf1.lisp} — PHT0/PHT1 layouts, zones, 13 memory cycles, oldspace registers.
  • genera-original/sys.sct/i-sys/{io-register-definitions.lisp,console.lisp,wired-screen.lisp,merlin-scsi-hardware.lisp,vme-defs.lisp,i-clocks.lisp} — Proven Merlin-II and I/O Board 0 physical addresses.
  • I_Machine/I-Machine_Architecture_Specification.pdf — Pages 85–89 (Virtual Memory, Table 13, Hardware BAR Hash Box).

1. Virtual Address Geometry & Zone Partitions

Ivory's 32-bit VMA addresses 4 GigaWords (\(2^{32}\) 40-bit words), subdivided cleanly by powers of two:

UnitSize (Words)VMA BitsRole
Page256 (\(2^8\))<7:0> offset, <31:8> 24-bit VPNPHT mapping, dirty/write-protect, and IvoryDcache unit
Quantum65,536 (\(2^{16}\), 256 pp)<31:16>Genera area allocation quantum
Ephemeral Half-Level2,097,152 (\(2^{21}\))Zone 0 <24:21>32 ephemeral GC half-levels inside Zone 0
Zone134,217,728 (\(2^{27}\), 128 MW)<31:27> (0..31)Top-level GC and wired-window partition

Virtual Translation Paths

  1. Zone 0 (0x00000000–0x07FFFFFF) — Ephemeral Space: PHT-translated; governed by %REGISTER-EPHEMERAL-OLDSPACE (#o16) and PHT1 ephemeral_reference.
  2. Zones 1..30 (0x08000000–0xF7FFFFFF) — Dynamic & Static Virtual Space: PHT-translated through the on-chip Map Cache; governed by %REGISTER-ZONE-OLDSPACE (#o17).
  3. Zone 31 (0xF8000000–0xFFFFFFFF, #o37000000000–#o37777777777) — Wired VMA=PMA Window:
    • Bypasses the PHT; hardware strips the top 5 bits: PMA = VMA & 0x07FFFFFF (128 MW window).
    • Top 128 KW (0x07FE0000–0x07FFFFFF) is reserved for the wired Boot Comm Area (+0x00..+0x3F), Boot PROM (+0x40..+0xFFFF), and I-Bus window (0x07FF0000..0x07FFFFFF), capping directly-wired Zone 31 RAM at 127.875 MW (0x00000000–0x07FDFFFF).
    • Physical memory above 128 MW (up to 4 GW via 24-bit PHT1.ppn) is accessed through PHT virtual mappings in Zones 1..30.
  4. DTP-PHYSICAL-ADDRESS (#o40) — Unmapped 32-Bit Physical Bypass:
    • Memory operations whose address word carries tag DTP_PHYSICAL_ADDRESS bypass both the PHT and the 27-bit Zone 31 mask, issuing the full 32-bit PMA directly onto the Merlin-II physical bus. All Merlin-II motherboard and I/O Board 0 peripherals reside here.

2. Proven XL1200 Merlin-II Physical Memory Map (ivory_hw.h)

2.1 Zone 31 Accessible Physical Space (0x00000000–0x07FFFFFF)

Physical Address (PMA)SizeSubsystem
0x00000000–0x007FFFFF8 MWStandard XL1200 Main DRAM (IVORY_MERLIN_MAX_CONTIG_RAM_WORDS; emulator configurable up to 127.875 MW in Zone 31 / 4 GW via PHT)
0x000400004 KWWired Trap Vector Base (VMA 0xF8040000), followed by FEP Comm (0x00041000), Syscom (0x00041100), NIL (0x00041200), T (0x00041208)
0x07FE0000–0x07FE003F64 WWired Boot Comm Area (VMA 0xFFFE0000: *BOOT-EMB-COMMUNICATION-AREA*, *BOOT-SPY-PC* at +0x04, halt vector +0x10..+0x12, Main Board ID ROM +0x20..+0x3F)
0x07FE0040–0x07FEFFFF64 KWPhysical Boot PROM window (Reset Vector 0x07FE0040 / #o777400100)

2.2 DTP-PHYSICAL-ADDRESS Motherboard & I/O Board 0 Map (0x08000000–0x8FF8000F)

Physical Address (PMA)Constant (ivory_hw.h)Hardware Device
0x08000000–0x08000003MERLIN_TIMER_BASE_PMAIntel 82C54 Programmable Interval Timer (3 counters + control)
0x09000000–0x090007FFMERLIN_NVRAM_BASE_PMASGS-Thomson MK48T02 2 KB Battery-Backed NVRAM + TOD Clock (0x090007F8..0x090007FF)
0x0A000000MERLIN_LEDS_PMAMerlin-II Diagnostic LEDs
0x0A000004MERLIN_CACHE_CTRL_PMAMerlin-II On-Board Memory Cache Control (<1:0> mode, <2> diag, <3> clear tags)
0x0A000008MERLIN_VME_TIMEOUT_PMAMerlin-II VME Timeout / ECO Register
0x0A00000CMERLIN_IRQ_REG_PMAMerlin-II 32-Bit Interrupt Status Register (MerlinInterruptControlReg)
0x40000000–0x4000FFFFMERLIN_IO_BOARD0_BASE_PMAI/O Board 0 64 KW DMA SRAM (Serial DMA 0x40004200 + #o7000 W; SCSI I/O buffer 0x40005000 + #o20000 W)
0x44014000MERLIN_ESDI_CABLE_STATUS_PMAESDI cable status
0x44014800MERLIN_SERIAL_CTRL_PMASerial subsystem control register
0x44015000MERLIN_SCSI_CTRL_PMASCSI subsystem control register
0x44016000–0x4401601FMERLIN_IO0_ID_ROM_BASE_PMAPrimary I/O Board 0 32-byte ID ROM (48-bit Ethernet MAC) & Intel 82586 Ethernet Control in bits <7:5> (<7> inhibit reset, <6> CA pulse, <5> inhibit loopback)
0x44017000 / 0x44017100MERLIN_DUSCC_{WRITE,READ}_PMASignetics SCN68562 Dual Universal Serial Communications Controller (Console KB/Mouse + Serial)
0x44017200 / 0x44017300MERLIN_DMAC_{WRITE,READ}_PMAIntel 8237A Serial DMA Controller
0x44017800 / 0x44017900MERLIN_SCSI_POLL_{WRITE,READ}_PMAWestern Digital WD33C93A SCSI Controller (address/data ports)
0x4401A000..0x4401B800MERLIN_SCSI_{START_WRAP,OVERRUN,TRIGGER,DMA_COUNTER}_PMAWD33C93A DMA wrap, overrun, trigger, and transfer counter registers
0x44020000–0x4402003FMERLIN_ESDI_DP8466_BASE_PMANational Semiconductor DP8466 ESDI Disk Controller
0x44024000MERLIN_VIDEO_VPOS_PMAConsole video vertical beam position
0x4402C000MERLIN_VIDEO_CTRL_PMAConsole Video & Audio Control (<4:0>)
0x4402D000 / 0x4402D001MERLIN_VIDEO_8158_{DATA,CTRL}_PMABrooktree/8158 Console Video Timing Controller
0x48000000–0x4807FFFFMERLIN_VRAM_BASE_PMA512 KW Monochrome Console Framebuffer (1152×896, 1 bpp)
0x50000000MERLIN_IO_BOARD1_BASE_PMAI/O Board 1 (unpopulated on standard XL1200 -> IVORY_TRAP_MEMORY_BUS_ERROR #o5124)
0x80000000, 0x88000000, 0x8FF80000MERLIN_VME_CTL0, MERLIN_VIC068, MERLIN_VME_CTL1VMEbus control windows & Cypress VIC068 VMEbus Interface Controller

3. Page Hash Table (PHT), Hardware Hash Box & Cache Coherence

The PHT is an open-addressed hash table in wired memory (PHT-BASE #o1007, PHT-MASK #o1010) composed of 8-word buckets (4 entries × 2 words: PHT0, PHT1).

3.1 IvoryPhtEntry Bit Layout (sysdef.lisp:1312-1344)

  • PHT0 (Word 0):
    • <3:0> age, <5:4> spare, <6> pending, <7> fault_request (traps #o5121), <31:8> 24-bit vpn (0xFFFFFF = empty), <37:32> DTP_FIXNUM, <38> end_collision_chain (%%PHT0-CHAIN), <39> CDR<1>.
  • PHT1 (Word 1):
    • <3:0> ephemeral_reference, <4> transport_trap, <5> cache_inhibit, <6> write_protect (traps #o5122 on write), <7> modified, <31:8> 24-bit ppn, <37:32> DTP_FIXNUM, <39:38> CDR code.

3.2 Grouped Bit-Run ivory_pht_hash() & Collision Rehash

Reading %REGISTER-PHT-HASH-0..3 (#o007, #o207, #o407, #o607) returns the 26-bit bucket-aligned offset (bits <2:0> = 0):

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>)
  • Scalar implementation (ivory_hw.h): Computes 32-bit SWAR bit-reversal once and combines the 7 grouped bit-runs with masks/shifts and XORs.
  • AVX-512 implementation (cpu_zen4_avx512.c): Computes the identical 26-bit hash in 4 instructions via vpshufbitqmb (AVX-512 BITALG), and ivory_pht_probe_bucket_avx512() matches all 4 PHT0 entries of a 64-byte bucket in a single ZMM register.
  • Collision rehash: ivory_pht_rehash_next(state) = (state * 17U) + 1U. If a lookup misses and end_collision_chain == 1, hardware raises IVORY_TRAP_PAGE_NOT_RESIDENT (#o5120).

3.3 Map Cache & Emulator IvoryDcache Coherence

Software manages the hardware Map Cache via LOAD-MAP-0..3 (#o033..#o633), LOAD-MATCHING-MAP-0..3 (#o052..#o652), INVALIDATE-MAP-0..3 (#o032..#o632), and MAP-CACHE-CONTROL (#o026).

  • Any Map Cache mutation bumps mem->map_epoch, invalidating the CPU's 64-entry L0 I-cache immediately.
  • Every RAM write calls ivory_mem_note_ram_write_pma(), marking the 256-word page dirty and invalidating its physical PPN in the 256-page IvoryDcache (ivory_dcache_invalidate_ppn) in O(1) time. See Paging System and Emulator Core & Acceleration for details.

4. The 13 Hardware Memory Cycle Types (Table 13)

Ivory encodes memory-forwarding, trap, and GC transport rules directly in hardware across 13 distinct cycle types (IvoryMemoryCycleType in ivory_hw.h, sysdef.lisp:1620-1634):

CodeCycle NameFollows HFWDFollows EFWD/1FWDFollows EVCPMFWD ActionGC_FWD ActionDTP_NULL ActionGC Transport
0DATA_READYesYesYesMonitor trap (#o5112)Transport (#o5106)MEMORY_DATA_ERROR (0x0047)Yes
1DATA_WRITEYesYesYesMonitor trap (#o5112)Transport (#o5106)Overwrites (preserves CDR)Write barrier
2BIND_READYesYesNoMonitor trap (#o5112)Transport (#o5106)AllowedYes
3BIND_WRITEYesYesNoMonitor trap (#o5112)Transport (#o5106)Overwrites (preserves CDR)Write barrier
4BIND_READ_NO_MONITORYesYesNoFollowsTransport (#o5106)AllowedYes
5BIND_WRITE_NO_MONITORYesYesNoFollowsTransport (#o5106)Overwrites (preserves CDR)Write barrier
6HEADER_READYesNoNoTrapsTransport (#o5106)TrapsNo
7STRUCTURE_OFFSETYesNoNoTrapsTransport (#o5106)AllowedNo
8SCAVENGENoNoNoNoTransport (#o5106)AllowedYes
9CDR_READYesEFWD onlyNoNoTransport (#o5106)Allowed (returns CDR)No
10GC_COPYNoNoNoNoTransport (#o5106)AllowedNo
11RAW_READNoNoNoNoNoAllowedNo
12RAW_TRANSLATE—————Address translation onlyNo

CLOS / Unbound Variable Note: Reading DTP_NULL (#o00) on a DATA_READ cycle triggers IVORY_TRAP_ERROR (#o5100) with Rev 4 microstate IVORY_REV4_USTATE_MEMORY_DATA_ERROR (0x0047, vma_valid = 1), which Genera's trap handler translates into SYS:UNBOUND-VARIABLE or CLOS:SLOT-UNBOUND.


5. Hardware Garbage Collection Barriers

Ivory accelerates Genera's generational (Ephemeral) and Dynamic copying garbage collectors with two zero-overhead hardware barriers:

  1. Read Barrier (Oldspace Transport Trap, #o5106):
    • On DATA_READ, BIND_READ*, and SCAVENGE cycles, if the loaded word is a pointer type (K_POINTER_DTP_MASK) whose target VMA falls in either:
      • Zone 0 with its ephemeral half-level bit ((vma >> 21) & 31) set in %REGISTER-EPHEMERAL-OLDSPACE (#o16), or
      • Zones 1..30 with its zone bit (vma >> 27) set in %REGISTER-ZONE-OLDSPACE (#o17), hardware immediately raises IVORY_TRAP_TRANSPORT (#o5106) so the collector evacuates the object to newspace, leaves a DTP_GC_FORWARD (#o45) heart, and snaps the pointer before restarting the instruction.
  2. Write Barrier (Ephemeral Reference Tracking):
    • On DATA_WRITE / BIND_WRITE* cycles storing a Zone 0 ephemeral pointer into an older page, hardware updates PHT1.ephemeral_reference (<3:0>) or triggers PHT1.transport_trap (<4>) so minor ephemeral collections only scan dirty inter-generational pages rather than the entire heap.
Related Chip Datasheets (11)All Component Datasheets →