-
Notifications
You must be signed in to change notification settings - Fork 80
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
Eliminate double inverts in pyrtl.optimize #462
base: development
Are you sure you want to change the base?
Eliminate double inverts in pyrtl.optimize #462
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## development #462 +/- ##
=============================================
+ Coverage 91.7% 91.8% +0.2%
=============================================
Files 24 24
Lines 6403 6454 +51
=============================================
+ Hits 5866 5920 +54
+ Misses 537 534 -3 ☔ View full report in Codecov by Sentry. |
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.
Thank you for fixing this issue! A couple high-level comments before we get into coding details:
- O(N^2) nested
for
loops overblock.logic
should generally be avoided in passes because they don't scale well as the number of nets increases - the pass will take too long to run. It seems possible to iterate overblock.logic
once and build a list of all the inverter chains in the block (see how other passes create a_ProducerList
for example). Then I think we can iterate over that list and decide if each inverter chain can be simplified? - This really needs a test :) Some test cases that come to mind:
- Chains of 1, 2, 3, and 4 inverters (even numbers of inverters should be removed, and odd numbers of inverters should be simplified to one inverter)
- A chain of 2 inverters with another user of the first inverter's output (should not be simplified)
3ab98c5
to
6e872b3
Compare
All addressed |
Closes #447
Example: