Skip to content

Commit 1b0c816

Browse files
authored
Merge pull request #7472 from AcKoucher/mpl-dataflow-macro-placement
mpl: consider data flow connections during macro placement
2 parents f3b3955 + f71ed76 commit 1b0c816

File tree

5 files changed

+44
-31
lines changed

5 files changed

+44
-31
lines changed

src/mpl/src/clusterEngine.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ void ClusteringEngine::dataFlowDFSMacroPin(
860860
}
861861
}
862862

863-
void ClusteringEngine::updateDataFlow()
863+
void ClusteringEngine::buildDataFlowConnections()
864864
{
865865
if (data_connections_.is_empty) {
866866
return;
@@ -1542,7 +1542,8 @@ void ClusteringEngine::mergeChildrenBelowThresholds(
15421542

15431543
int num_small_children = static_cast<int>(small_children.size());
15441544
while (true) {
1545-
updateConnections(); // update the connections between clusters
1545+
clearConnections();
1546+
buildNetListConnections();
15461547

15471548
std::vector<int> cluster_class(num_small_children, -1); // merge flag
15481549
std::vector<int> small_children_ids; // store cluster id
@@ -1690,12 +1691,22 @@ bool ClusteringEngine::attemptMerge(Cluster* receiver, Cluster* incomer)
16901691
return false;
16911692
}
16921693

1693-
void ClusteringEngine::updateConnections()
1694+
void ClusteringEngine::rebuildConnections()
1695+
{
1696+
clearConnections();
1697+
buildNetListConnections();
1698+
buildDataFlowConnections();
1699+
}
1700+
1701+
void ClusteringEngine::clearConnections()
16941702
{
16951703
for (auto& [cluster_id, cluster] : tree_->maps.id_to_cluster) {
16961704
cluster->initConnection();
16971705
}
1706+
}
16981707

1708+
void ClusteringEngine::buildNetListConnections()
1709+
{
16991710
for (odb::dbNet* net : block_->getNets()) {
17001711
if (!isValidNet(net)) {
17011712
continue;
@@ -1826,7 +1837,8 @@ void ClusteringEngine::breakMixedLeaf(Cluster* mixed_leaf)
18261837
std::vector<Cluster*> macro_clusters;
18271838
createOneClusterForEachMacro(parent, hard_macros, macro_clusters);
18281839

1829-
updateConnections();
1840+
clearConnections();
1841+
buildNetListConnections();
18301842

18311843
const int number_of_macros = static_cast<int>(hard_macros.size());
18321844
std::vector<int> size_class(number_of_macros, -1);

src/mpl/src/clusterEngine.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ class ClusteringEngine
142142

143143
// Methods to update the tree as the hierarchical
144144
// macro placement runs.
145-
void updateConnections();
146-
void updateDataFlow();
145+
void rebuildConnections();
147146
void updateInstancesAssociation(Cluster* cluster);
148147
void updateInstancesAssociation(odb::dbModule* module,
149148
int cluster_id,
@@ -225,6 +224,10 @@ class ClusteringEngine
225224
void replaceByStdCellCluster(Cluster* mixed_leaf,
226225
std::vector<int>& virtual_conn_clusters);
227226

227+
void clearConnections();
228+
void buildNetListConnections();
229+
void buildDataFlowConnections();
230+
228231
// Methods for data flow
229232
void createDataFlow();
230233
bool stdCellsHaveLiberty();

src/mpl/src/hier_rtlmp.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,8 +1387,7 @@ void HierRTLMP::placeChildren(Cluster* parent)
13871387

13881388
createFixedTerminals(parent, soft_macro_id_map, macros);
13891389

1390-
clustering_engine_->updateConnections();
1391-
clustering_engine_->updateDataFlow();
1390+
clustering_engine_->rebuildConnections();
13921391

13931392
// add the virtual connections (the weight related to IOs and macros belong to
13941393
// the same cluster)
@@ -1790,8 +1789,7 @@ void HierRTLMP::placeChildrenUsingMinimumTargetUtil(Cluster* parent)
17901789

17911790
createFixedTerminals(parent, soft_macro_id_map, macros);
17921791

1793-
clustering_engine_->updateConnections();
1794-
clustering_engine_->updateDataFlow();
1792+
clustering_engine_->rebuildConnections();
17951793

17961794
// add the virtual connections (the weight related to IOs and macros belong to
17971795
// the same cluster)
@@ -2383,7 +2381,7 @@ void HierRTLMP::placeMacros(Cluster* cluster)
23832381
graphics_->setFences(fences);
23842382
}
23852383

2386-
clustering_engine_->updateConnections();
2384+
clustering_engine_->rebuildConnections();
23872385

23882386
createFixedTerminals(outline, macro_clusters, cluster_to_macro, sa_macros);
23892387

src/mpl/test/guides2.defok

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,16 @@ TRACKS Y 140 DO 282 STEP 3200 LAYER metal9 ;
339339
TRACKS X 190 DO 282 STEP 3200 LAYER metal10 ;
340340
TRACKS Y 140 DO 282 STEP 3200 LAYER metal10 ;
341341
COMPONENTS 10 ;
342-
- U1 HM_100x400_4x4 + FIXED ( 665880 16590 ) FN ;
343-
- U10 HM_100x100_1x1 + FIXED ( 17880 16550 ) FN ;
344-
- U2 HM_100x100_1x1 + FIXED ( 233880 664610 ) S ;
345-
- U3 HM_100x100_1x1 + FIXED ( 233880 232430 ) FN ;
346-
- U4 HM_100x100_1x1 + FIXED ( 17880 232430 ) FN ;
347-
- U5 HM_100x100_1x1 + FIXED ( 233880 16550 ) FN ;
348-
- U6 HM_100x400_4x4 + FIXED ( 449880 16610 ) FS ;
349-
- U7 HM_100x100_1x1 + FIXED ( 17880 664610 ) S ;
350-
- U8 HM_100x100_1x1 + FIXED ( 233880 448450 ) FS ;
351-
- U9 HM_100x100_1x1 + FIXED ( 17880 448450 ) FS ;
342+
- U1 HM_100x400_4x4 + FIXED ( 665880 16610 ) S ;
343+
- U10 HM_100x100_1x1 + FIXED ( 17880 232430 ) FN ;
344+
- U2 HM_100x100_1x1 + FIXED ( 233880 448450 ) S ;
345+
- U3 HM_100x100_1x1 + FIXED ( 233880 664610 ) S ;
346+
- U4 HM_100x100_1x1 + FIXED ( 233880 16550 ) FN ;
347+
- U5 HM_100x100_1x1 + FIXED ( 17880 448450 ) S ;
348+
- U6 HM_100x400_4x4 + FIXED ( 449880 16590 ) N ;
349+
- U7 HM_100x100_1x1 + FIXED ( 233880 232430 ) N ;
350+
- U8 HM_100x100_1x1 + FIXED ( 17880 664610 ) S ;
351+
- U9 HM_100x100_1x1 + FIXED ( 17880 16550 ) FN ;
352352
END COMPONENTS
353353
NETS 12 ;
354354
- w1 ( U2 I1 ) ( U1 O1 ) + USE SIGNAL ;

src/mpl/test/macro_only.defok

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,16 @@ TRACKS Y 140 DO 282 STEP 3200 LAYER metal9 ;
339339
TRACKS X 190 DO 282 STEP 3200 LAYER metal10 ;
340340
TRACKS Y 140 DO 282 STEP 3200 LAYER metal10 ;
341341
COMPONENTS 10 ;
342-
- U1 HM_100x400_4x4 + FIXED ( 665880 16610 ) S ;
343-
- U10 HM_100x100_1x1 + FIXED ( 233880 16550 ) FN ;
344-
- U2 HM_100x100_1x1 + FIXED ( 449880 664610 ) S ;
345-
- U3 HM_100x100_1x1 + FIXED ( 449880 448450 ) S ;
346-
- U4 HM_100x100_1x1 + FIXED ( 449880 232430 ) FN ;
347-
- U5 HM_100x100_1x1 + FIXED ( 449880 16550 ) FN ;
348-
- U6 HM_100x400_4x4 + FIXED ( 17880 16610 ) S ;
349-
- U7 HM_100x100_1x1 + FIXED ( 233880 664610 ) S ;
350-
- U8 HM_100x100_1x1 + FIXED ( 233880 448450 ) S ;
351-
- U9 HM_100x100_1x1 + FIXED ( 233880 232430 ) FN ;
342+
- U1 HM_100x400_4x4 + FIXED ( 17880 16610 ) FS ;
343+
- U10 HM_100x100_1x1 + FIXED ( 449880 16550 ) N ;
344+
- U2 HM_100x100_1x1 + FIXED ( 233880 448450 ) FS ;
345+
- U3 HM_100x100_1x1 + FIXED ( 233880 232430 ) N ;
346+
- U4 HM_100x100_1x1 + FIXED ( 233880 664610 ) FS ;
347+
- U5 HM_100x100_1x1 + FIXED ( 233880 16550 ) N ;
348+
- U6 HM_100x400_4x4 + FIXED ( 665880 16610 ) FS ;
349+
- U7 HM_100x100_1x1 + FIXED ( 449880 448450 ) FS ;
350+
- U8 HM_100x100_1x1 + FIXED ( 449880 232430 ) N ;
351+
- U9 HM_100x100_1x1 + FIXED ( 449880 664610 ) FS ;
352352
END COMPONENTS
353353
NETS 12 ;
354354
- w1 ( U2 I1 ) ( U1 O1 ) + USE SIGNAL ;

0 commit comments

Comments
 (0)