From e3cad45d6ff576432a3d21157da5f4d539022dc2 Mon Sep 17 00:00:00 2001 From: soheilshahrouz Date: Thu, 5 Dec 2024 17:12:52 -0500 Subject: [PATCH] update comments for pick_from_block and pick_from_highly_critical_block --- vpr/src/place/move_utils.cpp | 6 ++---- vpr/src/place/move_utils.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/vpr/src/place/move_utils.cpp b/vpr/src/place/move_utils.cpp index 601d2dea85..d44c3611ec 100644 --- a/vpr/src/place/move_utils.cpp +++ b/vpr/src/place/move_utils.cpp @@ -586,8 +586,8 @@ const std::vector& 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()) { @@ -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, diff --git a/vpr/src/place/move_utils.h b/vpr/src/place/move_utils.h index 2b3f8de0ce..ea9a90cc18 100644 --- a/vpr/src/place/move_utils.h +++ b/vpr/src/place/move_utils.h @@ -189,18 +189,22 @@ const std::vector& 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,