Skip to content

Commit ec00c1e

Browse files
add comments to pick_from_highly_critical_block()
1 parent b76b41e commit ec00c1e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

vpr/src/place/move_utils.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,12 +623,14 @@ ClusterBlockId pick_from_highly_critical_block(ClusterNetId& net_from,
623623
std::pair<ClusterNetId, int> crit_pin = highly_crit_pins[rng.irand(highly_crit_pins.size() - 1)];
624624
ClusterBlockId b_from = cluster_ctx.clb_nlist.net_driver_block(crit_pin.first);
625625

626-
//Check if picked block type matches with the blk_type specified, and it is not fixed
627-
//blk_type from propose move doesn't account for the EMPTY type
628626
auto b_from_type = cluster_ctx.clb_nlist.block_type(b_from);
627+
628+
// check if the type of the picked block matches with the specified block type
629+
// when a block type is specified, i.e. when logical_blk_type_index >= 0
629630
if (b_from_type->index == logical_blk_type_index || logical_blk_type_index < 0) {
631+
// ensure that the selected block is not fixed
630632
if (block_locs[b_from].is_fixed) {
631-
return ClusterBlockId::INVALID(); //Block is fixed, cannot move
633+
return ClusterBlockId::INVALID(); // a fixed block can't be moved
632634
}
633635

634636
net_from = crit_pin.first;

vpr/src/place/move_utils.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,14 @@ ClusterBlockId pick_from_block(int logical_blk_type_index, vtr::RngContainer& rn
200200
/**
201201
* @brief Find a highly critical block with a specific block type to be swapped with another block.
202202
*
203+
* @param net_from The clustered net id of the critical connection of the selected block by this function.
204+
* To be filled by this function.
205+
* @param pin_from The pin id of the critical connection of the selected block by this function.
206+
* To be filled by this function.
203207
* @param logical_blk_type_index The logical type of the moving block. If a negative value is passed,
204208
* the block is selected randomly from all movable blocks and not from a specific type.
209+
* @param placer_state Used to access the current placement's info, e.g. block locations and if they are fixed.
210+
* @param placer_criticalities Holds the clustered netlist connection criticalities.
205211
* @param rng A random number generator used to select a random highly critical block.
206212
*
207213
* @return BlockId of the selected block, ClusterBlockId::INVALID() if no block with specified block type found.

0 commit comments

Comments
 (0)