3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 11:45:41 +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 alumacc: add signed-independent comparison tests 2023-10-09 00:36:22 +08:00
bug1525.ys opt_share: Fix handling of fine cells. 2019-11-27 08:01:07 +01:00
bug1758.ys tests: add opt_expr tests 2020-04-23 15:58:36 -07:00
bug1854.ys Add new helper class for merging FFs into cells, use for memory_dff. 2021-05-23 14:46:59 +02:00
bug2010.ys Add testcase for #2010 2020-05-01 14:07:33 -07:00
bug2221.ys opt_expr: Fix crash on $mul optimization with more zeros removed than Y has. 2020-07-05 06:31:58 +02:00
bug2311.ys opt_expr: Fix handling of $_XNOR_ cells with A = B. 2020-07-29 12:41:43 +02:00
bug2318.ys peepopt.muldiv: Add a signedness check. 2020-08-04 16:30:24 +02:00
bug2623.ys rtlil: Disallow 0-width chunks in SigSpec. 2021-03-15 17:16:24 +01:00
bug2765.ys proc_memwr: Use the v2 memwr cell. 2021-08-11 13:34:10 +02:00
bug2766.ys opt_mem_feedback: Rewrite feedback path finding logic. 2021-05-24 23:20:30 +02:00
bug2824.ys Add regression test for #2824. 2021-06-11 12:06:35 +01:00
bug2920.ys Remove references to ilang 2024-11-05 12:36:31 +13:00
bug3047.ys extract_reduce: Refactor and fix input signal construction. 2021-10-21 04:10:01 +02:00
bug3117.ys memory_share: Fix SAT-based sharing for wide ports. 2021-12-20 18:40:14 +01:00
bug3848.ys opt_share: Fix input confusion with ANDNOT, ORNOT gates 2023-07-20 20:58:52 +01:00
bug3867.ys opt_expr: Fix 'signed X>=0' replacement for wide output ports 2023-08-01 13:50:12 +01:00
bug4413.ys peepopt: avoid shift-amount underflow 2024-06-13 23:30:07 +02:00
bug4610.ys tests: replace read_ilang with read_rtlil 2024-11-20 14:54:23 +01:00
bug5164.ys tests: add test for #5164 opt_dff -sat UAF 2025-06-06 23:46:23 +01:00
bug5398.ys opt_hier: Fix two optimizations conflicting 2025-09-29 12:27:27 +02:00
generate_mk.py Convert gen-tests shell script to python 2026-04-16 11:00:44 +02:00
memory_bmux2rom.ys Remove references to ilang 2024-11-05 12:36:31 +13:00
memory_dff_trans.ys memory_share: Add -nosat and -nowiden options. 2021-08-14 00:09:04 +02:00
memory_map_offset.ys memory_map: Improve start_offset handling. 2021-05-31 17:45:21 +02:00
opt_addcin.ys Fixup 2026-05-27 01:51:54 -07:00
opt_andor_pmux.v Fixes for filtering small cases and catching more larger ones with trickier signatures 2026-05-27 03:40:44 -07:00
opt_andor_pmux.ys Fixes for filtering small cases and catching more larger ones with trickier signatures 2026-05-27 03:40:44 -07:00
opt_balance_tree.ys Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
opt_clean_init.ys opt_clean: Remove init attribute bits together with removed DFFs. 2021-03-15 17:16:53 +01:00
opt_clean_init_const.ys Add test that connects a wire with init to a constant 2026-03-06 02:20:08 +00:00
opt_clean_mem.ys proc_memwr: Use the v2 memwr cell. 2021-08-11 13:34:10 +02:00
opt_clean_standalone_wires.ys Don't update used_signals for retained wires in rmunused_module_signals. 2026-01-24 03:41:18 +00:00
opt_dff-simplify.il opt_dff: add test 2025-08-14 00:13:23 +03:00
opt_dff-simplify.ys opt_dff: more explicit testing, typo 2025-08-27 11:29:57 +02:00
opt_dff_arst.ys Use equiv_opt -nocells to ensure everything is ok since dffs retain their name 2025-01-16 19:40:18 -08:00
opt_dff_clk.ys Use equiv_opt -nocells to ensure everything is ok since dffs retain their name 2025-01-16 19:40:18 -08:00
opt_dff_const.ys Use equiv_opt -nocells to ensure everything is ok since dffs retain their name 2025-01-16 19:40:18 -08:00
opt_dff_dffmux.ys Use equiv_opt -nocells to ensure everything is ok since dffs retain their name 2025-01-16 19:40:18 -08:00
opt_dff_en.ys Use equiv_opt -nocells to ensure everything is ok since dffs retain their name 2025-01-16 19:40:18 -08:00
opt_dff_eqbits.ys Merge from upstream 2026-07-06 07:47:32 -07:00
opt_dff_eqbits_large.sv Merge from upstream 2026-07-06 07:47:32 -07:00
opt_dff_eqbits_small.sv Merge from upstream 2026-07-06 07:47:32 -07:00
opt_dff_mux.ys Use equiv_opt -nocells to ensure everything is ok since dffs retain their name 2025-01-16 19:40:18 -08:00
opt_dff_qd.ys Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
opt_dff_sr.ys Use equiv_opt -nocells to ensure everything is ok since dffs retain their name 2025-01-16 19:40:18 -08:00
opt_dff_srst.ys Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
opt_expr.ys End of file fix 2026-06-23 07:23:41 +02:00
opt_expr_alu.ys test: update opt_expr_alu test 2020-05-08 11:12:58 -07:00
opt_expr_and.ys tests: add opt_expr tests 2020-04-23 15:58:36 -07:00
opt_expr_cmp.v opt_expr: improve simplification of comparisons with large constants. 2019-01-02 15:45:28 +00:00
opt_expr_cmp.ys opt_expr: simplify any unsigned comparisons with all-0 and all-1. 2019-01-02 02:45:49 +00:00
opt_expr_cmp_msb.v opt_expr for constant comparisons 2026-04-20 02:03:35 -07:00
opt_expr_cmp_msb.ys opt_expr for constant comparisons 2026-04-20 02:03:35 -07:00
opt_expr_combined_assign.ys opt_expr: avoid multiple drivers issue #4792 in combined assign tests 2025-12-19 18:32:56 +01:00
opt_expr_constconn.v opt_expr: Propagate constants to port connections. 2021-07-27 20:44:26 +02:00
opt_expr_constconn.ys opt_expr: Propagate constants to port connections. 2021-07-27 20:44:26 +02:00
opt_expr_consumex.ys tests: opt_expr tests that depend on consumex 2020-05-08 11:07:11 -07:00
opt_expr_more.ys opt_expr: expand test coverage 2025-03-31 19:31:53 +02:00
opt_expr_mux_undef.ys End of file fix 2026-06-23 07:23:41 +02:00
opt_expr_or.ys tests: add opt_expr tests 2020-04-23 15:58:36 -07:00
opt_expr_shift.ys tests: test opt_expr for 32 bit unsigned shifts 2025-05-26 15:28:44 +01:00
opt_expr_shr_int_max.ys Add test for shifting by INT_MAX 2025-02-14 14:01:27 +13:00
opt_expr_sub_not.ys Add tests. 2026-06-10 11:30:03 +02:00
opt_expr_xnor.ys simplemap: Map $xnor to $_XNOR_ cells 2022-11-29 19:06:45 +01:00
opt_expr_xor.ys simplemap: Map $xnor to $_XNOR_ cells 2022-11-29 19:06:45 +01:00
opt_first_fit_alloc.ys tests/opt: add generalization coverage for the QoR pattern passes 2026-07-06 22:05:50 -07:00
opt_hier.tcl opt_hier: fix test 2026-02-03 18:10:29 +01:00
opt_hier_simple1.v Start opt_hier 2025-07-05 16:45:52 +02:00
opt_hier_simple2.v Start opt_hier 2025-07-05 16:45:52 +02:00
opt_hier_test1.v Start opt_hier 2025-07-05 16:45:52 +02:00
opt_lut.v opt_lut: new pass, to combine LUTs for tighter packing. 2018-12-05 16:30:37 +00:00
opt_lut.ys Skip opt_lut test 2024-09-23 05:35:03 -07:00
opt_lut_elim.il opt_lut: eliminate LUTs evaluating to constants or inputs. 2018-12-31 23:55:40 +00:00
opt_lut_elim.ys Remove references to ilang 2024-11-05 12:36:31 +13:00
opt_lut_ins.ys Remove references to ilang 2024-11-05 12:36:31 +13:00
opt_lut_port.il opt_lut: leave intact LUTs with cascade feeding module outputs. 2018-12-07 17:13:52 +00:00
opt_lut_port.ys Remove references to ilang 2024-11-05 12:36:31 +13:00
opt_mem_feedback.ys Add v2 memory cells. 2021-08-11 13:34:10 +02:00
opt_mem_priority.ys memory_share: Add -nosat and -nowiden options. 2021-08-14 00:09:04 +02:00
opt_merge_basic.ys opt_merge: test more kinds of cells 2025-03-10 13:14:06 +01:00
opt_merge_init.ys opt_merge: Add -keepdc option required for formal verification 2022-04-01 21:03:20 +02:00
opt_merge_keep.ys opt_merge: speedup 2020-03-16 12:43:54 -07:00
opt_merge_properties.ys End of file fix 2026-06-23 07:23:41 +02:00
opt_parallel_prefix.ys opt parallel prefix and priority encoders 2026-05-20 12:14:50 -07:00
opt_pow.ys opt_expr: add test 2025-04-01 21:54:46 +03:00
opt_prienc.ys tests/opt: add generalization coverage for the QoR pattern passes 2026-07-06 22:05:50 -07:00
opt_priokey.ys tests/opt: add generalization coverage for the QoR pattern passes 2026-07-06 22:05:50 -07:00
opt_reduce_andor.ys opt_reduce: add test for constant $reduce_and/or not being zero width 2024-09-25 16:28:41 +01:00
opt_reduce_bmux.ys Remove references to ilang 2024-11-05 12:36:31 +13:00
opt_reduce_demux.ys Remove references to ilang 2024-11-05 12:36:31 +13:00
opt_rmdff.v Fix tests/opt/opt_rmdff 2020-06-09 22:48:26 +02:00
opt_rmdff.ys Add opt_dff pass. 2020-07-30 18:27:04 +02:00
opt_rmdff_sat.v Revert "Merge pull request #1280 from YosysHQ/revert-1266-eddie/ice40_full_adder" 2019-08-12 12:06:45 -07:00
opt_rmdff_sat.ys Add opt_dff pass. 2020-07-30 18:27:04 +02:00
opt_share_add_sub.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_add_sub.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_bug2334.ys opt_share: Refactor, fix some bugs. 2020-08-17 17:26:36 +02:00
opt_share_bug2335.ys opt_share: Refactor, fix some bugs. 2020-08-17 17:26:36 +02:00
opt_share_bug2336.ys opt_share: Refactor, fix some bugs. 2020-08-17 17:26:36 +02:00
opt_share_bug2538.ys End of file fix 2026-06-23 07:23:41 +02:00
opt_share_cat.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_cat.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_cat_multiuser.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_cat_multiuser.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_diff_port_widths.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_diff_port_widths.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_extend.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_extend.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_large_pmux_cat.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_large_pmux_cat.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_large_pmux_cat_multipart.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_large_pmux_cat_multipart.ys Fix wrong results when opt_share called before opt_clean 2019-08-07 09:30:58 +02:00
opt_share_large_pmux_multipart.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_large_pmux_multipart.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_large_pmux_part.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_large_pmux_part.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00
opt_share_mux_tree.v Tabs to spaces in opt_share examples 2019-08-03 12:35:46 +02:00
opt_share_mux_tree.ys Reimplement opt_share to work on $alu and $pmux 2019-07-28 16:03:54 +02:00