Suboptimal default synthesis of $bmux
, $shiftx
#3893
Labels
pending-verification
This issue is pending verification and/or reproduction
$bmux
, $shiftx
#3893
Version
Yosys 0.31+45 (git sha1 7212397, clang 11.1.0 -fPIC -Os)
On which OS did this happen?
macOS
Reproduction Steps
Working on #3880 I noticed
$bmux
and$shiftx
are mapped onto gates suboptimally by the default synthesis script. The mapping does not make use of undef bits.Consider the following example, where we have instances of bmux and shiftx which we synthesize with
techmap; abc;
(modelling whatsynth
does, producing equivalent result here) and separately withtechmap; opt_expr -mux_undef; abc
.Expected Behavior
The default synthesis script makes full use of the undef bits for reduced gate count.
Actual Behavior
There's a gate count gap between what
techmap; abc;
(equivalent tosynth
here) andtechmap; opt_expr -mux_undef; abc;
produce. As far as I can tell ABC has no concept of undef bits, and when Yosys hands over the circuit it replaces all instances of undef bits with zero. With explicit insertion ofopt_expr -mux_undef
the undef bits are exploited to eliminate some of the muxes.The FPGA scripts I looked into (at least
synth_ice40
) don't seem to suffer from the same thing because they happen to callopt_expr -mux_undef
ahead ofabc
in themap_ffs
block.Output from the script above:
The text was updated successfully, but these errors were encountered: