diff --git a/vpr/src/device/rr_graph_builder.h b/vpr/src/device/rr_graph_builder.h index b47ef698d31..b6eb0c967ee 100644 --- a/vpr/src/device/rr_graph_builder.h +++ b/vpr/src/device/rr_graph_builder.h @@ -122,6 +122,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, diff --git a/vpr/src/route/rr_graph.cpp b/vpr/src/route/rr_graph.cpp index ec112a6345d..7c4a144c744 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 b5792630be0..94012e9755f 100644 --- a/vpr/src/route/rr_graph_uxsdcxx_serializer.h +++ b/vpr/src/route/rr_graph_uxsdcxx_serializer.h @@ -1547,7 +1547,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_,