From 02a4371798004605dbbd0cb4395fa603dbd927ea Mon Sep 17 00:00:00 2001 From: Meet Patel <77514463+Meet-Patel2580@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:17:51 -0400 Subject: [PATCH 1/4] Modified print_placement_move_types_stats() function Modified print_placement_move_types_stats() function to create a table to show the statistics in a more organized and intuitive manner. --- vpr/src/place/place.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/vpr/src/place/place.cpp b/vpr/src/place/place.cpp index f4a6bf52dfb..1bf5c45ece7 100644 --- a/vpr/src/place/place.cpp +++ b/vpr/src/place/place.cpp @@ -3215,6 +3215,15 @@ static void print_placement_move_types_stats( const MoveTypeStat& move_type_stat) { float moves, accepted, rejected, aborted; + VTR_LOG("\n\nPercentage of different move types and block types:\n"); + + VTR_LOG( + "------------------ ----------------- --------------- ------------ -------------- ------------ \n"); + VTR_LOG( + " Block Type Move Type Percentage(%%) Accuracy(%%) Rejection(%%) Aborted(%%)\n"); + VTR_LOG( + "------------------ ----------------- --------------- ------------ -------------- ------------ \n"); + float total_moves = 0; for (size_t iaction = 0; iaction < move_type_stat.blk_type_moves.size(); iaction++) { total_moves += move_type_stat.blk_type_moves[iaction]; @@ -3225,8 +3234,7 @@ static void print_placement_move_types_stats( std::string move_name; int agent_type = 0; int num_of_avail_moves = move_type_stat.blk_type_moves.size() / get_num_agent_types(); - - VTR_LOG("\n\nPercentage of different move types and block types:\n"); + //Print placement information for each block type for (auto itype : device_ctx.logical_block_types) { //Skip non-existing block types in the netlist @@ -3241,8 +3249,8 @@ static void print_placement_move_types_stats( rejected = move_type_stat.rejected_moves[agent_type * num_of_avail_moves + imove]; aborted = moves - (accepted + rejected); VTR_LOG( - "\t%.20s move with type %.20s: %2.6f %% (acc=%2.2f %%, rej=%2.2f %%, aborted=%2.2f %%)\n", - move_name.c_str(), itype.name, 100 * moves / total_moves, + "%-18.20s %-21.20s %-15.6f %-12.2f %-14.2f %-13.2f\n", + itype.name, move_name.c_str(), 100 * moves / total_moves, 100 * accepted / moves, 100 * rejected / moves, 100 * aborted / moves); } @@ -3250,6 +3258,7 @@ static void print_placement_move_types_stats( agent_type++; VTR_LOG("\n"); } + VTR_LOG("\n"); } static void calculate_reward_and_process_outcome( From 861f5e9ce913197cd2d0ae61bbd945391f1ad6db Mon Sep 17 00:00:00 2001 From: Meet Patel <77514463+Meet-Patel2580@users.noreply.github.com> Date: Tue, 6 Jun 2023 14:43:10 -0400 Subject: [PATCH 2/4] Update place.cpp Removed repetitive entries in the "block type" column to improve visual appeal. --- vpr/src/place/place.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/vpr/src/place/place.cpp b/vpr/src/place/place.cpp index 1bf5c45ece7..0adefec9176 100644 --- a/vpr/src/place/place.cpp +++ b/vpr/src/place/place.cpp @@ -3218,11 +3218,11 @@ static void print_placement_move_types_stats( VTR_LOG("\n\nPercentage of different move types and block types:\n"); VTR_LOG( - "------------------ ----------------- --------------- ------------ -------------- ------------ \n"); + "------------------ ----------------- --------------- -------------- -------------- ------------ \n"); VTR_LOG( - " Block Type Move Type Percentage(%%) Accuracy(%%) Rejection(%%) Aborted(%%)\n"); + " Block Type Move Type Percentage(%%) Acceptance(%%) Rejection(%%) Aborted(%%)\n"); VTR_LOG( - "------------------ ----------------- --------------- ------------ -------------- ------------ \n"); + "------------------ ----------------- --------------- -------------- -------------- ------------ \n"); float total_moves = 0; for (size_t iaction = 0; iaction < move_type_stat.blk_type_moves.size(); iaction++) { @@ -3233,6 +3233,7 @@ static void print_placement_move_types_stats( auto& cluster_ctx = g_vpr_ctx.clustering(); std::string move_name; int agent_type = 0; + int count = 0; int num_of_avail_moves = move_type_stat.blk_type_moves.size() / get_num_agent_types(); //Print placement information for each block type @@ -3241,19 +3242,30 @@ static void print_placement_move_types_stats( if (itype.index == 0 || cluster_ctx.clb_nlist.blocks_per_type(itype).size() == 0) { continue; } + + count = 0; + for (int imove = 0; imove < num_of_avail_moves; imove++) { + move_name = move_type_to_string(e_move_type(imove)); moves = move_type_stat.blk_type_moves[agent_type * num_of_avail_moves + imove]; if (moves != 0) { accepted = move_type_stat.accepted_moves[agent_type * num_of_avail_moves + imove]; rejected = move_type_stat.rejected_moves[agent_type * num_of_avail_moves + imove]; aborted = moves - (accepted + rejected); + if(count == 0){ + VTR_LOG("%-18.20s", itype.name); + } + else{ + VTR_LOG(" "); + } VTR_LOG( - "%-18.20s %-21.20s %-15.6f %-12.2f %-14.2f %-13.2f\n", - itype.name, move_name.c_str(), 100 * moves / total_moves, + " %-21.20s %-15.6f %-12.2f %-14.2f %-13.2f\n", + move_name.c_str(), 100 * moves / total_moves, 100 * accepted / moves, 100 * rejected / moves, 100 * aborted / moves); } + count++; } agent_type++; VTR_LOG("\n"); From a496cf1b688ea8b70948b39287d23ef74c8e543c Mon Sep 17 00:00:00 2001 From: Meet Patel <77514463+Meet-Patel2580@users.noreply.github.com> Date: Wed, 7 Jun 2023 15:35:21 -0400 Subject: [PATCH 3/4] updated place.cpp (make format) Ran make format to pass all CI tests. --- vpr/src/place/place.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vpr/src/place/place.cpp b/vpr/src/place/place.cpp index 0adefec9176..bf4fcc967a5 100644 --- a/vpr/src/place/place.cpp +++ b/vpr/src/place/place.cpp @@ -3223,7 +3223,7 @@ static void print_placement_move_types_stats( " Block Type Move Type Percentage(%%) Acceptance(%%) Rejection(%%) Aborted(%%)\n"); VTR_LOG( "------------------ ----------------- --------------- -------------- -------------- ------------ \n"); - + float total_moves = 0; for (size_t iaction = 0; iaction < move_type_stat.blk_type_moves.size(); iaction++) { total_moves += move_type_stat.blk_type_moves[iaction]; @@ -3235,7 +3235,7 @@ static void print_placement_move_types_stats( int agent_type = 0; int count = 0; int num_of_avail_moves = move_type_stat.blk_type_moves.size() / get_num_agent_types(); - + //Print placement information for each block type for (auto itype : device_ctx.logical_block_types) { //Skip non-existing block types in the netlist @@ -3246,17 +3246,15 @@ static void print_placement_move_types_stats( count = 0; for (int imove = 0; imove < num_of_avail_moves; imove++) { - move_name = move_type_to_string(e_move_type(imove)); moves = move_type_stat.blk_type_moves[agent_type * num_of_avail_moves + imove]; if (moves != 0) { accepted = move_type_stat.accepted_moves[agent_type * num_of_avail_moves + imove]; rejected = move_type_stat.rejected_moves[agent_type * num_of_avail_moves + imove]; aborted = moves - (accepted + rejected); - if(count == 0){ + if (count == 0) { VTR_LOG("%-18.20s", itype.name); - } - else{ + } else { VTR_LOG(" "); } VTR_LOG( From a738c491ef223853f6b23578919951f58aa64222 Mon Sep 17 00:00:00 2001 From: Meet Patel <77514463+Meet-Patel2580@users.noreply.github.com> Date: Wed, 7 Jun 2023 18:21:58 -0400 Subject: [PATCH 4/4] Modified place.cpp Made small adjustments to the names of the headers, and fixed spacing. --- vpr/src/place/place.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vpr/src/place/place.cpp b/vpr/src/place/place.cpp index bf4fcc967a5..6b21212cb2f 100644 --- a/vpr/src/place/place.cpp +++ b/vpr/src/place/place.cpp @@ -3215,14 +3215,14 @@ static void print_placement_move_types_stats( const MoveTypeStat& move_type_stat) { float moves, accepted, rejected, aborted; - VTR_LOG("\n\nPercentage of different move types and block types:\n"); + VTR_LOG("\n\nPlacement perturbation distribution by block and move type: \n"); VTR_LOG( - "------------------ ----------------- --------------- -------------- -------------- ------------ \n"); + "------------------ ----------------- ---------------- ---------------- --------------- ------------ \n"); VTR_LOG( - " Block Type Move Type Percentage(%%) Acceptance(%%) Rejection(%%) Aborted(%%)\n"); + " Block Type Move Type (%%) of Total Accepted(%%) Rejected(%%) Aborted(%%)\n"); VTR_LOG( - "------------------ ----------------- --------------- -------------- -------------- ------------ \n"); + "------------------ ----------------- ---------------- ---------------- --------------- ------------ \n"); float total_moves = 0; for (size_t iaction = 0; iaction < move_type_stat.blk_type_moves.size(); iaction++) { @@ -3258,7 +3258,7 @@ static void print_placement_move_types_stats( VTR_LOG(" "); } VTR_LOG( - " %-21.20s %-15.6f %-12.2f %-14.2f %-13.2f\n", + " %-22.20s %-16.2f %-15.2f %-14.2f %-13.2f\n", move_name.c_str(), 100 * moves / total_moves, 100 * accepted / moves, 100 * rejected / moves, 100 * aborted / moves);