@@ -1080,7 +1080,7 @@ void TritonCTS::findLongEdges(
10801080{
10811081 double maxWlMicrons
10821082 = resizer_->findMaxWireLength (/* don't issue error */ false ) * 1e+6 ;
1083- int threshold = block_->micronsToDbu (maxWlMicrons);
1083+ const int threshold = block_->micronsToDbu (maxWlMicrons);
10841084 debugPrint (
10851085 logger_, CTS, " clock gate cloning" , 1 , " Threshold = {}" , threshold);
10861086
@@ -1097,9 +1097,9 @@ void TritonCTS::findLongEdges(
10971097
10981098 odb::Point neighborPt = {neighbor->x , neighbor->y };
10991099 int64_t dist = odb::Point::manhattanDistance (branchPt, neighborPt);
1100- int clusterFrom
1100+ const int clusterFrom
11011101 = iterm2cluster.find (b) == iterm2cluster.end () ? -1 : iterm2cluster[b];
1102- int clusterTo = iterm2cluster.find (branch.n ) == iterm2cluster.end ()
1102+ const int clusterTo = iterm2cluster.find (branch.n ) == iterm2cluster.end ()
11031103 ? -1
11041104 : iterm2cluster[branch.n ];
11051105
@@ -1153,7 +1153,7 @@ void TritonCTS::findLongEdges(
11531153 }
11541154 }
11551155
1156- // Find closest cluster to orifginal ICG
1156+ // Find closest cluster to original ICG
11571157 int driverClusterID = -1 ;
11581158 int64_t minDist2Driver = std::numeric_limits<int64_t >::max ();
11591159 int validClusters = 0 ;
@@ -1196,9 +1196,9 @@ void TritonCTS::findLongEdges(
11961196 " Found {} clusters" ,
11971197 validClusters);
11981198
1199- // Insert original ICG to its closest cluster, create a clone to drive the
1199+ // Insert original ICG to its closest cluster, create clones to drive the
12001200 // other clusters
1201- int count = 0 ;
1201+ int nClones = 0 ;
12021202 // hierarchy fix, make the clone net in the right scope
12031203 sta::Pin* driver = nullptr ;
12041204 odb::dbModule* module
@@ -1240,9 +1240,9 @@ void TritonCTS::findLongEdges(
12401240 cloneNet->getName ());
12411241 } else {
12421242 // Create the ICG clone
1243- // Creat a new input net
1243+ // Create a new input net
12441244 std::string newNetName
1245- = " clonenet_" + std::to_string (++count ) + " _" + icgNet->getName ();
1245+ = " clonenet_" + std::to_string (++nClones ) + " _" + icgNet->getName ();
12461246
12471247 cloneNet = network_->staToDb (network_->makeNet (
12481248 newNetName.c_str (), scope, odb::dbNameUniquifyType::IF_NEEDED));
@@ -1251,18 +1251,16 @@ void TritonCTS::findLongEdges(
12511251
12521252 staClockNets_.insert (cloneNet);
12531253
1254- // create a new delay buffer
1255- std::string newBufName = " clone_" + std::to_string (count ) + " _" + icgName;
1254+ // Create a new clone instance
1255+ std::string newBufName = " clone_" + std::to_string (nClones ) + " _" + icgName;
12561256 odb::dbMaster* master = icgTerm->getInst ()->getMaster ();
12571257
12581258 // fix: make buffer in same hierarchical module as driver
1259-
12601259 clone = odb::dbInst::create (
12611260 block_, master, newBufName.c_str (), false , module );
12621261
12631262 clone->setSourceType (odb::dbSourceType::TIMING);
12641263
1265- // Connect clone isnt to same inputs as parent and new output net
12661264 debugPrint (logger_,
12671265 CTS,
12681266 " clock gate cloning" ,
@@ -1276,6 +1274,8 @@ void TritonCTS::findLongEdges(
12761274 2 ,
12771275 " New clone net {}" ,
12781276 cloneNet->getName ());
1277+
1278+ // Connect clone pins to same input nets as parent and new output net
12791279 for (odb::dbITerm* iterm : clone->getITerms ()) {
12801280 if (iterm->isInputSignal ()) {
12811281 odb::dbITerm* parentITerm = icgTerm->getInst ()->findITerm (
@@ -1331,7 +1331,7 @@ void TritonCTS::findLongEdges(
13311331 clone->setLocation (sinksBbox.xCenter (), sinksBbox.yCenter ());
13321332 clone->setPlacementStatus (odb::dbPlacementStatus::PLACED);
13331333 }
1334- debugPrint (logger_, CTS, " clock gate cloning" , 1 , " Created {} clones" , count );
1334+ debugPrint (logger_, CTS, " clock gate cloning" , 1 , " Created {} clones" , nClones );
13351335}
13361336
13371337void TritonCTS::populateTritonCTS ()
0 commit comments