3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-16 12:15:52 +00:00
yosys/passes/opt
Akash Levy 0a69890e3f opt_prienc: require ConstEval fingerprint inputs to be a valid cut
The round-robin (and PE/CLZ/CTZ) fingerprints pin candidate request/
start/select signals as free ConstEval inputs and evaluate the encoder
output cone. ConstEval::eval() re-computes and re-set()s the FULL output
of every combinational cell it needs. If a pinned bit is a combinational
cell output and a sibling output bit of that same cell is pulled into the
cone, evaluating the sibling re-sets the pinned bit to the cell's real
value, contradicting the free value we pinned and tripping the assertion
`current_val[i].wire != NULL || current_val[i] == value[i]` in
kernel/consteval.h.

The earlier clean_set_signals() guard only rejected constant/aliased
bits; it did not ensure the pinned signals form a valid cut. Candidates
are gathered purely by width, so an internal combinational wire (e.g. a
slice of a wider arithmetic result) can be pinned, which is exactly what
crashed on veer_speed1/picorv32/murax/raygentop.

Add is_valid_consteval_cut(): a pinned bit is a safe leaf when it is a
primary input, sequential-cell output or undriven (absent from
bit_to_driver, which holds combinational drivers only); a combinational
output is safe only if that cell's entire output lies within the pinned
cut. Apply it in both fingerprint() and fingerprint_rr(). Declining an
unclean cut only forgoes a possible rewrite, never yields a wrong one,
and the intended arbiter inputs (request ports, idx_last flop outputs)
remain valid cuts so real round-robin patterns still rewrite.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 00:00:24 -07:00
..
opt_clean Migrate build system to CMake 2026-06-03 08:58:10 +00:00
CMakeLists.txt opt: recognize three QoR logic-depth patterns 2026-07-06 12:56:38 -07:00
cut_region.h Speed up opt_* using cut_region with shared_ce 2026-07-06 07:42:47 -07:00
muxpack.cc Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
opt.cc Update passes/opt/opt.cc 2026-05-26 06:38:27 -07:00
opt_addcin.cc Fixup 2026-05-27 01:51:54 -07:00
opt_andor_pmux.cc Fixes for filtering small cases and catching more larger ones with trickier signatures 2026-05-27 03:40:44 -07:00
opt_argmax.cc Cleanup 2026-06-15 09:09:27 -07:00
opt_balance_tree.cc Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
opt_demorgan.cc Refactored uses of log_id() 2026-05-08 20:59:24 -07:00
opt_dff.cc Merge from upstream 2026-07-06 07:47:32 -07:00
opt_expr.cc Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
opt_ffinv.cc Instead of using builtin_ff_cell_types() directly, go through a method Cell::is_builtin_ff() 2025-09-17 03:24:19 +00:00
opt_first_fit_alloc.cc opt: recognize three QoR logic-depth patterns 2026-07-06 12:56:38 -07:00
opt_hier.cc Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
opt_lut.cc Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
opt_lut_ins.cc End of file fix 2026-06-23 07:23:41 +02:00
opt_mem.cc Merge remote-tracking branch 'upstream/main' into silimate 2026-06-09 16:22:51 +03:00
opt_mem_feedback.cc Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
opt_mem_priority.cc End of file fix 2026-06-23 07:23:41 +02:00
opt_mem_widen.cc Refactored uses of log_id() 2026-05-08 20:59:24 -07:00
opt_merge.cc Fixed warnings found by gcc-16 2026-06-03 13:09:38 +02:00
opt_muxtree.cc opt_muxtree: optimize for single driver, error on multiple drivers 2026-06-15 15:08:26 +02:00
opt_parallel_prefix.cc opt parallel prefix and priority encoders 2026-05-20 12:14:50 -07:00
opt_prienc.cc opt_prienc: require ConstEval fingerprint inputs to be a valid cut 2026-07-07 00:00:24 -07:00
opt_priokey.cc opt: recognize three QoR logic-depth patterns 2026-07-06 12:56:38 -07:00
opt_priority_onehot.cc Speed up opt_* using cut_region with shared_ce 2026-07-06 07:42:47 -07:00
opt_reduce.cc Merge remote-tracking branch 'upstream/main' into silimate 2026-06-09 16:22:51 +03:00
opt_share.cc Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
peepopt.cc Merge remote-tracking branch 'upstream/main' into silimate 2026-06-09 16:22:51 +03:00
peepopt_addsub_c.pmg Smallfixes 2025-09-11 05:02:58 -07:00
peepopt_formal_clockgateff.pmg Refactor uses of log_id in pgm files 2026-05-14 12:21:32 +02:00
peepopt_modshr_onehot.pmg modshr onehot pass 2026-05-20 01:25:28 -07:00
peepopt_muldiv.pmg Refactor uses of log_id in pgm files 2026-05-14 12:21:32 +02:00
peepopt_muldiv_c.pmg Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
peepopt_muxorder.pmg opt_carry_select pass 2026-06-18 02:36:29 -07:00
peepopt_shiftadd.pmg Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
peepopt_shiftmul_left.pmg Merge remote-tracking branch 'upstream/main' into silimate 2026-06-09 16:22:51 +03:00
peepopt_shiftmul_right.pmg Refactor uses of log_id in pgm files 2026-05-14 12:21:32 +02:00
peepopt_shiftpow2.pmg peepopt: add shiftpow2 pattern 2026-05-31 02:01:32 +02:00
peepopt_sub_neg.pmg Fix Yosys test failures 2025-03-13 14:15:13 -07:00
pmux2shiftx.cc Merge remote-tracking branch 'upstream/main' into silimate 2026-06-09 16:22:51 +03:00
rmports.cc Remove .c_str() calls from log()/log_error() 2025-09-11 20:59:37 +00:00
share.cc Refactored uses of log_id() 2026-05-08 20:59:24 -07:00
wreduce.cc Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00