From 1726ad8dce72d0d150e09b676d506b84d588542d Mon Sep 17 00:00:00 2001 From: KA7E Date: Tue, 4 Jun 2024 20:31:02 -0400 Subject: [PATCH 1/7] add detailed routing stage parameter to reclustering utils --- vpr/src/pack/re_cluster_util.cpp | 10 ++++++---- vpr/src/pack/re_cluster_util.h | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/vpr/src/pack/re_cluster_util.cpp b/vpr/src/pack/re_cluster_util.cpp index a119408a14f..1cde315ed79 100644 --- a/vpr/src/pack/re_cluster_util.cpp +++ b/vpr/src/pack/re_cluster_util.cpp @@ -129,7 +129,8 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule, t_clustering_data& clustering_data, t_lb_router_data** router_data, PartitionRegion& temp_cluster_pr, - NocGroupId& temp_cluster_noc_grp_id) { + NocGroupId& temp_cluster_noc_grp_id, + const int& detailed_routing_stage) { auto& atom_ctx = g_vpr_ctx.atom(); auto& floorplanning_ctx = g_vpr_ctx.mutable_floorplanning(); auto& helper_ctx = g_vpr_ctx.mutable_cl_helper(); @@ -164,7 +165,7 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule, helper_ctx.num_models, helper_ctx.max_cluster_size, clb_index, - E_DETAILED_ROUTE_FOR_EACH_ATOM, + detailed_routing_stage, *router_data, 0, enable_pin_feasibility_filter, @@ -212,7 +213,8 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, std::unordered_set* new_clb_atoms, bool during_packing, t_clustering_data& clustering_data, - t_lb_router_data*& router_data) { + t_lb_router_data*& router_data, + const int& detailed_routing_stage) { auto& helper_ctx = g_vpr_ctx.mutable_cl_helper(); auto& cluster_ctx = g_vpr_ctx.mutable_clustering(); @@ -238,7 +240,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, helper_ctx.num_models, helper_ctx.max_cluster_size, new_clb, - E_DETAILED_ROUTE_FOR_EACH_ATOM, + detailed_routing_stage, router_data, 0, helper_ctx.enable_pin_feasibility_filter, diff --git a/vpr/src/pack/re_cluster_util.h b/vpr/src/pack/re_cluster_util.h index b1c16e80b39..4aca0fa5f95 100644 --- a/vpr/src/pack/re_cluster_util.h +++ b/vpr/src/pack/re_cluster_util.h @@ -88,7 +88,8 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule, t_clustering_data& clustering_data, t_lb_router_data** router_data, PartitionRegion& temp_cluster_pr, - NocGroupId& temp_cluster_noc_grp_id); + NocGroupId& temp_cluster_noc_grp_id, + const int detailed_routing_stage = 1); /** * @brief A function that packs a molecule into an existing cluster @@ -107,7 +108,8 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, std::unordered_set* new_clb_atoms, bool during_packing, t_clustering_data& clustering_data, - t_lb_router_data*& router_data); + t_lb_router_data*& router_data, + const int detailed_routing_stage = 1); /** * @brief A function that fix the clustered netlist if the move is performed From abc1c1b32f81e35f9e86ca7ec14dd300d9a054fb Mon Sep 17 00:00:00 2001 From: KA7E Date: Wed, 5 Jun 2024 13:16:59 -0400 Subject: [PATCH 2/7] match function def to impl --- vpr/src/pack/re_cluster_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vpr/src/pack/re_cluster_util.h b/vpr/src/pack/re_cluster_util.h index 4aca0fa5f95..45026f555ba 100644 --- a/vpr/src/pack/re_cluster_util.h +++ b/vpr/src/pack/re_cluster_util.h @@ -89,7 +89,7 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule, t_lb_router_data** router_data, PartitionRegion& temp_cluster_pr, NocGroupId& temp_cluster_noc_grp_id, - const int detailed_routing_stage = 1); + const int& detailed_routing_stage = 1); /** * @brief A function that packs a molecule into an existing cluster @@ -109,7 +109,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, bool during_packing, t_clustering_data& clustering_data, t_lb_router_data*& router_data, - const int detailed_routing_stage = 1); + const int& detailed_routing_stage = 1); /** * @brief A function that fix the clustered netlist if the move is performed From efc0b4086c03a307c4ee779b0b302d7b804f975f Mon Sep 17 00:00:00 2001 From: KA7E Date: Sat, 8 Jun 2024 17:50:20 -0400 Subject: [PATCH 3/7] added comments and changed arg type to enum --- vpr/src/pack/re_cluster_util.cpp | 4 ++-- vpr/src/pack/re_cluster_util.h | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/vpr/src/pack/re_cluster_util.cpp b/vpr/src/pack/re_cluster_util.cpp index 1cde315ed79..def6f9374df 100644 --- a/vpr/src/pack/re_cluster_util.cpp +++ b/vpr/src/pack/re_cluster_util.cpp @@ -130,7 +130,7 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule, t_lb_router_data** router_data, PartitionRegion& temp_cluster_pr, NocGroupId& temp_cluster_noc_grp_id, - const int& detailed_routing_stage) { + enum e_detailed_routing_stages detailed_routing_stage) { auto& atom_ctx = g_vpr_ctx.atom(); auto& floorplanning_ctx = g_vpr_ctx.mutable_floorplanning(); auto& helper_ctx = g_vpr_ctx.mutable_cl_helper(); @@ -214,7 +214,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, bool during_packing, t_clustering_data& clustering_data, t_lb_router_data*& router_data, - const int& detailed_routing_stage) { + enum e_detailed_routing_stages detailed_routing_stage) { auto& helper_ctx = g_vpr_ctx.mutable_cl_helper(); auto& cluster_ctx = g_vpr_ctx.mutable_clustering(); diff --git a/vpr/src/pack/re_cluster_util.h b/vpr/src/pack/re_cluster_util.h index 45026f555ba..6684df666be 100644 --- a/vpr/src/pack/re_cluster_util.h +++ b/vpr/src/pack/re_cluster_util.h @@ -76,6 +76,10 @@ void remove_mol_from_cluster(const t_pack_molecule* molecule, * (is updated if this function is called during packing, especially intra_lb_routing data member). * @param router_data: returns the intra logic block router data. * @param temp_cluster_pr: returns the partition region of the new cluster. + * @param detailed_routing_stage: options are E_DETAILED_ROUTE_FOR_EACH_ATOM (default) and E_DETAILED_ROUTE_AT_END_ONLY + * specifies whether or not to run intra-cluster routing-based legality checking + * after adding the molecule to the cluster; default is the more conservative option, + * which is used in the top level re-clustering API functions */ bool start_new_cluster_for_mol(t_pack_molecule* molecule, const t_logical_block_type_ptr& type, @@ -89,7 +93,7 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule, t_lb_router_data** router_data, PartitionRegion& temp_cluster_pr, NocGroupId& temp_cluster_noc_grp_id, - const int& detailed_routing_stage = 1); + enum e_detailed_routing_stages detailed_routing_stage = E_DETAILED_ROUTE_FOR_EACH_ATOM); /** * @brief A function that packs a molecule into an existing cluster From b383a8b0d2d7413ef2ccf62405caa9da93a05dda Mon Sep 17 00:00:00 2001 From: KA7E Date: Sat, 8 Jun 2024 19:24:06 -0400 Subject: [PATCH 4/7] merge tool got .cpp out of sync with .h file --- vpr/src/pack/re_cluster_util.cpp | 1 + vpr/src/pack/re_cluster_util.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vpr/src/pack/re_cluster_util.cpp b/vpr/src/pack/re_cluster_util.cpp index def6f9374df..1f343de827c 100644 --- a/vpr/src/pack/re_cluster_util.cpp +++ b/vpr/src/pack/re_cluster_util.cpp @@ -214,6 +214,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, bool during_packing, t_clustering_data& clustering_data, t_lb_router_data*& router_data, + NocGroupId& temp_cluster_noc_grp_id, enum e_detailed_routing_stages detailed_routing_stage) { auto& helper_ctx = g_vpr_ctx.mutable_cl_helper(); auto& cluster_ctx = g_vpr_ctx.mutable_clustering(); diff --git a/vpr/src/pack/re_cluster_util.h b/vpr/src/pack/re_cluster_util.h index 6684df666be..81bf228b12b 100644 --- a/vpr/src/pack/re_cluster_util.h +++ b/vpr/src/pack/re_cluster_util.h @@ -76,7 +76,7 @@ void remove_mol_from_cluster(const t_pack_molecule* molecule, * (is updated if this function is called during packing, especially intra_lb_routing data member). * @param router_data: returns the intra logic block router data. * @param temp_cluster_pr: returns the partition region of the new cluster. - * @param detailed_routing_stage: options are E_DETAILED_ROUTE_FOR_EACH_ATOM (default) and E_DETAILED_ROUTE_AT_END_ONLY + * @param detailed_routing_stage: options are E_xDETAILED_ROUTE_FOR_EACH_ATOM (default) and E_DETAILED_ROUTE_AT_END_ONLY * specifies whether or not to run intra-cluster routing-based legality checking * after adding the molecule to the cluster; default is the more conservative option, * which is used in the top level re-clustering API functions @@ -113,6 +113,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, bool during_packing, t_clustering_data& clustering_data, t_lb_router_data*& router_data, + NocGroupId& temp_cluster_noc_grp_id, const int& detailed_routing_stage = 1); /** From b4b2ac55431766c46de2f1cfed93ce8af73b5f52 Mon Sep 17 00:00:00 2001 From: KA7E Date: Sun, 9 Jun 2024 12:24:54 -0400 Subject: [PATCH 5/7] fixed pack_mol_in_existing --- vpr/src/pack/re_cluster_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpr/src/pack/re_cluster_util.h b/vpr/src/pack/re_cluster_util.h index adbe8d4d2fa..8c912aefc65 100644 --- a/vpr/src/pack/re_cluster_util.h +++ b/vpr/src/pack/re_cluster_util.h @@ -115,7 +115,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, t_clustering_data& clustering_data, t_lb_router_data*& router_data, NocGroupId& temp_cluster_noc_grp_id, - const int& detailed_routing_stage = 1); + enum e_detailed_routing_stages detailed_routing_stage = E_DETAILED_ROUTE_FOR_EACH_ATOM); /** * @brief A function that fix the clustered netlist if the move is performed From d1f3353e07ad55ec73aca03ee98fc4de8205b745 Mon Sep 17 00:00:00 2001 From: KA7E Date: Mon, 10 Jun 2024 16:24:33 -0400 Subject: [PATCH 6/7] added comments --- vpr/src/pack/re_cluster_util.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/vpr/src/pack/re_cluster_util.h b/vpr/src/pack/re_cluster_util.h index 8c912aefc65..93be561330c 100644 --- a/vpr/src/pack/re_cluster_util.h +++ b/vpr/src/pack/re_cluster_util.h @@ -77,10 +77,13 @@ void remove_mol_from_cluster(const t_pack_molecule* molecule, * @param router_data: returns the intra logic block router data. * @param temp_cluster_pr: returns the partition region of the new cluster. * @param temp_cluster_noc_grp_id returns the NoC group ID of the new cluster - * @param detailed_routing_stage: options are E_DETAILED_ROUTE_FOR_EACH_ATOM (default) and E_DETAILED_ROUTE_AT_END_ONLY - * specifies whether or not to run intra-cluster routing-based legality checking - * after adding the molecule to the cluster; default is the more conservative option, - * which is used in the top level re-clustering API functions + * @param detailed_routing_stage: options are E_DETAILED_ROUTE_FOR_EACH_ATOM (default) and E_DETAILED_ROUTE_AT_END_ONLY. + * This argument specifies whether or not to run an intra-cluster routing-based legality + * check after adding the molecule to the cluster; default is the more conservative option. + * This argument is passed down to try_pack_mol; if E_DETAILED_ROUTE_AT_END_ONLY is passed, + * the function does not run a detailed intra-cluster routing-based legality check. + * If many molecules will be added to a cluster, this option enables use of a single + * routing check on the completed cluster (vs many incremental checks). */ bool start_new_cluster_for_mol(t_pack_molecule* molecule, const t_logical_block_type_ptr& type, @@ -106,6 +109,14 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule, * @param clustering_data: A data structure containing helper data for the clustering process * (is updated if this function is called during packing, especially intra_lb_routing data member). * @param router_data: returns the intra logic block router data. + * @param temp_cluster_noc_grp_id returns the NoC group ID of the new cluster + * @param detailed_routing_stage: options are E_DETAILED_ROUTE_FOR_EACH_ATOM (default) and E_DETAILED_ROUTE_AT_END_ONLY. + * This argument specifies whether or not to run an intra-cluster routing-based legality + * check after adding the molecule to the cluster; default is the more conservative option. + * This argument is passed down to try_pack_mol; if E_DETAILED_ROUTE_AT_END_ONLY is passed, + * the function does not run a detailed intra-cluster routing-based legality check. + * If many molecules will be added to a cluster, this option enables use of a single + * routing check on the completed cluster (vs many incremental checks). */ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, int molecule_size, @@ -115,7 +126,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, t_clustering_data& clustering_data, t_lb_router_data*& router_data, NocGroupId& temp_cluster_noc_grp_id, - enum e_detailed_routing_stages detailed_routing_stage = E_DETAILED_ROUTE_FOR_EACH_ATOM); + enum e_detailed_routing_stages detailed_routing_stage = E_DETAILED_ROUTE_FOR_EACH_ATOM); /** * @brief A function that fix the clustered netlist if the move is performed From 9e93fcf1b953d059c14f8956abeca8725d79ffeb Mon Sep 17 00:00:00 2001 From: KA7E Date: Tue, 11 Jun 2024 13:14:04 -0400 Subject: [PATCH 7/7] typo --- vpr/src/pack/re_cluster_util.cpp | 1 - vpr/src/pack/re_cluster_util.h | 1 - 2 files changed, 2 deletions(-) diff --git a/vpr/src/pack/re_cluster_util.cpp b/vpr/src/pack/re_cluster_util.cpp index 0e25edfeeef..b7f95428650 100644 --- a/vpr/src/pack/re_cluster_util.cpp +++ b/vpr/src/pack/re_cluster_util.cpp @@ -214,7 +214,6 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, bool during_packing, t_clustering_data& clustering_data, t_lb_router_data*& router_data, - NocGroupId& temp_cluster_noc_grp_id, enum e_detailed_routing_stages detailed_routing_stage) { auto& helper_ctx = g_vpr_ctx.mutable_cl_helper(); auto& cluster_ctx = g_vpr_ctx.mutable_clustering(); diff --git a/vpr/src/pack/re_cluster_util.h b/vpr/src/pack/re_cluster_util.h index 93be561330c..e38a873b4b8 100644 --- a/vpr/src/pack/re_cluster_util.h +++ b/vpr/src/pack/re_cluster_util.h @@ -125,7 +125,6 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule, bool during_packing, t_clustering_data& clustering_data, t_lb_router_data*& router_data, - NocGroupId& temp_cluster_noc_grp_id, enum e_detailed_routing_stages detailed_routing_stage = E_DETAILED_ROUTE_FOR_EACH_ATOM); /**