From 9c30d3fd02684dc2d0df0f12b46c20715aca7694 Mon Sep 17 00:00:00 2001 From: Muhammad Haris Zafar Date: Tue, 26 Oct 2021 12:21:22 +0500 Subject: [PATCH 1/4] Adding api count_rr_switches to rr_graph_builder.h --- vpr/src/device/rr_graph_builder.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vpr/src/device/rr_graph_builder.h b/vpr/src/device/rr_graph_builder.h index 7f50541cf2b..7cdfa68a527 100644 --- a/vpr/src/device/rr_graph_builder.h +++ b/vpr/src/device/rr_graph_builder.h @@ -108,6 +108,15 @@ class RRGraphBuilder { node_storage_.add_node_side(id, new_side); } + /** @brief Counts the number of rr switches needed based on fan in to support mux + * size dependent switch delays. */ + inline size_t count_rr_switches( + size_t num_arch_switches, + t_arch_switch_inf* arch_switch_inf, + t_arch_switch_fanin& arch_switch_fanins) { + node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins); + } + /* -- Internal data storage -- */ private: /* TODO: When the refactoring effort finishes, From 2d234f754119176ccc8e250aa922e475611a44c3 Mon Sep 17 00:00:00 2001 From: Muhammad Haris Zafar Date: Tue, 26 Oct 2021 12:35:59 +0500 Subject: [PATCH 2/4] Replacing count_rr_switches from respective .cpp/.h files --- vpr/src/route/rr_graph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/route/rr_graph.cpp b/vpr/src/route/rr_graph.cpp index e3de58d8ad4..ad680ae714c 100644 --- a/vpr/src/route/rr_graph.cpp +++ b/vpr/src/route/rr_graph.cpp @@ -819,7 +819,7 @@ static void alloc_rr_switch_inf(t_arch_switch_fanin& arch_switch_fanins) { auto& device_ctx = g_vpr_ctx.mutable_device(); /* allocate space for the rr_switch_inf array */ - size_t num_rr_switches = device_ctx.rr_nodes.count_rr_switches( + size_t num_rr_switches = device_ctx.rr_graph_builder.count_rr_switches( device_ctx.num_arch_switches, device_ctx.arch_switch_inf, arch_switch_fanins); From a0896ce2f8f2671af4e7bae3ebfc44fc6e34da54 Mon Sep 17 00:00:00 2001 From: Muhammad Haris Zafar Date: Tue, 26 Oct 2021 13:03:32 +0500 Subject: [PATCH 3/4] Fixing return type non-void --- vpr/src/device/rr_graph_builder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/device/rr_graph_builder.h b/vpr/src/device/rr_graph_builder.h index 7cdfa68a527..0435b854ffa 100644 --- a/vpr/src/device/rr_graph_builder.h +++ b/vpr/src/device/rr_graph_builder.h @@ -114,7 +114,7 @@ class RRGraphBuilder { size_t num_arch_switches, t_arch_switch_inf* arch_switch_inf, t_arch_switch_fanin& arch_switch_fanins) { - node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins); + return node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins); } /* -- Internal data storage -- */ From 35aadfe9224e079e24ac3e8d8523436373006d54 Mon Sep 17 00:00:00 2001 From: Muhammad Haris Zafar Date: Tue, 26 Oct 2021 14:35:31 +0500 Subject: [PATCH 4/4] Fixing format --- vpr/src/device/rr_graph_builder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/device/rr_graph_builder.h b/vpr/src/device/rr_graph_builder.h index 0435b854ffa..c8baa9619c4 100644 --- a/vpr/src/device/rr_graph_builder.h +++ b/vpr/src/device/rr_graph_builder.h @@ -114,7 +114,7 @@ class RRGraphBuilder { size_t num_arch_switches, t_arch_switch_inf* arch_switch_inf, t_arch_switch_fanin& arch_switch_fanins) { - return node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins); + return node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins); } /* -- Internal data storage -- */