From e5f86638c39c070c0661e57cdc853a881918b5f9 Mon Sep 17 00:00:00 2001 From: Muhammad Haris Zafar Date: Wed, 27 Oct 2021 12:24:25 +0500 Subject: [PATCH 1/2] Adding api init_fan_in to rr_graph_builder.h --- vpr/src/device/rr_graph_builder.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vpr/src/device/rr_graph_builder.h b/vpr/src/device/rr_graph_builder.h index c8baa9619c4..07a79af491e 100644 --- a/vpr/src/device/rr_graph_builder.h +++ b/vpr/src/device/rr_graph_builder.h @@ -117,6 +117,14 @@ class RRGraphBuilder { return node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins); } + /** @brief Init per node fan-in data. Should only be called after all edges have + * been allocated. + * @note + * This is an expensive, O(N), operation so it should be called once you + * have a complete rr-graph and not called often. */ + inline void init_fan_in() { + node_storage_.init_fan_in(); + } /* -- Internal data storage -- */ private: /* TODO: When the refactoring effort finishes, From 6c845fffe0b45adb8ac8190846ef8124ecba644c Mon Sep 17 00:00:00 2001 From: Muhammad Haris Zafar Date: Wed, 27 Oct 2021 12:25:54 +0500 Subject: [PATCH 2/2] Replacing init_fan_in from respective .cpp/.h files --- vpr/src/route/rr_graph.cpp | 2 +- vpr/src/route/rr_graph_uxsdcxx_serializer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vpr/src/route/rr_graph.cpp b/vpr/src/route/rr_graph.cpp index ad680ae714c..e6b01951117 100644 --- a/vpr/src/route/rr_graph.cpp +++ b/vpr/src/route/rr_graph.cpp @@ -1263,7 +1263,7 @@ static std::function alloc_and_load_rr_graph(RRGraphBuilder }; } - L_rr_node.init_fan_in(); + rr_graph_builder.init_fan_in(); return update_chan_width; } diff --git a/vpr/src/route/rr_graph_uxsdcxx_serializer.h b/vpr/src/route/rr_graph_uxsdcxx_serializer.h index 23f2e22abe5..811d7eaf956 100644 --- a/vpr/src/route/rr_graph_uxsdcxx_serializer.h +++ b/vpr/src/route/rr_graph_uxsdcxx_serializer.h @@ -1546,7 +1546,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase { void finish_load() final { process_rr_node_indices(); - rr_nodes_->init_fan_in(); + rr_graph_builder_->init_fan_in(); alloc_and_load_rr_indexed_data( segment_inf_,