From 4a5fbbb0dec703388fbd06c9015f6a6940ba887e Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Tue, 18 Mar 2025 13:14:04 -0700 Subject: [PATCH 1/7] [vpr][place] change where wirelength estimation is printed --- vpr/src/place/placement_log_printer.cpp | 4 ++++ vpr/src/place/placer.cpp | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vpr/src/place/placement_log_printer.cpp b/vpr/src/place/placement_log_printer.cpp index f8c5490a630..82ef2ff1a6f 100644 --- a/vpr/src/place/placement_log_printer.cpp +++ b/vpr/src/place/placement_log_printer.cpp @@ -236,6 +236,10 @@ void PlacementLogPrinter::print_post_placement_stats() const { VTR_LOG("Swaps called: %d\n", swap_stats.num_ts_called); placer_.annealer_->get_move_abortion_logger().report_aborted_moves(); + VTR_LOG("\n"); + double expected_wirelength = placer_.net_cost_handler_.get_total_wirelength_estimate(); + VTR_LOG("BB estimate of min-dist (placement) wire length: %.0f\n", expected_wirelength); + if (placer_.placer_opts_.place_algorithm.is_timing_driven()) { //Final timing estimate VTR_ASSERT(placer_.timing_info_); diff --git a/vpr/src/place/placer.cpp b/vpr/src/place/placer.cpp index b1b25fdf6a5..643621ecb80 100644 --- a/vpr/src/place/placer.cpp +++ b/vpr/src/place/placer.cpp @@ -261,8 +261,6 @@ int Placer::check_placement_costs_() { double timing_cost_check; const auto [bb_cost_check, expected_wirelength] = net_cost_handler_.comp_bb_cost(e_cost_methods::CHECK); - VTR_LOGV(!log_printer_.quiet(), - "\nBB estimate of min-dist (placement) wire length: %.0f\n", expected_wirelength); if (fabs(bb_cost_check - costs_.bb_cost) > costs_.bb_cost * PL_INCREMENTAL_COST_TOLERANCE) { VTR_LOG_ERROR( From d8482301bc0f2a578d22bb1f46cb2b263bce5d67 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Tue, 18 Mar 2025 13:40:08 -0700 Subject: [PATCH 2/7] [vpr][place] parse initial place wl and cpd --- vtr_flow/parse/parse_config/common/vpr.place.txt | 1 + vtr_flow/parse/parse_config/timing/vpr.place.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/vtr_flow/parse/parse_config/common/vpr.place.txt b/vtr_flow/parse/parse_config/common/vpr.place.txt index 64da113842b..865a7d2159a 100644 --- a/vtr_flow/parse/parse_config/common/vpr.place.txt +++ b/vtr_flow/parse/parse_config/common/vpr.place.txt @@ -1,4 +1,5 @@ #VPR Place Metrics +initial_placed_wirelength_est;vpr.out;Initial placement BB estimate of wirelength:\s*(\d+) placed_wirelength_est;vpr.out;BB estimate of min-dist \(placement\) wire length: (\d+) #VPR Number of heap operations diff --git a/vtr_flow/parse/parse_config/timing/vpr.place.txt b/vtr_flow/parse/parse_config/timing/vpr.place.txt index ba0dc8a9307..42d3c904cd0 100644 --- a/vtr_flow/parse/parse_config/timing/vpr.place.txt +++ b/vtr_flow/parse/parse_config/timing/vpr.place.txt @@ -1,6 +1,7 @@ %include "../common/vpr.place.txt" #VPR Place Timing Metrics +initial_placed_CPD_est;vpr.out;Initial placement estimated Critical Path Delay \(CPD\): (.*) ns placed_CPD_est;vpr.out;Placement estimated critical path delay \(least slack\): (.*) ns placed_setup_TNS_est;vpr.out;Placement estimated setup Total Negative Slack \(sTNS\): (.*) ns placed_setup_WNS_est;vpr.out;Placement estimated setup Worst Negative Slack \(sWNS\): (.*) ns From 711063673ad47ab5573310c980b628ff37d85918 Mon Sep 17 00:00:00 2001 From: Amin Mohaghegh Date: Tue, 18 Mar 2025 17:44:50 -0700 Subject: [PATCH 3/7] [vpr][place] fix estimated_wl var name --- vpr/src/place/placement_log_printer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpr/src/place/placement_log_printer.cpp b/vpr/src/place/placement_log_printer.cpp index 82ef2ff1a6f..70873dcb26f 100644 --- a/vpr/src/place/placement_log_printer.cpp +++ b/vpr/src/place/placement_log_printer.cpp @@ -237,8 +237,8 @@ void PlacementLogPrinter::print_post_placement_stats() const { placer_.annealer_->get_move_abortion_logger().report_aborted_moves(); VTR_LOG("\n"); - double expected_wirelength = placer_.net_cost_handler_.get_total_wirelength_estimate(); - VTR_LOG("BB estimate of min-dist (placement) wire length: %.0f\n", expected_wirelength); + double estimated_wirelength = placer_.net_cost_handler_.get_total_wirelength_estimate(); + VTR_LOG("BB estimate of min-dist (placement) wire length: %.0f\n", estimated_wirelength); if (placer_.placer_opts_.place_algorithm.is_timing_driven()) { //Final timing estimate From 0b526ab6e7ebae8dcfeb623d2dd6dea95a0a4509 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 19 Mar 2025 09:21:19 -0400 Subject: [PATCH 4/7] make format --- libs/libvtrutil/src/tl_optional.hpp | 10 ++++++---- libs/libvtrutil/src/vtr_memory.cpp | 2 +- vpr/src/pack/pb_type_graph.cpp | 2 +- vpr/src/place/placement_log_printer.cpp | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/libvtrutil/src/tl_optional.hpp b/libs/libvtrutil/src/tl_optional.hpp index 31e66738d04..3d5f037c559 100644 --- a/libs/libvtrutil/src/tl_optional.hpp +++ b/libs/libvtrutil/src/tl_optional.hpp @@ -281,7 +281,9 @@ struct is_nothrow_swappable // std::void_t from C++17 template -struct voider { using type = void; }; +struct voider { + using type = void; +}; template using void_t = typename voider::type; @@ -514,7 +516,7 @@ struct optional_copy_assign_base : optional_move_base { // to make do with a non-trivial move assignment operator even if T is trivially // move assignable #ifndef TL_OPTIONAL_GCC49 -template::value&& std::is_trivially_move_constructible::value&& std::is_trivially_move_assignable::value> +template::value && std::is_trivially_move_constructible::value && std::is_trivially_move_assignable::value> struct optional_move_assign_base : optional_copy_assign_base { using optional_copy_assign_base::optional_copy_assign_base; }; @@ -537,7 +539,7 @@ struct optional_move_assign_base : optional_copy_assign_base { optional_move_assign_base& operator=(optional_move_assign_base&& rhs) noexcept( - std::is_nothrow_move_constructible::value&& std::is_nothrow_move_assignable::value) { + std::is_nothrow_move_constructible::value && std::is_nothrow_move_assignable::value) { this->assign(std::move(rhs)); return *this; } @@ -1241,7 +1243,7 @@ class optional : private detail::optional_move_assign_base, /// If one has a value, it is moved to the other and the movee is left /// valueless. void - swap(optional& rhs) noexcept(std::is_nothrow_move_constructible::value&& detail::is_nothrow_swappable::value) { + swap(optional& rhs) noexcept(std::is_nothrow_move_constructible::value && detail::is_nothrow_swappable::value) { using std::swap; if (has_value()) { if (rhs.has_value()) { diff --git a/libs/libvtrutil/src/vtr_memory.cpp b/libs/libvtrutil/src/vtr_memory.cpp index 65af6e8e566..4bea9f1c652 100644 --- a/libs/libvtrutil/src/vtr_memory.cpp +++ b/libs/libvtrutil/src/vtr_memory.cpp @@ -164,7 +164,7 @@ void free_chunk_memory(t_chunk* chunk_info) { while (curr_ptr != nullptr) { /* Must cast pointers to type char*, since the're of type void*, which delete can't * be called on.*/ - delete[]((char*)curr_ptr->data_vptr); /* Free memory "chunk". */ + delete[] ((char*)curr_ptr->data_vptr); /* Free memory "chunk". */ prev_ptr = curr_ptr; curr_ptr = curr_ptr->next; delete (t_linked_vptr*)prev_ptr; /* Free memory used to track "chunk". */ diff --git a/vpr/src/pack/pb_type_graph.cpp b/vpr/src/pack/pb_type_graph.cpp index 2727d05e2b8..02784e4321a 100644 --- a/vpr/src/pack/pb_type_graph.cpp +++ b/vpr/src/pack/pb_type_graph.cpp @@ -1497,7 +1497,7 @@ static bool realloc_and_load_pb_graph_pin_ptrs_at_var(const int line_num, if (prev_num_pins > 0) { std::vector temp(*pb_graph_pins, *pb_graph_pins + prev_num_pins); - delete[] * pb_graph_pins; + delete[] *pb_graph_pins; *pb_graph_pins = new t_pb_graph_pin*[*num_pins]; for (i = 0; i < prev_num_pins; i++) (*pb_graph_pins)[i] = temp[i]; diff --git a/vpr/src/place/placement_log_printer.cpp b/vpr/src/place/placement_log_printer.cpp index 70873dcb26f..1ce8c239dc7 100644 --- a/vpr/src/place/placement_log_printer.cpp +++ b/vpr/src/place/placement_log_printer.cpp @@ -239,7 +239,7 @@ void PlacementLogPrinter::print_post_placement_stats() const { VTR_LOG("\n"); double estimated_wirelength = placer_.net_cost_handler_.get_total_wirelength_estimate(); VTR_LOG("BB estimate of min-dist (placement) wire length: %.0f\n", estimated_wirelength); - + if (placer_.placer_opts_.place_algorithm.is_timing_driven()) { //Final timing estimate VTR_ASSERT(placer_.timing_info_); From 4992203c7af231e036ec4795b8f91abe9b4caa36 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 19 Mar 2025 09:48:03 -0400 Subject: [PATCH 5/7] make format --- vpr/src/pack/pb_type_graph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/pack/pb_type_graph.cpp b/vpr/src/pack/pb_type_graph.cpp index 02784e4321a..2727d05e2b8 100644 --- a/vpr/src/pack/pb_type_graph.cpp +++ b/vpr/src/pack/pb_type_graph.cpp @@ -1497,7 +1497,7 @@ static bool realloc_and_load_pb_graph_pin_ptrs_at_var(const int line_num, if (prev_num_pins > 0) { std::vector temp(*pb_graph_pins, *pb_graph_pins + prev_num_pins); - delete[] *pb_graph_pins; + delete[] * pb_graph_pins; *pb_graph_pins = new t_pb_graph_pin*[*num_pins]; for (i = 0; i < prev_num_pins; i++) (*pb_graph_pins)[i] = temp[i]; From 9338a57aa88d9ce776ec46521b83c35bd2071e3f Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 19 Mar 2025 11:34:56 -0400 Subject: [PATCH 6/7] fix formatting issues --- libs/libvtrutil/src/tl_optional.hpp | 6 +++--- libs/libvtrutil/src/vtr_memory.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/libvtrutil/src/tl_optional.hpp b/libs/libvtrutil/src/tl_optional.hpp index 3d5f037c559..8cde59cc264 100644 --- a/libs/libvtrutil/src/tl_optional.hpp +++ b/libs/libvtrutil/src/tl_optional.hpp @@ -516,7 +516,7 @@ struct optional_copy_assign_base : optional_move_base { // to make do with a non-trivial move assignment operator even if T is trivially // move assignable #ifndef TL_OPTIONAL_GCC49 -template::value && std::is_trivially_move_constructible::value && std::is_trivially_move_assignable::value> +template::value&& std::is_trivially_move_constructible::value && std::is_trivially_move_assignable::value> struct optional_move_assign_base : optional_copy_assign_base { using optional_copy_assign_base::optional_copy_assign_base; }; @@ -539,7 +539,7 @@ struct optional_move_assign_base : optional_copy_assign_base { optional_move_assign_base& operator=(optional_move_assign_base&& rhs) noexcept( - std::is_nothrow_move_constructible::value && std::is_nothrow_move_assignable::value) { + std::is_nothrow_move_constructible::value&& std::is_nothrow_move_assignable::value) { this->assign(std::move(rhs)); return *this; } @@ -1243,7 +1243,7 @@ class optional : private detail::optional_move_assign_base, /// If one has a value, it is moved to the other and the movee is left /// valueless. void - swap(optional& rhs) noexcept(std::is_nothrow_move_constructible::value && detail::is_nothrow_swappable::value) { + swap(optional& rhs) noexcept(std::is_nothrow_move_constructible::value&& detail::is_nothrow_swappable::value) { using std::swap; if (has_value()) { if (rhs.has_value()) { diff --git a/libs/libvtrutil/src/vtr_memory.cpp b/libs/libvtrutil/src/vtr_memory.cpp index 4bea9f1c652..65af6e8e566 100644 --- a/libs/libvtrutil/src/vtr_memory.cpp +++ b/libs/libvtrutil/src/vtr_memory.cpp @@ -164,7 +164,7 @@ void free_chunk_memory(t_chunk* chunk_info) { while (curr_ptr != nullptr) { /* Must cast pointers to type char*, since the're of type void*, which delete can't * be called on.*/ - delete[] ((char*)curr_ptr->data_vptr); /* Free memory "chunk". */ + delete[]((char*)curr_ptr->data_vptr); /* Free memory "chunk". */ prev_ptr = curr_ptr; curr_ptr = curr_ptr->next; delete (t_linked_vptr*)prev_ptr; /* Free memory used to track "chunk". */ From c115a4aeab9d03c4b59921240c4ea2d4d86560c0 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Wed, 19 Mar 2025 12:09:36 -0400 Subject: [PATCH 7/7] make format --- libs/libvtrutil/src/tl_optional.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libvtrutil/src/tl_optional.hpp b/libs/libvtrutil/src/tl_optional.hpp index 8cde59cc264..33f20cacc1d 100644 --- a/libs/libvtrutil/src/tl_optional.hpp +++ b/libs/libvtrutil/src/tl_optional.hpp @@ -516,7 +516,7 @@ struct optional_copy_assign_base : optional_move_base { // to make do with a non-trivial move assignment operator even if T is trivially // move assignable #ifndef TL_OPTIONAL_GCC49 -template::value&& std::is_trivially_move_constructible::value && std::is_trivially_move_assignable::value> +template::value&& std::is_trivially_move_constructible::value&& std::is_trivially_move_assignable::value> struct optional_move_assign_base : optional_copy_assign_base { using optional_copy_assign_base::optional_copy_assign_base; };