-
Notifications
You must be signed in to change notification settings - Fork 404
[Synth] Refactor and improve cut rewriter infrastructure #8909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit refactors the cut rewriter and implements correct priority sort. Previously `depth` of a cut represents a logic depth *within* a cut but this is not correct. What the original paper (ICCAD 2007) proposed was to use arrival time of cut outputs instead. For tha this commit changes to perform cut matchings for each cut, and use worst arrival time as a priority of cuts. LUT6 depth for 16-bit multiplexier improved from 17 to 7, which is on per with Yosys/ABC.
72a193c to
08c4d99
Compare
cowardsa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - only comment on slightly improving documentation for heuristics chosen - perhaps this could also be reflected in dialect or synthesis documentation to make it clear what features are implemented and where the ideas come from?
| compareDelayAndArea(options.strategy, currentMatch->getArea(), | ||
| currentMatch->getArrivalTimes(), | ||
| bestCut->getMatchedPattern()->getArea(), | ||
| bestCut->getMatchedPattern()->getArrivalTimes())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the sorting criteria used above identical to the compareDelayAndArea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point! I modified the sorting function to use compareDelayAndArea, and change the second loop just to return the first matched one.
| auto resultNumber = cast<mlir::OpResult>(input); | ||
| inputArrivalTimes.push_back( | ||
| matchedPattern->getArrivalTime(resultNumber.getResultNumber())); | ||
| matchedPattern.getArrivalTime(resultNumber.getResultNumber())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: mixture of result and input is a bit confusing here?
80981ee to
79ae9d7
Compare
79ae9d7 to
a242f39
Compare
Great point, I'll write down a rational document for Synth dialect and cut rewriter in a follow up. |
This commit refactors the cut rewriter and implements correct priority sort metric for depth. Previously
depthof a cut represents a logic depth within a cut but this is not correct. What the original paper (ICCAD 2007) proposed was to use arrival time of cut outputs instead.For that this commit changes to perform cut matching for each cut, and use worst arrival time as a priority of cuts.
LUT6 depth for 16-bit multiplier improved from 17 to 7, which is on per with Yosys/ABC.