Skip to main content

Module budget

Module budget 

Source
Expand description

The programmable-part resources a fabric program spends, counted from exactly what the printer declares, so a program too big for its part is refused before a line of RTL is printed.

Every count is a LOWER bound — the fewest of a resource the declared memories and arrays can take — so a refusal is sound: the real design needs at least this much, and this much already does not fit. A block-RAM bank cannot hold more bits than its RAMBs do, a distributed-RAM memory cannot pack its bits into fewer than one LUT per 64 PER READ PORT (each port is its own LUT copy of the data — a pool read through a gather’s lanes replicates once a lane), a registers-style memory is one flip-flop a bit, and a matmul array is at least one DSP a MAC. Each is the bits of the memories the printer declares, divided down — never more than a routed image used.

Structs§

DeclaredMemory
A memory the fabric prints: the arguments one memory_decl / print_pool call receives, and the read ports it is read through (each a LUT copy when it is distributed RAM — a pool’s nread, a tensor memory’s one).
FabricUsage
What a fabric spends of each part resource: a lower bound on the RAMB18s, LUT-RAM LUTs, flip-flops and DSP slices the printed design takes.

Functions§

check_capacity
Refuse p on target when it needs more of any of the part’s resources than it has — before any RTL is printed. A target with no part (SpatialTarget::part None) is never refused here.
fabric_memories
Every memory the fabric declares for p on target, in printer order: each site’s tensor memories (as print_site emits them, one per tensor in the site’s banks) then its pools (as print_pool does).
fabric_usage
The resources p spends on target’s fabric.
usage_by_resource
A map from each resource to its usage, for a test to read.