[Synth] Add SAT-based exact synthesis pass#10493
Open
uenoku wants to merge 1 commit into
Open
Conversation
Add `synth-exact-synthesis`, which rewrites small single-bit `comb.truth_table` ops into area-optimal synth dialect operations. The pass searches increasing node counts and, for each size, builds a SAT problem where each ordered step selects one allowed primitive fed by constants, inputs, or earlier steps. Depth-optimal exact synthesis or symetric breaking would be future enhancement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
synth-exact-synthesis, which rewrites small single-bitcomb.truth_tableops into area-optimal synth dialect operations with BooleanLogicOpInterface.The pass searches increasing node counts and, for each size, builds a SAT problem where each ordered step selects one allowed primitive fed by constants, inputs, or earlier steps.
Exact synthesis is really expensive that cannot be used in online. Instead this pass will be used in offline in order to popuatle database for good cut structures (which will be used by CutRewriter pass).
Depth-optimal exact synthesis and better symmetric breaking would be future enhancement.
Tests are currently weak since it's challenging to verify the area optimality. Running exact synthesis for onehot/dot on 222 NPN took 3 minutes locally (32 threads). We could create a CI(or circt-tests like post-merge tests in another repo).
I checked a few operations dot/onehot and verified the number matches with TABLE IV in https://si2.epfl.ch/~demichel/publications/archive/2021/3Input.pdf.
Assisted-by: codex: gpt-5.5