Skip to main content

Module unified_placement

Module unified_placement 

Source
Expand description

unified_placement — Phase 5: ONE LOGOS program placed across THREE execution planes that all run LOGOS (host-CPU tiers, the reconfigurable fabric-CPU, and the DRAM-compute plane), under a single shared primitive descriptor, certified ≡ the VM.

The bet of the whole campaign, made mechanical: a bulk-bitwise/copy LOGOS op can run inside the memory (ComputeDRAM), a spatial op on the fabric, and everything else on the host CPU — and the compiler places each op where it wins, with the shared DRAM heap as the common data plane and no marshalling between planes. Because every plane’s per-op semantics are individually ≡VM (host is the reference; the DRAM path is super::dram::word_majority — AND=MAJ(a,b,0), OR=MAJ(a,b,1), proven in Phase 0; the fabric computes the same bitwise result), the placed whole program is ≡VM.

PRIMS is the SINGLE SOURCE OF TRUTH: both the placement pass and the per-plane executors read it, and a drift lock proves the DRAM executor supports exactly the ops the descriptor advertises.

Structs§

PrimDesc
One entry of the shared primitive descriptor: which planes can realize this op. The DRAM plane has TWO tiers: dram = unmodified ComputeDRAM (Gao et al., MICRO 2019 — RowClone + MAJ-based AND/OR); dram_ambit = the Ambit tier (Seshadri et al., MICRO 2017), which adds bulk NOT (dual-contact cells) and thereby XOR, at the cost of MINOR DRAM modifications. dram_ambit is a superset of dram.

Enums§

Plane
The execution planes, all of which run LOGOS.
Prim
A bulk primitive over whole bit-vector rows in the shared data plane (row indices into the heap).
PrimKind
The op kinds in the shared primitive vocabulary.

Constants§

PRIMS
THE SINGLE SOURCE OF TRUTH. host_cpu is always true (the host runs everything — the universal fallback). dram is true only for the ops UNMODIFIED ComputeDRAM realizes: RowClone (copy) + bulk bitwise AND/OR (the sense-amp majority) — the conservative tier the placement pass routes to. dram_ambit additionally covers NOT + XOR (the Ambit boolean basis) on minor-modification DRAM; the codegen_dram target uses this tier. Reductions (Popcount) are control-shaped → host only, on neither tier.
WIDE_WORDS
Operands at least this many u64 words wide favor in-DRAM execution (the bytes-not-moved win).

Functions§

desc
exec_dram
Execute prim on the DRAM-compute plane (ComputeDRAM semantics): RowClone for copy, the sense-amp majority reduction for AND (MAJ(a,b,0)) and OR (MAJ(a,b,1)). Returns None for ops with no plain- ComputeDRAM realization (the descriptor’s dram: false ops). MUST agree op-for-op with exec_reference.
exec_dram_ambit
Execute prim on the DRAM plane at the AMBIT tier (Seshadri et al., MICRO 2017): the unmodified ComputeDRAM ops (exec_dram) PLUS bulk NOT (dual-contact cells) and XOR (NOT + triple-row MAJ, a multi-row in-DRAM sequence — the RESULT is exactly a ^ b, the ≡VM contract; the sequencing is the in-DRAM implementation detail). Ambit needs MINOR DRAM modifications, distinct from the unmodified exec_dram. Returns None only for the reduction (Popcount is control-shaped → host). Realizes EXACTLY the descriptor’s dram_ambit ops, and agrees op-for-op with exec_reference.
exec_fabric
Execute prim on the fabric plane. The fabric computes the same bitwise result as the VM (its tile ALUs are proven ≡VM elsewhere); returns false for ops with no fabric realization.
exec_on
Dispatch prim to plane, asserting the plane can realize it (placement must never assign an op to a plane that cannot run it). Each plane’s result equals the VM reference (proven by the locks).
exec_reference
The reference (VM) semantics of a primitive over the heap — the oracle every plane is proven against.
place
The placement pass: choose the plane for prim given its operand width, from the shared descriptor. Bulk/wide bitwise + copy → DRAM (compute-in-memory); otherwise the fabric; else the host CPU (which runs everything). Never fails — the host is the universal fallback.
run_placed
Run a program with placement: each op executes on the plane the cost model assigns it. operand_words is the row width (the placement’s size input). Returns the final heap.
run_reference
Run a program entirely on the host CPU — the VM reference.

Type Aliases§

Row
A row of the shared data plane: a bit vector packed into u64 words.