misc: better support for soft halos#9837
misc: better support for soft halos#9837openroad-ci wants to merge 15 commits intoThe-OpenROAD-Project:masterfrom
Conversation
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
Signed-off-by: João Mai <jmai@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request introduces support for soft halos for instances, a feature that is now reflected across various parts of the OpenROAD flow. The changes correctly modify ODB to store a soft flag for halos, update the DEF parser and writer to handle the SOFT keyword, and adjust tools like CTS, GPL, and PDN to respect hard vs. soft halos as per their requirements. The logic seems sound and consistent across all modified components. Additionally, a bug fix for orientation handling in mpl is included. I have one suggestion for a minor performance and style improvement in src/odb/src/zutil/util.cpp.
| if (blockage->getOwnerType() == odb::dbBoxOwner::INST) { | ||
| halo = static_cast<odb::dbInst*>(blockage->getBoxOwner())->getHalo(); | ||
| transformed_halo = static_cast<odb::dbInst*>(blockage->getBoxOwner()) | ||
| ->getTransformedHalo(); | ||
| } |
There was a problem hiding this comment.
This block of code has a couple of minor inefficiencies:
static_cast<odb::dbInst*>(blockage->getBoxOwner())is performed twice.getTransformedHalo()is called even if the halo is null or soft. This call is unnecessary in those cases.
Consider refactoring to store the instance pointer and only call getTransformedHalo() when it's confirmed to be a hard halo. Note that for dbBoxOwner::INST, getBoxOwner() is guaranteed to return a valid instance.
| if (blockage->getOwnerType() == odb::dbBoxOwner::INST) { | |
| halo = static_cast<odb::dbInst*>(blockage->getBoxOwner())->getHalo(); | |
| transformed_halo = static_cast<odb::dbInst*>(blockage->getBoxOwner()) | |
| ->getTransformedHalo(); | |
| } | |
| if (blockage->getOwnerType() == odb::dbBoxOwner::INST) { | |
| auto* inst = static_cast<odb::dbInst*>(blockage->getBoxOwner()); | |
| halo = inst->getHalo(); | |
| if (halo != nullptr && !halo->isSoft()) { | |
| transformed_halo = inst->getTransformedHalo(); | |
| } | |
| } |
References
- A
dbBoxwith owner typedbBoxOwner::INSTwill always have a valid owner instance;getBoxOwner()will not return null.
|
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: João Mai <jmai@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
| { | ||
| dbBoxOwner::Value owner_type : 4; | ||
| uint32_t visited : 1; | ||
| uint32_t soft : 1; |
There was a problem hiding this comment.
is this a safe change for the DB? or should this require a version bump?
There was a problem hiding this comment.
The visited flag is unused, so I think it is safe.
|
|
||
| odb::Rect inst_box = inst->getBBox()->getBox(); | ||
| if (halo != nullptr && !halo->isSoft()) { | ||
| odb::Rect halo_box = inst->getTransformedHalo(); |
There was a problem hiding this comment.
somethings off about this.
What is actually stored in the halo_? It was the deltaX, and deltaY of the instance (ie. the halo), but looking at the getTransformedHalo that seems to be doing something completely different
There was a problem hiding this comment.
halo_ stores the values of left, bottom, right and top spacing as positive values in xMin, yMin, xMax and yMax respectively. getTransformedHalo returns the halo re-oriented considering the instance orientation.
| odb::Rect halobox = inst->getTransformedHalo(); | ||
| Rect instbox = inst->getBBox()->getBox(); |
| switch (getOrientation().getValue()) { | ||
| case odb::dbOrientType::Value::R180: | ||
| case odb::dbOrientType::Value::MX: | ||
| case odb::dbOrientType::Value::MY: |
There was a problem hiding this comment.
It would have been good to include this bug fix in the description as well.
This PR adds support for DEF soft halos across OpenROAD.