The max_pairs budget was a single running counter shared across all
req_wire iterations, so once a start-candidate-heavy first req size
exhausted it, every later req size broke on its first start candidate and
was silently skipped. Reset the budget per req_wire so all req sizes get
a fair chance. (Completeness only; fingerprint_rr still validates every
match, so this never affected correctness.)
Co-authored-by: Cursor <cursoragent@cursor.com>
Extend two existing opt passes and add one new pass to collapse
serial/dynamic-index structures that were leaving high logic depth:
- opt_first_fit_alloc: recognize the "coalesce-matrix" first-fit
allocator variant (same_cat[i][k] coalescing gated on the leader's
enable, driven from a raw input enable). Rewrite both the lane_slot
allocation and the xbar field gather from one shared log-depth scan.
- opt_prienc: detect round-robin / rotated-priority scans (req scanned
from idx_last downward with wraparound) and rewrite the depth-N
idx--/req[idx] mux chain to rotate -> log-depth priority-encode ->
unrotate.
- opt_priokey (new): recognize priority-by-key one-hot accumulators and
replace each dynamic taken[key] read ($shiftx/$bmux) with the
equivalent pairwise-key-compare reduction, dropping the wide dynamic
indexing. Supports -strict for full-key-range formal validation.
Each includes self-contained tests (equiv_opt / sat -prove-asserts,
mux-bound and negative cases) in tests/opt/.
Co-authored-by: Cursor <cursoragent@cursor.com>
Fix the failing regression test: the single-fanout passthrough removal was
shorting out a cone's only real gate (e.g. a lone $_NOT_ driving an output),
replacing it with a bare wire. That drops the gate entirely (nothing left to
characterize) and, for an inverter, silently drops the inversion, making the
carved cell inequivalent to the RTL. Only short a redundant re-driver whose
input is driven by another in-cone cell; keep a passthrough that reads a
primary input (the cell-under-test's boundary gate).
Also address Greptile review comments:
- fix swapped log_warning arguments in the split-boundary-port diagnostic.
- error out (instead of silently overwriting) when two cell groups rename to
the same carved module name (e.g. slow_<enc> and fast_<enc> -> <enc>).
- derive pq_speed from the explicit "fast_" base prefix.
Co-authored-by: Cursor <cursoragent@cursor.com>