Skip to content

Commit 17ee292

Browse files
committed
Merge remote-tracking branch 'private/master' into dpl-fix-getMasterPwrs
2 parents 276d8f2 + 49237b3 commit 17ee292

4 files changed

Lines changed: 272 additions & 269 deletions

File tree

src/drt/src/db/tech/frLayer.h

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
#pragma once
55

66
#include <algorithm>
7+
#include <functional>
78
#include <iostream>
89
#include <map>
910
#include <set>
1011
#include <string>
12+
#include <utility>
1113
#include <vector>
1214

1315
#include "db/infra/frSegStyle.h"
@@ -629,15 +631,53 @@ class frLayer
629631
}
630632
void addLef58AreaConstraint(frLef58AreaConstraint* in)
631633
{
632-
lef58AreaConstraints_.push_back(in);
634+
// This vector should be sorted by area in a descending order
635+
auto area = in->getODBRule()->getArea();
636+
auto it = std::ranges::lower_bound(lef58AreaConstraints_.begin(),
637+
lef58AreaConstraints_.end(),
638+
area,
639+
std::ranges::greater{},
640+
[](const frLef58AreaConstraint* a) {
641+
return a->getODBRule()->getArea();
642+
});
643+
lef58AreaConstraints_.insert(it, in);
633644
}
634645

635646
const std::vector<frLef58AreaConstraint*>& getLef58AreaConstraints() const
636647
{
637648
return lef58AreaConstraints_;
638649
}
639650

640-
bool hasLef58AreaConstraint() const { return !lef58AreaConstraints_.empty(); }
651+
bool hasLef58AreaConstraint() const
652+
{
653+
return !lef58AreaConstraints_.empty()
654+
|| !lef58AreaConstraintsRectWidth_.empty();
655+
}
656+
657+
void addLef58AreaConstraintRectWidth(frLef58AreaConstraint* in)
658+
{
659+
// This vector should be sorted by rectwidth in an ascending order,
660+
// tie-broken by area in an ascending order so that for equal rectwidth the
661+
// smallest area constraint takes preference
662+
auto rule = in->getODBRule();
663+
auto key = std::make_pair(rule->getRectWidth(), rule->getArea());
664+
auto it = std::ranges::lower_bound(lef58AreaConstraintsRectWidth_.begin(),
665+
lef58AreaConstraintsRectWidth_.end(),
666+
key,
667+
std::ranges::less{},
668+
[](const frLef58AreaConstraint* a) {
669+
return std::make_pair(
670+
a->getODBRule()->getRectWidth(),
671+
a->getODBRule()->getArea());
672+
});
673+
lef58AreaConstraintsRectWidth_.insert(it, in);
674+
}
675+
676+
const std::vector<frLef58AreaConstraint*>& getLef58AreaConstraintsRectWidth()
677+
const
678+
{
679+
return lef58AreaConstraintsRectWidth_;
680+
}
641681

642682
void addKeepOutZoneConstraint(frLef58KeepOutZoneConstraint* in)
643683
{
@@ -937,6 +977,7 @@ class frLayer
937977
std::vector<frLef58EolKeepOutConstraint*> lef58EolKeepOutConstraints_;
938978
std::vector<frMetalWidthViaConstraint*> metalWidthViaConstraints_;
939979
std::vector<frLef58AreaConstraint*> lef58AreaConstraints_;
980+
std::vector<frLef58AreaConstraint*> lef58AreaConstraintsRectWidth_;
940981
std::vector<frLef58KeepOutZoneConstraint*> keepOutZoneConstraints_;
941982
std::vector<frSpacingRangeConstraint*> spacingRangeConstraints_;
942983
std::vector<frLef58TwoWiresForbiddenSpcConstraint*>

src/drt/src/gc/FlexGC_impl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ class FlexGCWorker::Impl
539539
gcPolygon* poly,
540540
odb::dbTechLayerAreaRule* db_rule);
541541
bool checkMetalShape_lef58Area_rectWidth(gcPolygon* poly,
542-
odb::dbTechLayerAreaRule* db_rule,
543-
bool& check_rect_width);
542+
odb::dbTechLayerAreaRule* db_rule);
544543
void checkMetalShape_addPatch(gcPin* pin, int min_area);
545544
void checkMetalShape_patchOwner_helper(drPatchWire* patch,
546545
const std::vector<drNet*>* dr_nets);

0 commit comments

Comments
 (0)