3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 03:35:40 +00:00
yosys/passes/opt/CMakeLists.txt
Akash Levy 00e48706df opt: recognize three QoR logic-depth patterns
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>
2026-07-06 12:56:38 -07:00

133 lines
1.7 KiB
CMake

add_subdirectory(opt_clean)
yosys_pass(opt_merge
opt_merge.cc
)
yosys_pass(opt_mem_widen
opt_mem_widen.cc
)
yosys_pass(opt_muxtree
opt_muxtree.cc
)
yosys_pass(opt_reduce
opt_reduce.cc
)
yosys_pass(opt_dff
opt_dff.cc
REQUIRES
simplemap
)
yosys_pass(opt_share
opt_share.cc
)
yosys_pass(opt_expr
opt_expr.cc
)
yosys_pass(opt_hier
opt_hier.cc
)
yosys_pass(opt
opt.cc
REQUIRES
opt_clean
opt_dff
opt_expr
opt_hier
opt_merge
opt_muxtree
opt_reduce
opt_share
)
yosys_pass(opt_mem
opt_mem.cc
)
yosys_pass(opt_mem_feedback
opt_mem_feedback.cc
)
yosys_pass(opt_mem_priority
opt_mem_priority.cc
)
yosys_pass(share
share.cc
)
yosys_pass(wreduce
wreduce.cc
)
yosys_pass(opt_demorgan
opt_demorgan.cc
)
yosys_pass(rmports
rmports.cc
)
yosys_pass(opt_lut
opt_lut.cc
)
yosys_pass(opt_lut_ins
opt_lut_ins.cc
)
yosys_pass(opt_ffinv
opt_ffinv.cc
)
yosys_pass(pmux2shiftx
pmux2shiftx.cc
)
yosys_pass(muxpack
muxpack.cc
)
yosys_pass(opt_balance_tree
opt_balance_tree.cc
)
yosys_pass(opt_addcin
opt_addcin.cc
)
yosys_pass(opt_andor_pmux
opt_andor_pmux.cc
)
yosys_pass(opt_argmax
opt_argmax.cc
)
yosys_pass(opt_parallel_prefix
opt_parallel_prefix.cc
)
yosys_pass(opt_prienc
opt_prienc.cc
)
yosys_pass(opt_priority_onehot
opt_priority_onehot.cc
)
yosys_pass(opt_first_fit_alloc
opt_first_fit_alloc.cc
)
yosys_pass(opt_priokey
opt_priokey.cc
)
pmgen_command(peepopt
peepopt_shiftmul_right.pmg
peepopt_shiftmul_left.pmg
peepopt_shiftadd.pmg
peepopt_shiftpow2.pmg
peepopt_muldiv.pmg
peepopt_muldiv_c.pmg
peepopt_formal_clockgateff.pmg
peepopt_modshr_onehot.pmg
peepopt_addsub_c.pmg
peepopt_muxorder.pmg
peepopt_sub_neg.pmg
PREFIX
peepopt
)
yosys_pass(peepopt
peepopt.cc
${PMGEN_peepopt_OUTPUT}
)