From 9e4b5b4b2969e0897168d2ea3c64844b6398b753 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Thu, 6 Mar 2025 13:56:48 -0500 Subject: [PATCH 1/5] vpr/src/route/overuse_report.cpp --- vpr/src/route/overuse_report.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vpr/src/route/overuse_report.cpp b/vpr/src/route/overuse_report.cpp index 38c11908543..7db09f6b001 100644 --- a/vpr/src/route/overuse_report.cpp +++ b/vpr/src/route/overuse_report.cpp @@ -1,7 +1,6 @@ #include "overuse_report.h" #include -#include "physical_types_util.h" #include "vtr_log.h" /** @@ -448,7 +447,8 @@ void print_block_pins_nets(std::ostream& os, const auto& rr_graph = g_vpr_ctx.device().rr_graph; t_pin_range pin_num_range; - if (is_pin_on_tile(physical_type, pin_physical_num)) { + bool pin_on_tile = is_pin_on_tile(physical_type, pin_physical_num); + if (pin_on_tile) { pin_num_range.low = 0; pin_num_range.high = physical_type->num_pins - 1; } else { @@ -470,7 +470,12 @@ void print_block_pins_nets(std::ostream& os, for (int pin = pin_num_range.low; pin <= pin_num_range.high; pin++) { t_rr_type rr_type = (get_pin_type_from_pin_physical_num(physical_type, pin) == DRIVER) ? t_rr_type::OPIN : t_rr_type::IPIN; RRNodeId node_id = get_pin_rr_node_id(rr_graph.node_lookup(), physical_type, layer, root_x, root_y, pin); - VTR_ASSERT(node_id != RRNodeId::INVALID()); + // When flat router is enabled, RR Node chains collapse into a single node. Thus, when + // looking up the RR Node ID, it may return an invalid node ID. In this case, we skip + // this pin. + if (!pin_on_tile && node_id == RRNodeId::INVALID()) { + continue; + } auto search_result = rr_node_to_net_map.find(node_id); if (rr_type == t_rr_type::OPIN) { os << " OPIN - "; From c9f46db10124543c7cda4764eaaa32dd2e44ded4 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Thu, 6 Mar 2025 14:00:06 -0500 Subject: [PATCH 2/5] [vpr][route] add comment for print_block_pins_nets --- vpr/src/route/overuse_report.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vpr/src/route/overuse_report.cpp b/vpr/src/route/overuse_report.cpp index 7db09f6b001..c1bbe90eb9e 100644 --- a/vpr/src/route/overuse_report.cpp +++ b/vpr/src/route/overuse_report.cpp @@ -29,6 +29,13 @@ static void report_congested_nets(const Netlist<>& net_list, static void log_overused_nodes_header(); static void log_single_overused_node_status(int overuse_index, RRNodeId inode); + +/** + * @brief When reporting overused IPIN/OPIN nodes, we also print the nets + * connected to other pins of the same block. This information may help + * the user understand why the node is overused or why other pins are not + * being utilized for routing the net. + */ void print_block_pins_nets(std::ostream& os, t_physical_tile_type_ptr physical_type, int layer, From 1f726323eb86d3180f7617e065b64ef313ecac0a Mon Sep 17 00:00:00 2001 From: amin1377 Date: Thu, 6 Mar 2025 14:31:48 -0500 Subject: [PATCH 3/5] [vpr][route] add physical_types_util lib --- vpr/src/route/overuse_report.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/vpr/src/route/overuse_report.cpp b/vpr/src/route/overuse_report.cpp index c1bbe90eb9e..06c27580994 100644 --- a/vpr/src/route/overuse_report.cpp +++ b/vpr/src/route/overuse_report.cpp @@ -1,6 +1,7 @@ #include "overuse_report.h" #include +#include "physical_types_util.h" #include "vtr_log.h" /** From 9427807490f1c1479ed025cf25ea210f17a26384 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 11 Mar 2025 11:02:24 -0400 Subject: [PATCH 4/5] [vpr][route] add doxygen comment for print_block_pins_nets --- vpr/src/route/overuse_report.cpp | 36 +++++++++++++++++++------------- vpr/src/route/overuse_report.h | 6 +++++- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/vpr/src/route/overuse_report.cpp b/vpr/src/route/overuse_report.cpp index 06c27580994..2d06ff321d9 100644 --- a/vpr/src/route/overuse_report.cpp +++ b/vpr/src/route/overuse_report.cpp @@ -36,14 +36,22 @@ static void log_single_overused_node_status(int overuse_index, RRNodeId inode); * connected to other pins of the same block. This information may help * the user understand why the node is overused or why other pins are not * being utilized for routing the net. + * + * @param os The output stream to write the information to. + * @param physical_type The physical type of the block. + * @param layer The layer number of the block. + * @param root_x The x coordinate of the root of the block. + * @param root_y The y coordinate of the root of the block. + * @param pin_physical_num The physical number of the pin. + * @param rr_node_to_net_map A map of RR nodes to the nets that pass through them. */ -void print_block_pins_nets(std::ostream& os, - t_physical_tile_type_ptr physical_type, - int layer, - int root_x, - int root_y, - int pin_physical_num, - const std::map>& rr_node_to_net_map); +static void print_block_pins_nets(std::ostream& os, + t_physical_tile_type_ptr physical_type, + int layer, + int root_x, + int root_y, + int pin_physical_num, + const std::map>& rr_node_to_net_map); /** * @brief Print out RR node overuse info in the VPR logfile. * @@ -445,13 +453,13 @@ static void log_single_overused_node_status(int overuse_index, RRNodeId node_id) fflush(stdout); } -void print_block_pins_nets(std::ostream& os, - t_physical_tile_type_ptr physical_type, - int layer, - int root_x, - int root_y, - int pin_physical_num, - const std::map>& rr_node_to_net_map) { +static void print_block_pins_nets(std::ostream& os, + t_physical_tile_type_ptr physical_type, + int layer, + int root_x, + int root_y, + int pin_physical_num, + const std::map>& rr_node_to_net_map) { const auto& rr_graph = g_vpr_ctx.device().rr_graph; t_pin_range pin_num_range; diff --git a/vpr/src/route/overuse_report.h b/vpr/src/route/overuse_report.h index ff48e170cfe..bae9da1d135 100644 --- a/vpr/src/route/overuse_report.h +++ b/vpr/src/route/overuse_report.h @@ -20,7 +20,11 @@ * All the nets passing through an overused RR node are flagged as congested nets. */ -///@brief Print out RR node overuse info in the VPR logfile. +/** + * @brief Print out RR node overuse info in the VPR logfile. + * + * @param max_logged_overused_rr_nodes The maximum number of overused RR nodes to log. + */ void log_overused_nodes_status(int max_logged_overused_rr_nodes); ///@brief Print out RR node overuse info in a post-VPR report file. From b9d7b1aaf7820148ce3b4f0eaff2836a6a2e0896 Mon Sep 17 00:00:00 2001 From: amin1377 Date: Tue, 11 Mar 2025 11:06:10 -0400 Subject: [PATCH 5/5] [vpr][route] add assertion to check node is valid --- vpr/src/route/overuse_report.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/vpr/src/route/overuse_report.cpp b/vpr/src/route/overuse_report.cpp index 2d06ff321d9..a51b22d35d1 100644 --- a/vpr/src/route/overuse_report.cpp +++ b/vpr/src/route/overuse_report.cpp @@ -492,6 +492,7 @@ static void print_block_pins_nets(std::ostream& os, if (!pin_on_tile && node_id == RRNodeId::INVALID()) { continue; } + VTR_ASSERT(node_id.is_valid()); auto search_result = rr_node_to_net_map.find(node_id); if (rr_type == t_rr_type::OPIN) { os << " OPIN - ";