Skip to content

Commit f734be7

Browse files
committed
mpl:
1. Cache actual offset die area instead of just the half perimeter and use the cached die to compute the max dist for max cost. 2. Some renaming. Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
1 parent 701ca9e commit f734be7

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/mpl/src/SimulatedAnnealingCore.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,18 @@ SimulatedAnnealingCore<T>::SimulatedAnnealingCore(PhysicalHierarchy* tree,
8484
logger_ = logger;
8585
macros_ = macros;
8686

87-
die_hpwl_ = tree->die_area.getPerimeter() / 2;
87+
setDieArea(tree->die_area);
8888
setAvailableRegionForPins(tree->available_regions_for_pins);
8989
}
9090

91+
template <class T>
92+
void SimulatedAnnealingCore<T>::setDieArea(const Rect& die_area)
93+
{
94+
die_area_ = die_area;
95+
die_area_.moveHor(-outline_.xMin());
96+
die_area_.moveVer(-outline_.yMin());
97+
}
98+
9199
template <class T>
92100
void SimulatedAnnealingCore<T>::setAvailableRegionForPins(
93101
const std::vector<mpl::Rect>& regions)
@@ -319,8 +327,11 @@ void SimulatedAnnealingCore<T>::addClosestAvailableRegionDistToWL(
319327
const T& macro,
320328
const float net_weight)
321329
{
330+
// To generate maximum cost.
331+
const float max_dist = die_area_.getPerimeter() / 2;
332+
322333
if (isOutsideTheOutline(macro)) {
323-
wirelength_ += net_weight * die_hpwl_;
334+
wirelength_ += net_weight * max_dist;
324335
return;
325336
}
326337

src/mpl/src/SimulatedAnnealingCore.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class SimulatedAnnealingCore
127127

128128
void setAvailableRegionForPins(const std::vector<mpl::Rect>& regions);
129129
void initSequencePair();
130+
void setDieArea(const Rect& die_area);
130131
void updateBestValidResult();
131132
void useBestValidResult();
132133

@@ -163,8 +164,9 @@ class SimulatedAnnealingCore
163164
void report(const PenaltyData& penalty) const;
164165

165166
Rect outline_;
167+
Rect die_area_; // Offset to the current outline.
168+
166169
std::vector<Rect> available_regions_for_pins_;
167-
float die_hpwl_;
168170

169171
// Number of macros that will actually be part of the sequence pair
170172
int macros_to_place_ = 0;

0 commit comments

Comments
 (0)