[Synth] Add SOP balancing pass for delay optimization#9511
Merged
Conversation
This commit introduces a new pass, SOPBalancing, in the Synth dialect to perform delay optimization by restructuring And-Inverter Graphs (AIGs) through sum-of-products (SOP) balancing. The implementation is based on the algorithm described in "Delay Optimization Using SOP Balancing" by Mishchenko et al. (ICCAD 2011), which derives ISOP representations for cuts, balances SOP expressions to minimize critical path delay, and selects optimal cuts based on delay-area trade-offs. Specifically, the changes add the getInputArrivalTimes method to the Cut class for computing input delays, define the SOPBalancing pass with configurable options such as the maximum cut input size, integrate the pass into the synthesis optimization pipeline with a disable option, add the command-line flag --enable-sop-balancing to the circt-synth tool as an opt-in pass. The pass uses cut-based rewriting and is disabled by default for conservative adoption.
7cf8b26 to
fc4498e
Compare
fabianschuiki
approved these changes
Jan 26, 2026
Contributor
fabianschuiki
left a comment
There was a problem hiding this comment.
LGTM! Really cool that circt-synth is growing some delay optimizations 🥳
| // | ||
| // First, determine which variables are actually used in the SOP by | ||
| // collecting a bitmask from all cubes. | ||
| uint64_t mask = 0; |
Contributor
There was a problem hiding this comment.
Is the cube mask guaranteed to fit within 64 bits?
Member
Author
There was a problem hiding this comment.
Realistically yes because truth tables grow exponentially (2^n entries for n variables), so practical limits are much lower than 64. I'll add a check in CutRewriter in a follow-up.
| // COMMON-NEXT: Found 168 paths | ||
| // COMMON-NEXT: Found 32 unique end points | ||
| // AIG-NEXT: Maximum path delay: 32 | ||
| // AIG-NEXT: Maximum path delay: 27 |
Arya-Golkari
pushed a commit
to Arya-Golkari/circt
that referenced
this pull request
Feb 7, 2026
This commit introduces a new pass, SOPBalancing, in the Synth dialect to perform delay optimization by restructuring And-Inverter Graphs (AIGs) through sum-of-products (SOP) balancing. The implementation is based on the algorithm described in "Delay Optimization Using SOP Balancing" by Mishchenko et al. (ICCAD 2011), which derives ISOP representations for cuts, balances SOP expressions to minimize critical path delay, and selects optimal cuts based on delay-area trade-offs. Specifically, the changes add the getInputArrivalTimes method to the Cut class for computing input delays, define the SOPBalancing pass with configurable options such as the maximum cut input size, integrate the pass into the synthesis optimization pipeline with a disable option, add the command-line flag --enable-sop-balancing to the circt-synth tool as an opt-in pass. The pass uses cut-based rewriting and is disabled by default for conservative adoption.
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.
This commit introduces a new pass, SOPBalancing, in the Synth dialect to perform delay optimization by restructuring And-Inverter Graphs (AIGs) through sum-of-products (SOP) balancing. The implementation is based on the algorithm described in "Delay Optimization Using SOP Balancing" by Mishchenko et al. (ICCAD 2011), which derives ISOP representations for cuts, balances SOP expressions to minimize critical path delay, and selects optimal cuts based on delay-area trade-offs.
The pass uses cut-based rewriting and is disabled by default for now. There are several improvements necessary for CutRewriter framework to make it practical.