Skip to content

Commit 19acdf7

Browse files
committed
Merge branch 'master' of github.com:The-OpenROAD-Project-private/OpenROAD into grt-soft-ndr-nets
2 parents 0bde6fd + fc90fa2 commit 19acdf7

38 files changed

+2266
-89
lines changed

src/cgt/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ cc_library(
2626
"include/cgt/NetworkBuilder.h",
2727
"include/cgt/RandomBits.h",
2828
],
29+
defines = [
30+
"ABC_NAMESPACE=abc",
31+
],
2932
includes = [
3033
"include",
3134
],

src/cts/src/CtsOptions.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ void CtsOptions::inDbInstCreate(odb::dbInst* inst, odb::dbRegion* region)
2727
recordBuffer(inst->getMaster(), getType(inst));
2828
}
2929

30+
void CtsOptions::limitSinkClusteringSizes(unsigned limit)
31+
{
32+
if (sinkClustersSizeSet_) {
33+
setSinkClusteringSize(std::min(limit, sinkClustersSize_));
34+
return;
35+
}
36+
auto lowerBound = std::lower_bound(
37+
sinkClusteringSizes_.begin(), sinkClusteringSizes_.end(), limit);
38+
sinkClusteringSizes_.erase(lowerBound, sinkClusteringSizes_.end());
39+
sinkClusteringSizes_.push_back(limit);
40+
}
41+
3042
void CtsOptions::recordBuffer(odb::dbMaster* master, MasterType type)
3143
{
3244
switch (type) {

src/cts/src/CtsOptions.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ class CtsOptions : public odb::dbBlockCallBackObj
187187
maxDiameterSet_ = true;
188188
}
189189
bool isMaxDiameterSet() const { return maxDiameterSet_; }
190+
const std::vector<unsigned>& getSinkClusteringDiameters()
191+
{
192+
return sinkClusteringDiameters_;
193+
}
190194
unsigned getSinkClusteringSize() const { return sinkClustersSize_; }
191195
void setSinkClusteringSize(unsigned size)
192196
{
@@ -195,6 +199,11 @@ class CtsOptions : public odb::dbBlockCallBackObj
195199
sinkClustersSizeSet_ = true;
196200
}
197201
bool isSinkClusteringSizeSet() const { return sinkClustersSizeSet_; }
202+
const std::vector<unsigned>& getSinkClusteringSizes()
203+
{
204+
return sinkClusteringSizes_;
205+
}
206+
void limitSinkClusteringSizes(unsigned limit);
198207
unsigned getSinkClusteringLevels() const { return sinkClusteringLevels_; }
199208
void setSinkClusteringLevels(unsigned levels)
200209
{
@@ -311,8 +320,10 @@ class CtsOptions : public odb::dbBlockCallBackObj
311320
int sinks_ = 0;
312321
double maxDiameter_ = 50;
313322
bool maxDiameterSet_ = false;
323+
std::vector<unsigned> sinkClusteringDiameters_ = {50, 100, 200};
314324
unsigned sinkClustersSize_ = 20;
315325
bool sinkClustersSizeSet_ = false;
326+
std::vector<unsigned> sinkClusteringSizes_ = {10, 20, 30};
316327
double macroMaxDiameter_ = 50;
317328
bool macroMaxDiameterSet_ = false;
318329
unsigned macroSinkClustersSize_ = 4;

src/cts/src/HTreeBuilder.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ void HTreeBuilder::preSinkClustering(
3434
bool maxDiameterSet = (type_ == TreeType::MacroTree)
3535
? options_->isMacroMaxDiameterSet()
3636
: options_->isMaxDiameterSet();
37-
unsigned clusterSizeSet = (type_ == TreeType::MacroTree)
38-
? options_->isMacroSinkClusteringSizeSet()
39-
: options_->isSinkClusteringSizeSet();
37+
bool clusterSizeSet = (type_ == TreeType::MacroTree)
38+
? options_->isMacroSinkClusteringSizeSet()
39+
: options_->isSinkClusteringSizeSet();
4040

4141
unsigned min_clustering_sinks = (type_ == TreeType::MacroTree)
4242
? min_clustering_macro_sinks_
@@ -94,7 +94,7 @@ void HTreeBuilder::preSinkClustering(
9494
bestDiameter);
9595
} else if (!clusterSizeSet && maxDiameterSet) {
9696
// only diameter is set, try clustering sizes of 10, 20 and 30
97-
for (unsigned clusterSize2 : clusterSizes()) {
97+
for (unsigned clusterSize2 : options_->getSinkClusteringSizes()) {
9898
// clang-format off
9999
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
100100
clusterSize2, maxDiameter, wireSegmentUnit_);
@@ -107,7 +107,7 @@ void HTreeBuilder::preSinkClustering(
107107
}
108108
} else if (clusterSizeSet && !maxDiameterSet) {
109109
// only clustering size is set, try diameters of 50, 100 and 200 um
110-
for (unsigned clusterDiameter2 : clusterDiameters()) {
110+
for (unsigned clusterDiameter2 : options_->getSinkClusteringDiameters()) {
111111
// clang-format off
112112
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
113113
clusterSize, clusterDiameter2, wireSegmentUnit_);
@@ -124,7 +124,7 @@ void HTreeBuilder::preSinkClustering(
124124
// try diameters of 50, 100 and 200 um
125125
for (unsigned clusterDiameter2 : clusterDiameters()) {
126126
// try clustering sizes of 10, 20 and 30
127-
for (unsigned clusterSize2 : clusterSizes()) {
127+
for (unsigned clusterSize2 : options_->getSinkClusteringSizes()) {
128128
// clang-format off
129129
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
130130
clusterSize2, clusterDiameter2, wireSegmentUnit_);

src/cts/src/TritonCTS.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int TritonCTS::getBufferFanoutLimit(const std::string& bufferName)
178178
fanout = std::min(fanout, (int) tempFanout);
179179
}
180180
}
181-
return fanout;
181+
return fanout == std::numeric_limits<int>::max() ? 0 : fanout;
182182
}
183183

184184
void TritonCTS::setupCharacterization()
@@ -215,10 +215,7 @@ void TritonCTS::setupCharacterization()
215215
}
216216

217217
if (sinkMaxFanout) {
218-
if (options_->getSinkClusteringSize() > sinkMaxFanout) {
219-
options_->setSinkClusteringSize(sinkMaxFanout);
220-
}
221-
218+
options_->limitSinkClusteringSizes(sinkMaxFanout);
222219
if (sinkMaxFanout < options_->getMaxFanout()) {
223220
options_->setMaxFanout(sinkMaxFanout);
224221
}

src/cts/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ or_integration_tests(
2121
check_charBuf
2222
check_max_fanout1
2323
check_max_fanout2
24+
check_max_fanout3
2425
check_wire_rc_cts
2526
dummy_load
2627
find_clock

0 commit comments

Comments
 (0)