Skip to content
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

rmp: Adds DelayOptimization pass to remapper #6477

Merged
merged 6 commits into from
Jan 7, 2025

Conversation

QuantamHD
Copy link
Collaborator

Adds new pass based infrastructure to add new Abc optimization passes. The first delay based optimization is added here.

General intention is to build lots of interfaces that can be extended by both the public and private clients.

Adds new pass based infrastructure to add new Abc optimization
passes. The first delay based optimization is added here.

General intention is to build lots of interfaces that can be
extended by both the public and private clients.

Signed-off-by: Ethan Mahintorabi <[email protected]>
Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Ethan Mahintorabi <[email protected]>
Signed-off-by: Ethan Mahintorabi <[email protected]>
Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Ethan Mahintorabi <[email protected]>
Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

@gadfort
Copy link
Collaborator

gadfort commented Jan 7, 2025

How is this accessed? it looks like the only clients that could use this would be via CPP. There is no access via tcl or python

@@ -0,0 +1,8 @@
# For debugging optimizations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be committed? Likewise the sdc

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would find it helpful if they were committed, but I'll remove them if you feel strongly

src/rmp/test/cpp/TestAbc.cc Show resolved Hide resolved
src/rmp/src/delay_optimization_strategy.h Outdated Show resolved Hide resolved
#include "utl/deleter.h"

namespace abc {
extern Abc_Ntk_t* Abc_NtkMap(Abc_Ntk_t* pNtk,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not defined in an abc header than you can include?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's not, I can send a PR to ABC to fix that, but would rather not block this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't block it but it would be nice to fix this and the const issue in abc.

src/rmp/src/delay_optimization_strategy.cpp Outdated Show resolved Hide resolved
Comment on lines +98 to +100
utl::UniquePtrWithDeleter<abc::Abc_Ntk_t> current_network(
abc::Abc_NtkToLogic(const_cast<abc::Abc_Ntk_t*>(ntk)),
&abc::Abc_NtkDelete);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Abc_NtkToLogic return a new Abc_Ntk_t? If so it shouldn't require a non-const input.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abc_NtkToLogic and most ABC passes are const-able, but ABC never declares them as const. I set const on the Optimize input to at least let OpenROAD devs that the input network isn't modified. I can try to send a PR to make it const as well, but once again I don't think this should block the PR.

Signed-off-by: Ethan Mahintorabi <[email protected]>
Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Member

Please fix the DCO

@maliberty
Copy link
Member

Is this a progress step in part of larger plan? I shared Peter's confusion.

Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

@QuantamHD
Copy link
Collaborator Author

QuantamHD commented Jan 7, 2025

How is this accessed? it looks like the only clients that could use this would be via CPP. There is no access via tcl or python

Is this a progress step in part of larger plan? I shared Peter's confusion.

Short answer this isn't done yet. I'm breaking up the implementation into two different strategy classes LogicOptimizationStrategy, in this PR, and another abstract class yet to be written called ResynthesisStrategy which will be given LogicOptimizationStrategy classes probably through Factory classes.

ResynthesisStrategy will be responsible for identifying endpoints in the entire design that need optimization in either power, area or timing, and decide what should be turned into LogicCuts and if those LogicCuts should be optimized independently or should be merged and optimized together. Once you have your LogicCuts the ResynthesisStrategy will instantiate some LogicOptimizationStrategy class to perform whatever optimization its trying to do.

For the first implementation I'm planning on implementing a class called the ZeroSlackSynthesisStrategy that takes a DelayOptimizationStrategyFactory and a AreaOptimizationStrategyFactory that then attempts to drive all paths in the design to zero slack plus or minus some epsilon.

The ZeroSlackSynthesisStrategy is the thing that can be exposed via tcl or python. Ideally though it just ends up inside resizer and called implicitly in GPL

@gadfort @maliberty


Separately it seems like the DelayOptimizationClass can provide a lot of delay benefits. See below the worst endpoint in AES Nangate45 running at 1.5Ghz before and after optimization.

Before

image

After

image

@maliberty
Copy link
Member

@andyfox-rushc in case you have any comments from your experience in this area.

@maliberty maliberty enabled auto-merge January 7, 2025 22:16
@maliberty maliberty merged commit 0346f68 into The-OpenROAD-Project:master Jan 7, 2025
11 checks passed
@QuantamHD QuantamHD deleted the remapper5 branch January 7, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants