3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 19:55:41 +00:00
yosys/passes
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
..
cmds stat bugfix 2026-06-28 20:28:23 -07:00
equiv Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
fsm Migrate build system to CMake 2026-06-03 08:58:10 +00:00
hierarchy Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
memory Merge remote-tracking branch 'upstream' into merge3 2026-06-25 04:51:46 -07:00
opt opt_prienc: require ConstEval fingerprint inputs to be a valid cut 2026-07-07 00:00:24 -07:00
pmgen Migrate build system to CMake 2026-06-03 08:58:10 +00:00
proc End of file fix 2026-06-23 07:23:41 +02:00
sat Allow sim pass to handle 4-input gates 2026-07-06 07:41:08 -07:00
silimate carvenetlist: keep cone boundary gate; address review comments 2026-07-06 09:13:18 -07:00
techmap Naming improvements 2026-07-06 07:40:14 -07:00
tests End of file fix 2026-06-23 07:23:41 +02:00
CMakeLists.txt CMake: integrate silimate additions and extensions 2026-06-10 20:27:52 +03:00