3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-17 04:35:44 +00:00
yosys/tests/opt
Akash Levy 945e4a403b tests/opt: add generalization coverage for the QoR pattern passes
Prove the three pattern detectors work on unseen inputs, not just the RTL
they were derived from. Because detection is functional (ConstEval
fingerprinting over the reachable input space), correctness is established
per case with equiv_opt -assert (full) or a SAT miter clamped to the
reachable range (non-power-of-two), and detection is confirmed with a
w:*tag* probe.

opt_priokey:
  D1-D3  spelling variants (explicit shift-or set, compound derived guard,
         accumulator also exported) -- all fire and prove equivalent.
  E1-E2  parameter sweep P=2..8, S=4..32.
  E3     non-power-of-two S=12 reachable-range equivalence via SAT miter.
  E4     same shape under -strict declines to rewrite (formal-flow safety).
  F1-F2  near-miss negatives (clear accumulator, multi-hot set) -> no rewrite.

opt_prienc (round-robin):
  RR4-RR5 DEPTH sweep 8/32, full sequential equivalence.
  RR6     non-power-of-two DEPTH=7 reachable-range equivalence (SAT miter).
  RR7     an entirely different spelling (upward wrap-scan, first-hit) of the
          same arbiter -- fires and proves equivalent.
  RR8     fixed-priority (no rotating pointer) negative.

opt_first_fit_alloc (coalesce):
  H1      inline same-category compare (no precomputed matrix) spelling.
  H2      different slot/field shape (N=8, NB=8, W=3).

All new cases pass locally; they avoid brittle exact cell-count asserts so
they are robust to upstream optimization drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 22:05:50 -07:00
..
alumacc.ys
bug1525.ys
bug1758.ys
bug1854.ys
bug2010.ys
bug2221.ys
bug2311.ys
bug2318.ys
bug2623.ys
bug2765.ys
bug2766.ys
bug2824.ys
bug2920.ys
bug3047.ys
bug3117.ys
bug3848.ys
bug3867.ys
bug4413.ys
bug4610.ys
bug5164.ys
bug5398.ys
generate_mk.py
memory_bmux2rom.ys
memory_dff_trans.ys
memory_map_offset.ys
opt_addcin.ys
opt_andor_pmux.v
opt_andor_pmux.ys
opt_balance_tree.ys
opt_clean_init.ys
opt_clean_init_const.ys
opt_clean_mem.ys
opt_clean_standalone_wires.ys
opt_dff-simplify.il
opt_dff-simplify.ys
opt_dff_arst.ys
opt_dff_clk.ys
opt_dff_const.ys
opt_dff_dffmux.ys
opt_dff_en.ys
opt_dff_eqbits.ys
opt_dff_eqbits_large.sv
opt_dff_eqbits_small.sv
opt_dff_mux.ys
opt_dff_qd.ys
opt_dff_sr.ys
opt_dff_srst.ys
opt_expr.ys
opt_expr_alu.ys
opt_expr_and.ys
opt_expr_cmp.v
opt_expr_cmp.ys
opt_expr_cmp_msb.v
opt_expr_cmp_msb.ys
opt_expr_combined_assign.ys
opt_expr_constconn.v
opt_expr_constconn.ys
opt_expr_consumex.ys
opt_expr_more.ys
opt_expr_mux_undef.ys
opt_expr_or.ys
opt_expr_shift.ys
opt_expr_shr_int_max.ys
opt_expr_sub_not.ys
opt_expr_xnor.ys
opt_expr_xor.ys
opt_first_fit_alloc.ys
opt_hier.tcl
opt_hier_simple1.v
opt_hier_simple2.v
opt_hier_test1.v
opt_lut.v
opt_lut.ys
opt_lut_elim.il
opt_lut_elim.ys
opt_lut_ins.ys
opt_lut_port.il
opt_lut_port.ys
opt_mem_feedback.ys
opt_mem_priority.ys
opt_merge_basic.ys
opt_merge_init.ys
opt_merge_keep.ys
opt_merge_properties.ys
opt_parallel_prefix.ys
opt_pow.ys
opt_prienc.ys
opt_priokey.ys
opt_reduce_andor.ys
opt_reduce_bmux.ys
opt_reduce_demux.ys
opt_rmdff.v
opt_rmdff.ys
opt_rmdff_sat.v
opt_rmdff_sat.ys
opt_share_add_sub.v
opt_share_add_sub.ys
opt_share_bug2334.ys
opt_share_bug2335.ys
opt_share_bug2336.ys
opt_share_bug2538.ys
opt_share_cat.v
opt_share_cat.ys
opt_share_cat_multiuser.v
opt_share_cat_multiuser.ys
opt_share_diff_port_widths.v
opt_share_diff_port_widths.ys
opt_share_extend.v
opt_share_extend.ys
opt_share_large_pmux_cat.v
opt_share_large_pmux_cat.ys
opt_share_large_pmux_cat_multipart.v
opt_share_large_pmux_cat_multipart.ys
opt_share_large_pmux_multipart.v
opt_share_large_pmux_multipart.ys
opt_share_large_pmux_part.v
opt_share_large_pmux_part.ys
opt_share_mux_tree.v
opt_share_mux_tree.ys