Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e016184
cts: disable flag to cluster sinks based on buffer max cap
luis201420 Oct 28, 2025
26fa4d9
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Oct 28, 2025
adf7f6b
cts: restore flag to cluster sinks based on buffer max cap
luis201420 Oct 28, 2025
50580eb
cts: check the size and diameter of the cluster along with the buffer…
luis201420 Oct 28, 2025
fee9431
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Oct 29, 2025
fc819e3
cts: check the cluster diameter along with the buffer max cap
luis201420 Nov 4, 2025
b0ec02b
cts: use the defined diameters from options
luis201420 Nov 4, 2025
ecf7719
cts: use the row height to calculate the cluster diameters
luis201420 Nov 4, 2025
3e4c818
cts: remove print
luis201420 Nov 4, 2025
f31b5f2
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Nov 4, 2025
a440b1a
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Nov 11, 2025
4b19b7f
cts: remove the iterations to find the best cluster size and diameter
luis201420 Nov 12, 2025
f21fdad
cts: use a buffer max cap when only the cluster size or diameter is d…
luis201420 Nov 12, 2025
c0cf033
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Nov 12, 2025
efd6fcb
cts: fix bug in the constructor
luis201420 Nov 12, 2025
d5b19bc
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Nov 18, 2025
0d5fc3c
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Nov 19, 2025
8f2e44d
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Nov 21, 2025
c4f6ffb
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Nov 28, 2025
7f035e6
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Dec 1, 2025
52cab31
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Dec 2, 2025
b6a1152
cts: remove unnecessary code and restore master version
luis201420 Dec 2, 2025
f27a6d4
cts: remove unused variables and related functions
luis201420 Dec 2, 2025
54d2df3
cts: remove obsolete conditional cases
luis201420 Dec 2, 2025
a770a97
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Dec 2, 2025
d528a59
cts: define the cluster size directly when it is not user-defined
luis201420 Dec 3, 2025
9221bbc
Merge remote-tracking branch 'origin' into cts_improve_automatic_clus…
luis201420 Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/cts/src/CtsOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ void CtsOptions::limitSinkClusteringSizes(unsigned limit)
setSinkClusteringSize(std::min(limit, sinkClustersSize_));
return;
}
auto lowerBound = std::lower_bound(
sinkClusteringSizes_.begin(), sinkClusteringSizes_.end(), limit);
sinkClusteringSizes_.erase(lowerBound, sinkClusteringSizes_.end());
sinkClusteringSizes_.push_back(limit);
sinkClustersSize_ = limit;
}

void CtsOptions::recordBuffer(odb::dbMaster* master, MasterType type)
Expand Down
14 changes: 2 additions & 12 deletions src/cts/src/CtsOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ class CtsOptions : public odb::dbBlockCallBackObj
maxDiameterSet_ = false;
}
bool isMaxDiameterSet() const { return maxDiameterSet_; }
const std::vector<unsigned>& getSinkClusteringDiameters()
{
return sinkClusteringDiameters_;
}
unsigned getSinkClusteringSize() const { return sinkClustersSize_; }
void setSinkClusteringSize(unsigned size)
{
Expand All @@ -232,15 +228,11 @@ class CtsOptions : public odb::dbBlockCallBackObj
}
void resetSinkClusteringSize()
{
sinkClustersSize_ = 20;
sinkClustersSize_ = 30;
sinkClusteringUseMaxCap_ = true;
sinkClustersSizeSet_ = false;
}
bool isSinkClusteringSizeSet() const { return sinkClustersSizeSet_; }
const std::vector<unsigned>& getSinkClusteringSizes()
{
return sinkClusteringSizes_;
}
void limitSinkClusteringSizes(unsigned limit);
unsigned getSinkClusteringLevels() const { return sinkClusteringLevels_; }
void setSinkClusteringLevels(unsigned levels)
Expand Down Expand Up @@ -390,10 +382,8 @@ class CtsOptions : public odb::dbBlockCallBackObj
int sinks_ = 0;
double maxDiameter_ = 50;
bool maxDiameterSet_ = false;
std::vector<unsigned> sinkClusteringDiameters_ = {50, 100, 200};
unsigned sinkClustersSize_ = 20;
unsigned sinkClustersSize_ = 30;
bool sinkClustersSizeSet_ = false;
std::vector<unsigned> sinkClusteringSizes_ = {10, 20, 30};
double macroMaxDiameter_ = 50;
bool macroMaxDiameterSet_ = false;
unsigned macroSinkClustersSize_ = 4;
Expand Down
66 changes: 9 additions & 57 deletions src/cts/src/HTreeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,63 +80,15 @@ void HTreeBuilder::preSinkClustering(

unsigned bestClusterSize = 0;
float bestDiameter = 0.0;
if (clusterSizeSet && maxDiameterSet) {
// clang-format off
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
clusterSize, maxDiameter, wireSegmentUnit_);
// clang-format on
matching.run(clusterSize,
maxDiameter,
wireSegmentUnit_,
bestClusterSize,
bestDiameter);
} else if (!clusterSizeSet && maxDiameterSet) {
// only diameter is set, try clustering sizes of 10, 20 and 30
for (unsigned clusterSize2 : options_->getSinkClusteringSizes()) {
// clang-format off
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
clusterSize2, maxDiameter, wireSegmentUnit_);
// clang-format on
matching.run(clusterSize2,
maxDiameter,
wireSegmentUnit_,
bestClusterSize,
bestDiameter);
}
} else if (clusterSizeSet && !maxDiameterSet) {
// only clustering size is set, try diameters of 50, 100 and 200 um
for (unsigned clusterDiameter2 : options_->getSinkClusteringDiameters()) {
// clang-format off
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
clusterSize, clusterDiameter2, wireSegmentUnit_);
// clang-format on
float maxDiameter2 = clusterDiameter2 * (float) options_->getDbUnits()
/ wireSegmentUnit_;
matching.run(clusterSize,
maxDiameter2,
wireSegmentUnit_,
bestClusterSize,
bestDiameter);
}
} else { // neighther clustering size nor diameter is set
// try diameters of 50, 100 and 200 um
for (unsigned clusterDiameter2 : clusterDiameters()) {
// try clustering sizes of 10, 20 and 30
for (unsigned clusterSize2 : options_->getSinkClusteringSizes()) {
// clang-format off
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
clusterSize2, clusterDiameter2, wireSegmentUnit_);
// clang-format on
float maxDiameter2 = clusterDiameter2 * (float) options_->getDbUnits()
/ wireSegmentUnit_;
matching.run(clusterSize2,
maxDiameter2,
wireSegmentUnit_,
bestClusterSize,
bestDiameter);
}
}
}
// clang-format off
debugPrint(logger_, CTS, "clustering", 1, "**** match.run({}, {}, {}) ****",
clusterSize, maxDiameter, wireSegmentUnit_);
// clang-format on
matching.run(clusterSize,
maxDiameter,
wireSegmentUnit_,
bestClusterSize,
bestDiameter);

if (clusterSizeSet || maxDiameterSet) {
logger_->info(
Expand Down
20 changes: 18 additions & 2 deletions src/cts/src/SinkClustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ SinkClustering::SinkClustering(const CtsOptions* options,
techChar_(techChar),
maxInternalDiameter_(10),
capPerUnit_(0.0),
use_max_diameter_((HTree->getTreeType() == TreeType::MacroTree)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "cts::TreeType" is directly included [misc-include-cleaner]

src/cts/src/SinkClustering.cpp:14:

- #include "stt/SteinerTreeBuilder.h"
+ #include "TreeBuilder.h"
+ #include "stt/SteinerTreeBuilder.h"

? options->isMacroMaxDiameterSet()
: options->isMaxDiameterSet()),
use_max_size_((HTree->getTreeType() == TreeType::MacroTree)
? options->isMacroSinkClusteringSizeSet()
: options->isSinkClusteringSizeSet()),
useMaxCapLimit_((HTree->getTreeType() == TreeType::MacroTree)
? false
: options->getSinkClusteringUseMaxCap()),
: !(use_max_size_ && use_max_diameter_)),
scaleFactor_(1),
HTree_(HTree)
{
Expand Down Expand Up @@ -415,7 +421,17 @@ bool SinkClustering::isLimitExceeded(const unsigned size,
const unsigned sizeLimit)
{
if (useMaxCapLimit_) {
Copy link
Contributor

@arthurjolo arthurjolo Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this if statement can be a bit different now that we define when to use each of the limits.

suggestion:


bool is_limit_exceeded = false
if (useMaxCapLimit_) {
  is_limit_exceeded |= (capCost > options_->getSinkBufferInputCap() * max_cap__factor_);
// size is defined by the user
if (use_max_size_) {
  is_limit_exceeded |= (size >= sizeLimit);
}
// diameter is defined by the user
if (use_max_diameter_) {
  is_limit_exceeded |= (cost > maxInternalDiameter_);
}
return is_limit_exceeded;

like this we don't need to separate into 2 different cases useMaxCap and not useMaxCap

return (capCost > options_->getSinkBufferInputCap() * max_cap__factor_);
bool is_limit_exceeded
= (capCost > options_->getSinkBufferInputCap() * max_cap__factor_);
// size is defined by the user
if (use_max_size_) {
is_limit_exceeded |= (size >= sizeLimit);
}
// diameter is defined by the user
if (use_max_diameter_) {
is_limit_exceeded |= (cost > maxInternalDiameter_);
}
return is_limit_exceeded;
}

return (size >= sizeLimit || cost > maxInternalDiameter_);
Expand Down
2 changes: 2 additions & 0 deletions src/cts/src/SinkClustering.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ class SinkClustering
std::vector<std::vector<unsigned>> bestSolution_;
float maxInternalDiameter_;
float capPerUnit_;
bool use_max_diameter_;
bool use_max_size_;
bool useMaxCapLimit_;
int scaleFactor_;
static constexpr double max_cap__factor_ = 10;
Expand Down
Loading