-
Notifications
You must be signed in to change notification settings - Fork 769
dpl: add LEF symmetry to dpl and dpo #9274
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: rafaelmoresco <[email protected]>
Signed-off-by: rafaelmoresco <[email protected]>
Signed-off-by: rafaelmoresco <[email protected]>
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.
Code Review
This pull request introduces LEF symmetry checks in DPL and DPO, which is a valuable addition. The implementation is mostly correct, but there are several instances of code duplication that should be addressed to improve maintainability. I've provided suggestions to refactor the duplicated logic into helper functions and to simplify some of the new checks. Addressing these points will make the code cleaner and more robust.
| auto* dbMaster = ndi->getDbInst()->getMaster(); | ||
| unsigned masterSym = 0; | ||
| if (dbMaster->getSymmetryX()) { | ||
| masterSym |= Symmetry_X; | ||
| } | ||
| if (dbMaster->getSymmetryY()) { | ||
| masterSym |= Symmetry_Y; | ||
| } | ||
| if (dbMaster->getSymmetryR90()) { | ||
| masterSym |= Symmetry_ROT90; | ||
| } |
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.
This logic to calculate masterSym is duplicated in Place.cpp, detailed_manager.cxx, and twice in this file. To improve maintainability and reduce code duplication, you should extract this into a new static helper function within the DetailedOrient class.
For example, you could add the following to detailed_orient.h:
static unsigned getMasterSymmetry(odb::dbMaster* master);And implement it in detailed_orient.cxx:
unsigned DetailedOrient::getMasterSymmetry(odb::dbMaster* master)
{
unsigned masterSym = 0;
if (master->getSymmetryX()) {
masterSym |= Symmetry_X;
}
if (master->getSymmetryY()) {
masterSym |= Symmetry_Y;
}
if (master->getSymmetryR90()) {
masterSym |= Symmetry_ROT90;
}
return masterSym;
}Then, you can replace this block and other occurrences with a call to this new helper function. For example:
- Here and in
orientSingleHeightCellForRow:unsigned masterSym = getMasterSymmetry(ndi->getDbInst()->getMaster()); - In
detailed_manager.cxx:unsigned masterSym = DetailedOrient::getMasterSymmetry(nd->getDbInst()->getMaster()); - In
Place.cpp:unsigned masterSym = dpl::DetailedOrient::getMasterSymmetry(cell->getDbInst()->getMaster());(you'll need to includeoptimization/detailed_orient.h).
auto* dbMaster = ndi->getDbInst()->getMaster();
unsigned masterSym = getMasterSymmetry(dbMaster);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.
clang-tidy made some suggestions
|
@maliberty is there any problem in using the DPO symmetry checker in DPL like gemini suggested? |
Signed-off-by: rafaelmoresco <[email protected]>
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.
clang-tidy made some suggestions
Signed-off-by: rafaelmoresco <[email protected]>
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Ready for review? |
Closes #9238
Current DPL and DPO ignore the allowed symmetries indicated in the LEF file.
Added symmetry checks for every movement attempt in DPL and DPO.