synth_gatemate: add -noconstmult option #5272
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the reasons/motivation for this change?
With the CC_MULT instantiation in nextpnr implemented, it was noticed by some testers that design area increased. For at least one design, this is because multiplication by a constant with a low number of 1 bits was mapped to a CC_MULT, so many of the multiplier columns were redundant. In this context, it seems like a reasonable idea to map variable-by-variable multiplication to CC_MULT, but let Yosys handle variable-by-constant multiplication (presumably through shift-and-add).
Explain how this is achieved.
When
-noconstmult
is enabled and we detect constant bits on either side, we fall back to letting Yosys handle the multiplication. This is an incredibly rough heuristic, but it's still a finer grain than all-or-nothing.If applicable, please suggest to reviewers how they can test the change.
Compare area usage between full inference (the default),
-noconstmult
and-nomult
on a design.Here's 108-litex-linux with full inference:
with
-noconstmult
:with
-nomult
cc @pu-cc