Skip to main content

route_loop_body

Function route_loop_body 

Source
pub fn route_loop_body(cells: &[LoopCell], n_in: usize, next: &[Src]) -> Grid
Expand description

Map a LOOP BODY onto the tile array. Same diagonal placement + Manhattan routing as the straight-line case, but each LoopCell may be a Select (a mux tile — the grid already models it), and the body produces MULTIPLE outputs (one per loop-carried next-state register, in next order). Global-input / constant operands are tapped directly; cell-value operands route (each distinct producer takes one of the tile’s two channels — a computed PREDICATE routes exactly like a computed data arm, and two ports reading one producer share a channel). This grid is the combinational BODY datapath of a loop-on-a-grid — the controller (counter / fabric predicate) latches its outputs, exactly as with the hand-wired body.