Skip to main content

Module pmu

Module pmu 

Source
Expand description

The PMU banking model — P2 of the Plasticine lane: the Pattern Memory Unit’s scratchpad as the papers describe it (ISCA’17 §3.2), with an executable meaning.

A PMU is banks SRAM banks of words_per_bank 32-bit words (ISCA’17: 16 banks × 16 KB = 256 KB) behind an address-calculation datapath of stages FU stages. Banking modes: strided (a configurable granularity so a stride-s vector access spreads across all banks), FIFO, line buffer, and duplication (every bank holds a copy, so any gather is conflict-free at the cost of broadcast writes). N-buffering partitions each bank’s address space into n_buffers disjoint regions so a metapipeline’s producer writes region t+1 while its consumer reads region t.

The executable meaning: Pmu is banked storage whose reads/writes equal a flat heap’s (the banking is a bijection), and every vector access costs conflicts cycles = the most lanes that land in one bank. That cost is the stage’s memory II (metapipeline::Stage::memory_ii). MODELED from the paper; never a Plasticine simulation.

Structs§

AffineAccess
One vector access: lane l reads/writes base + stride * l for l in 0..lanes.
Pmu
Banked storage with a flat-address interface: the executable meaning of the banking modes.
PmuSpec
A PMU’s published shape.

Enums§

BankingMode
How addresses map to banks.

Functions§

address_datapath_stages
FU stages the address datapath needs for an affine address base + Σ stride_k * idx_k over dims counters (+1 for the lane offset when vectorized): one multiply-add per dimension, chained.
address_fits
Gate an address pattern against the PMU’s datapath depth — typed refusal.
bank_of
The bank an address lives in under mode.
conflicts
Cycles a vector access costs: the most lanes that land in one bank (1 = conflict-free). Under duplication a read is always 1 (every bank has the data; lanes are served from distinct copies).
memory_ii
The memory II of a stage: the costliest of its vector accesses per iteration.
strided_banking_for
The strided-banking configuration that makes a stride-stride vector access conflict-free: granularity = stride (lane l lands in bank (base/stride + l) % banks, all distinct while lanes <= banks).