Skip to main content

pad_grid

Function pad_grid 

Source
pub fn pad_grid(g: &Grid, target_rows: usize, target_cols: usize) -> Grid
Expand description

Pad a placed grid to a larger target_rows × target_cols array: copy its tiles into the TOP-LEFT corner and leave the rest IDLE. This RESOLVES the same-shape constraint the reconfigurable-array proof needs (time_mux_n_bounded requires equal dimensions) — grids of DIFFERENT shapes co-reside on ONE array without touching any datapath. The output taps keep their positions (valid since the array only GREW), and the added IDLE tiles drive zero; because dataflow is feed-forward (south/east only), no downstream idle tile ever feeds an upstream one, so the padded grid computes EXACTLY the original (eval_grid(pad_grid(g, R, C)) == eval_grid(g)). Panics if asked to shrink.