Skip to content

Commit

Permalink
update comments for pick_from_block and pick_from_highly_critical_block
Browse files Browse the repository at this point in the history
  • Loading branch information
soheilshahrouz committed Dec 5, 2024
1 parent 864bd28 commit e3cad45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 2 additions & 4 deletions vpr/src/place/move_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ const std::vector<ClusterBlockId>& movable_blocks_per_type(const t_logical_block
ClusterBlockId pick_from_block(const int logical_blk_type_index, vtr::RngContainer& rng) {
const auto& place_ctx = g_vpr_ctx.placement();

// if logical block type is specified, pick the 'from' block from block of that type; otherwise,
// pick it from all blocks
// if logical block type is specified, pick the 'from' block from blocks of that type;
// otherwise, select it randomly from all blocks
const auto& movable_blocks = (logical_blk_type_index < 0 )? place_ctx.movable_blocks : place_ctx.movable_blocks_per_type[logical_blk_type_index];

if (movable_blocks.empty()) {
Expand All @@ -599,8 +599,6 @@ ClusterBlockId pick_from_block(const int logical_blk_type_index, vtr::RngContain
return b_from;
}

//Pick a random highly critical block with a specified block type to be swapped with another random block.
//If none is found return ClusterBlockId::INVALID()
ClusterBlockId pick_from_highly_critical_block(ClusterNetId& net_from,
int& pin_from,
const int logical_blk_type_index,
Expand Down
12 changes: 8 additions & 4 deletions vpr/src/place/move_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,22 @@ const std::vector<ClusterBlockId>& movable_blocks_per_type(const t_logical_block
/**
* @brief Find a block with a specific block type to be swapped with another block
*
* @param logical_blk_type_index: the agent type of the moving block.
* @param logical_blk_type_index The logical type of the moving block. If a negative value is passed,
* the block is selected randomly from all movable blocks and not from a specific type.
* @param rng A random number generator used to select a random block.
*
* @return BlockId of the selected block, ClusterBlockId::INVALID() if no block with specified block type found
*/
ClusterBlockId pick_from_block(int logical_blk_type_index, vtr::RngContainer& rng);

/**
* @brief Find a block with a specific block type to be swapped with another block
* @brief Find a highly critical block with a specific block type to be swapped with another block.
*
* @param logical_blk_type_index: the agent type of the moving block.
* @param logical_blk_type_index The logical type of the moving block. If a negative value is passed,
* the block is selected randomly from all movable blocks and not from a specific type.
* @param rng A random number generator used to select a random highly critical block.
*
* @return BlockId of the selected block, ClusterBlockId::INVALID() if no block with specified block type found
* @return BlockId of the selected block, ClusterBlockId::INVALID() if no block with specified block type found.
*/
ClusterBlockId pick_from_highly_critical_block(ClusterNetId& net_from,
int& pin_from,
Expand Down

0 comments on commit e3cad45

Please sign in to comment.