File tree 3 files changed +18
-20
lines changed
3 files changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -1771,18 +1771,6 @@ void ClusterLegalizer::finalize() {
1771
1771
}
1772
1772
}
1773
1773
1774
- bool ClusterLegalizer::is_atom_blk_in_cluster_block (const AtomBlockId blk_id, const AtomBlockId clustered_blk_id) const {
1775
- const t_pb* cur_pb = atom_pb_lookup ().atom_pb (blk_id);
1776
- const t_pb* pb = atom_pb_lookup ().atom_pb (clustered_blk_id);
1777
- while (cur_pb) {
1778
- if (cur_pb == pb) {
1779
- return true ;
1780
- }
1781
- cur_pb = cur_pb->parent_pb ;
1782
- }
1783
- return false ;
1784
- }
1785
-
1786
1774
ClusterLegalizer::~ClusterLegalizer () {
1787
1775
// Destroy all clusters (no need to compress).
1788
1776
for (LegalizationClusterId cluster_id : legalization_cluster_ids_) {
Original file line number Diff line number Diff line change @@ -514,12 +514,6 @@ class ClusterLegalizer {
514
514
log_verbosity_ = verbosity;
515
515
}
516
516
517
- /*
518
- * @brief Determine if atom block is in cluster block.
519
- *
520
- */
521
- bool is_atom_blk_in_cluster_block (const AtomBlockId blk_id, const AtomBlockId clustered_blk_id) const ;
522
-
523
517
inline const AtomPBBimap &atom_pb_lookup () const {return atom_pb_lookup_;}
524
518
inline AtomPBBimap &mutable_atom_pb_lookup () {return atom_pb_lookup_;}
525
519
Original file line number Diff line number Diff line change @@ -374,6 +374,20 @@ void GreedyCandidateSelector::mark_and_update_partial_gain(
374
374
cluster_gain_stats.num_pins_of_net_in_pb [net_id]++;
375
375
}
376
376
377
+ /* *
378
+ * @brief Determine if pb is a child of cluster_pb.
379
+ */
380
+ static bool is_pb_in_cluster_pb (const t_pb* pb, const t_pb* cluster_pb) {
381
+ const t_pb* cur_pb = pb;
382
+ while (cur_pb) {
383
+ if (cur_pb == cluster_pb) {
384
+ return true ;
385
+ }
386
+ cur_pb = cur_pb->parent_pb ;
387
+ }
388
+ return false ;
389
+ }
390
+
377
391
void GreedyCandidateSelector::update_connection_gain_values (
378
392
ClusterGainStats& cluster_gain_stats,
379
393
AtomNetId net_id,
@@ -394,8 +408,10 @@ void GreedyCandidateSelector::update_connection_gain_values(
394
408
AtomBlockId blk_id = atom_netlist_.pin_block (pin_id);
395
409
// TODO: Should investigate this. Using the atom pb bimap through is_atom_blk_in_cluster_block
396
410
// in this class is very strange
397
- if (cluster_legalizer.get_atom_cluster (blk_id) == legalization_cluster_id
398
- && cluster_legalizer.is_atom_blk_in_cluster_block (blk_id, clustered_blk_id)) {
411
+ const t_pb *pin_block_pb = cluster_legalizer.atom_pb_lookup ().atom_pb (blk_id);
412
+ const t_pb *cluster_pb = cluster_legalizer.atom_pb_lookup ().atom_pb (clustered_blk_id);
413
+
414
+ if (cluster_legalizer.get_atom_cluster (blk_id) == legalization_cluster_id && is_pb_in_cluster_pb (pin_block_pb, cluster_pb)) {
399
415
num_internal_connections++;
400
416
} else if (!cluster_legalizer.is_atom_clustered (blk_id)) {
401
417
num_open_connections++;
You can’t perform that action at this time.
0 commit comments