techmap: map $alu to $fa instead of relying on extract_fa #4997
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.
extract_fa
is used in ASIC flows to find full and half adder cells by extracting any matching logic. It has been suggested that a better approach is to use full/half adders only when emitted from actual arithmetic. In most synthesis flows, cells that use an adder-like structure (addition, subtraction, comparison) get converted to$alu
. For ASIC flows, they are then techmapped to a multi-bit$lcu
intechlibs/common/techmap.v
.$lcu
cells need propagate (P) and generate (G) inputs which have to be generated by half adders.Prior to this PR,
techmap.v
was generating these with explicit logic and relying onextract_fa
to discover that it's half adders. As of this PR, half adders are instantiated directly as$fa
cells with C inputs at constant 0. This is howextract_fa
implements half adders already, and for example ORFS uses this constant C=0 to map directly to half adders in the PDK.This PR is best evaluated in the context of an ASIC flow as-is or with
extract_fa
removed