Skip to main content

schedule_pipeline

Function schedule_pipeline 

Source
pub fn schedule_pipeline(
    ops: &[FabricOp],
    result: usize,
    budget: f64,
) -> PipelineSchedule
Expand description

Cut a residual into the shortest pipeline whose stages each stay within budget (in the units of op_delay), placing every computed value so the pipeline holds the fewest live register bits. An op deeper than the budget on its own still gets a stage, alone.

The placement is exact. A legal assignment of stages is a set of difference constraints (a reader never sits before what it reads; two values joined by a path deeper than the budget sit in different stages), and the bits a value holds are its live bits times the stages between it and its last reader. With each value’s stage bounded by its earliest and latest, “stage(x) ≥ k” becomes a boolean, every constraint an implication between them, and the cost a weight on each: the cheapest assignment is a minimum-weight closure, found as a minimum cut.