3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-01-17 07:56:26 +00:00

Refine width check to allow Y_WIDTH >= natural width

Change from equality check to >= to allow cells where output
is wider than natural width (zero-extended). Only reject cells
with Y_WIDTH < natural width (truncated).

This fixes test failures while still preventing the truncation
issue identified in widlarizer's feedback.
This commit is contained in:
Natalia 2026-01-14 14:58:53 -08:00
parent 60ac3670cb
commit 305b6c81d7

View file

@ -59,8 +59,9 @@ struct OptBalanceTreeWorker {
natural_width = std::max(a_width, b_width);
}
// Only allow cells where Y_WIDTH equals the natural width (no truncation)
return y_width == natural_width;
// Only allow cells where Y_WIDTH >= natural width (no truncation)
// This prevents rebalancing chains where truncation semantics matter
return y_width >= natural_width;
}
// Create a balanced binary tree from a vector of source signals