Skip to main content

Module dataflow

Module dataflow 

Source
Expand description

DRAM dataflow composition — the spatial-dataflow layer of the compute-in-memory target.

The DRAM plane’s hardware basis is {Copy, And, Or} (unmodified ComputeDRAM: RowClone + the sense-amp majority) plus Not (the Ambit tier: dual-contact cells). {AND, OR, NOT} is FUNCTIONALLY COMPLETE, so every boolean function — XOR, NAND, NOR, XNOR, set difference, … — is realized by CHAINING those primitives through intermediate rows. That chaining IS a spatial dataflow graph: edges are DRAM rows, nodes are in-DRAM primitives, and the memory computes the whole graph in place. Composed bit-serially over bitplanes, the same basis yields integer ARITHMETIC (ripple-carry ADD from XOR+MAJ) — the SIMDRAM construction (Hajinazar et al., ASPLOS 2021). Every composed op is proven ≡ its reference by executing the emitted prim sequence on the Ambit-tier DRAM executor (exec_dram_ambit).

Structs§

DramDataflow
A straight-line in-DRAM dataflow graph: a growable row heap (operands then scratch) and the prim sequence computed over it. not/and/or/copy append a node writing a FRESH scratch row and return its index; higher-level gates compose those. This is the compiler-side spatial graph the DRAM plane executes.

Functions§

bit_serial_add
Bit-serial ripple-carry ADD over B bitplanes (SIMD across the lanes packed in each row): for each bit i, sum_i = a_i XOR b_i XOR carry, carry = MAJ(a_i, b_i, carry). a/b are the operand-plane row indices (LSB first); carry0 is a zero row. Returns the B sum-plane rows. Composed entirely from the {AND, OR, NOT} basis — arithmetic emerging from boolean dataflow.
bit_serial_mul
Bit-serial unsigned MULTIPLY (shift-add): for each bit i of b, add a (masked by plane b[i]) shifted up by i into an out_width-plane accumulator. Composed from AND + bit_serial_add — integer multiply from the boolean basis. Result is a·b mod 2^out_width per lane; zero is a zero row (accumulator seed + carry-in + high-plane filler).
bit_serial_sub
Bit-serial two’s-complement SUBTRACT: a - b = a + NOT(b) + 1 (mod 2^B). Negates each b plane and ripple-adds with carry-in 1 (ones_carry = a row with every lane’s bit set). Returns the B difference-plane rows. Arithmetic subtraction, still composed from the boolean basis in-DRAM.