# Tests for opt_first_fit_alloc # # The pass detects greedy first-fit "running-rank" resource allocators (the # serial taken[]/done[] loop) and replaces the loop-carried cone with a # log-depth priority-encode + all-pairs category-equality + prefix-sum + gather # network. Where a per-slot field table (an "xbar") is driven from the same # allocation, it is rewritten from the shared scan. # # Each group exercises a specific facet: # A: basic detection + formal equivalence across allocator shapes (N=8). # B: depth / cell-count bounds after rewrite (the actual QoR win). # C: the customer slice (dsel + xbar) at N=8 (equiv) and N=16 (structural). # D: variant detection (bc on/off, LSB/MSB-first scan). # E: negative / no-op cases (no false rewrites). # F: extra fanout / input reuse. # # Convention: every object the pass emits is named with an `ffa_` suffix, so # `select w:*ffa_*` is a reliable "did the rewrite fire" probe. # ============================================================================ # Group A: basic shapes (equiv_opt -assert) # ============================================================================ # A1: dsel-only first-fit allocator, N=8 NB=4 (W=2) C=2, LSB-first, with bc. log -header "A1: dsel-only allocator N=8 (equiv)" log -push design -reset read_verilog -sv < no rewrite" log -push design -reset read_verilog -sv < no rewrite" log -push design -reset read_verilog -sv < no candidate root. log -header "E3: width below min-width -> no rewrite" log -push design -reset read_verilog -sv < no rewrite" log -push design -reset read_verilog <