Skip to content

Commit 3d61bf1

Browse files
committed
[vpr][place] if block doens't have any connected block placed, place it close to other connected blocks
1 parent 0e44400 commit 3d61bf1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

vpr/src/place/initial_placement.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,16 +544,27 @@ static std::vector<ClusterBlockId> find_centroid_loc(const t_pl_macro& pl_macro,
544544
}
545545
}
546546

547-
if (is_io_type(cluster_ctx.clb_nlist.block_type(head_blk)) && acc_weight != 0) {
547+
if (is_io_type(cluster_ctx.clb_nlist.block_type(head_blk))) {
548548
for (const auto& block : cluster_ctx.clb_nlist.blocks()) {
549549
if (is_io_type(cluster_ctx.clb_nlist.block_type(block))) {
550550
if (is_block_placed(block, block_locs)) {
551551
acc_x += block_locs[block].loc.x;
552552
acc_y += block_locs[block].loc.y;
553+
layer_count[block_locs[block].loc.layer]++;
553554
acc_weight++;
554555
}
555556
}
556557
}
558+
} else {
559+
if (acc_weight == 0) {
560+
for (const auto& block : cluster_ctx.clb_nlist.blocks()) {
561+
if (is_block_placed(block, block_locs)) {
562+
acc_x += block_locs[block].loc.x;
563+
acc_y += block_locs[block].loc.y;
564+
layer_count[block_locs[block].loc.layer]++;
565+
acc_weight++;
566+
}
567+
}
557568
}
558569

559570
//Calculate the centroid location

0 commit comments

Comments
 (0)