- Notifications
You must be signed in to change notification settings - Fork 844
misc: better support for soft halos and bugfix in getRealLocation #9837
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?
Changes from all commits
e60d363 2b95439 b61faf3 c3149f7 79eccff e9a8d36 eaa4bbc 8e74559 2c31283 0dea6b8 8f941d4 7bae9e2 6c9fd47 e2771bb 38ea719 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -807,7 +807,7 @@ int HardMacro::getRealX() const | |
| { | ||
| switch (getOrientation().getValue()) { | ||
| case odb::dbOrientType::Value::R180: | ||
| case odb::dbOrientType::Value::MX: | ||
| case odb::dbOrientType::Value::MY: | ||
| Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would have been good to include this bug fix in the description as well. Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did it so early in development that ended up forgetting about it. Can't change the description unfortunately. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what would you like it to be? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something along the lines of "Also includes a small bugfix in | ||
| return x_ + halo_.right; | ||
| default: | ||
| return x_ + halo_.left; | ||
| | @@ -818,7 +818,7 @@ int HardMacro::getRealY() const | |
| { | ||
| switch (getOrientation().getValue()) { | ||
| case odb::dbOrientType::Value::R180: | ||
| case odb::dbOrientType::Value::MY: | ||
| case odb::dbOrientType::Value::MX: | ||
| return y_ + halo_.top; | ||
| default: | ||
| return y_ + halo_.bottom; | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -47,7 +47,7 @@ struct _dbBoxFlagsWithoutMask | |
| struct _dbBoxFlags | ||
| { | ||
| dbBoxOwner::Value owner_type : 4; | ||
| uint32_t visited : 1; | ||
| uint32_t soft : 1; | ||
| Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this a safe change for the DB? or should this require a version bump? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The visited flag is unused, so I think it is safe. | ||
| uint32_t octilinear : 1; | ||
| uint32_t is_tech_via : 1; | ||
| uint32_t is_block_via : 1; | ||
| | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| | @@ -76,9 +76,11 @@ static void cutRow(dbBlock* block, | |||||||||||||||||||||||||
| odb::dbInst* inst | ||||||||||||||||||||||||||
| = static_cast<odb::dbInst*>(row_blockage_bbox->getBoxOwner()); | ||||||||||||||||||||||||||
| odb::dbBox* halo = inst->getHalo(); | ||||||||||||||||||||||||||
| if (halo != nullptr) { | ||||||||||||||||||||||||||
| row_blockage_xs.emplace_back(row_blockage_bbox->xMin() - halo->xMin(), | ||||||||||||||||||||||||||
| row_blockage_bbox->xMax() + halo->xMax()); | ||||||||||||||||||||||||||
| if (halo != nullptr && !halo->isSoft()) { | ||||||||||||||||||||||||||
| Rect halo_rect = inst->getTransformedHalo(); | ||||||||||||||||||||||||||
| row_blockage_xs.emplace_back( | ||||||||||||||||||||||||||
| row_blockage_bbox->xMin() - halo_rect.xMin(), | ||||||||||||||||||||||||||
| row_blockage_bbox->xMax() + halo_rect.xMax()); | ||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||
| row_blockage_xs.emplace_back(row_blockage_bbox->xMin() - halo_x, | ||||||||||||||||||||||||||
| row_blockage_bbox->xMax() + halo_x); | ||||||||||||||||||||||||||
| | @@ -131,15 +133,22 @@ static bool overlaps(dbBox* blockage, dbRow* row, int halo_x, int halo_y) | |||||||||||||||||||||||||
| const Rect rowBB = row->getBBox(); | ||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||
| odb::dbBox* halo = nullptr; | ||||||||||||||||||||||||||
| odb::Rect transformed_halo; | ||||||||||||||||||||||||||
| if (blockage->getOwnerType() == odb::dbBoxOwner::INST) { | ||||||||||||||||||||||||||
| halo = static_cast<odb::dbInst*>(blockage->getBoxOwner())->getHalo(); | ||||||||||||||||||||||||||
| transformed_halo = static_cast<odb::dbInst*>(blockage->getBoxOwner()) | ||||||||||||||||||||||||||
| ->getTransformedHalo(); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| Comment on lines 137 to 141 Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block of code has a couple of minor inefficiencies:
Consider refactoring to store the instance pointer and only call Suggested change
References
| ||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||
| // Check if Y has overlap first since rows are long and skinny | ||||||||||||||||||||||||||
| const int blockage_lly | ||||||||||||||||||||||||||
| = blockage->yMin() - (halo != nullptr ? halo->yMin() : halo_y); | ||||||||||||||||||||||||||
| = blockage->yMin() | ||||||||||||||||||||||||||
| - (halo != nullptr && !halo->isSoft() ? transformed_halo.yMin() | ||||||||||||||||||||||||||
| : halo_y); | ||||||||||||||||||||||||||
| const int blockage_ury | ||||||||||||||||||||||||||
| = blockage->yMax() + (halo != nullptr ? halo->yMax() : halo_y); | ||||||||||||||||||||||||||
| = blockage->yMax() | ||||||||||||||||||||||||||
| + (halo != nullptr && !halo->isSoft() ? transformed_halo.yMax() | ||||||||||||||||||||||||||
| : halo_y); | ||||||||||||||||||||||||||
| const int row_lly = rowBB.yMin(); | ||||||||||||||||||||||||||
| const int row_ury = rowBB.yMax(); | ||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||
| | @@ -148,9 +157,13 @@ static bool overlaps(dbBox* blockage, dbRow* row, int halo_x, int halo_y) | |||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||
| const int blockage_llx | ||||||||||||||||||||||||||
| = blockage->xMin() - (halo != nullptr ? halo->xMin() : halo_x); | ||||||||||||||||||||||||||
| = blockage->xMin() | ||||||||||||||||||||||||||
| - (halo != nullptr && !halo->isSoft() ? transformed_halo.xMin() | ||||||||||||||||||||||||||
| : halo_x); | ||||||||||||||||||||||||||
| const int blockage_urx | ||||||||||||||||||||||||||
| = blockage->xMax() + (halo != nullptr ? halo->xMax() : halo_x); | ||||||||||||||||||||||||||
| = blockage->xMax() | ||||||||||||||||||||||||||
| + (halo != nullptr && !halo->isSoft() ? transformed_halo.xMax() | ||||||||||||||||||||||||||
| : halo_x); | ||||||||||||||||||||||||||
| const int row_llx = rowBB.xMin(); | ||||||||||||||||||||||||||
| const int row_urx = rowBB.xMax(); | ||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -1407,16 +1407,12 @@ InstanceGrid::InstanceGrid( | |
| : Grid(domain, name, start_with_power, generate_obstructions), inst_(inst) | ||
| { | ||
| auto* halo = inst->getHalo(); | ||
| if (halo != nullptr) { | ||
| odb::Rect halo_box = halo->getBox(); | ||
| | ||
| odb::Rect inst_box = inst->getBBox()->getBox(); | ||
| if (halo != nullptr && !halo->isSoft()) { | ||
| odb::Rect halo_box = inst->getTransformedHalo(); | ||
| Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. somethings off about this. Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. | ||
| | ||
| // copy halo from db | ||
| addHalo({halo_box.xMin() - inst_box.xMin(), | ||
| halo_box.yMin() - inst_box.yMin(), | ||
| inst_box.xMin() - halo_box.xMax(), | ||
| inst_box.yMin() - halo_box.yMax()}); | ||
| addHalo( | ||
| {halo_box.xMin(), halo_box.yMin(), halo_box.xMax(), halo_box.yMax()}); | ||
| } | ||
| } | ||
| | ||
| | ||
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.
Why removing the check?
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.
Before it would draw the hatched region only when the halo had a macro, even tough the macro itself is blocking the region. I think it is more consistent to always draw the blocked region.
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.
Agreed!