1010
1111
1212// The name suffix of the new block (if exists)
13- // This suffex is useful in preventing duplicate high-level cluster block names
13+ // This suffix is useful in preventing duplicate high-level cluster block names
1414const char * name_suffix = " _m" ;
1515
1616/* ****************** Static Functions ********************/
@@ -19,12 +19,11 @@ static void load_internal_to_block_net_nums(const t_logical_block_type_ptr type,
1919static void fix_atom_pin_mapping (const AtomBlockId blk);
2020
2121static void fix_cluster_pins_after_moving (const ClusterBlockId clb_index);
22- static void check_net_absorbtion (const AtomNetId atom_net_id,
23- const ClusterBlockId new_clb,
24- const ClusterBlockId old_clb,
25- ClusterPinId& cluster_pin_id,
26- bool & previously_absorbed,
27- bool & now_abosrbed);
22+
23+ static std::pair<bool , bool > check_net_absorption (AtomNetId atom_net_id,
24+ ClusterBlockId new_clb,
25+ ClusterBlockId old_clb,
26+ ClusterPinId& cluster_pin_id);
2827
2928static void fix_cluster_port_after_moving (const ClusterBlockId clb_index);
3029
@@ -113,9 +112,9 @@ t_lb_router_data* lb_load_router_data(std::vector<t_lb_type_rr_node>* lb_type_rr
113112}
114113
115114bool start_new_cluster_for_mol (t_pack_molecule* molecule,
116- const t_logical_block_type_ptr& type,
117- const int & mode,
118- const int & feasible_block_array_size,
115+ const t_logical_block_type_ptr type,
116+ const int mode,
117+ const int feasible_block_array_size,
119118 bool enable_pin_feasibility_filter,
120119 ClusterBlockId clb_index,
121120 bool during_packing,
@@ -330,7 +329,6 @@ static void fix_cluster_net_after_moving(const t_pack_molecule* molecule,
330329
331330 AtomNetId atom_net_id;
332331 ClusterPinId cluster_pin;
333- bool previously_absorbed, now_abosrbed;
334332
335333 // remove all old cluster pin from their nets
336334 ClusterNetId cur_clb_net;
@@ -344,9 +342,9 @@ static void fix_cluster_net_after_moving(const t_pack_molecule* molecule,
344342 if (molecule->atom_block_ids [i_atom]) {
345343 for (auto atom_pin : atom_ctx.nlist .block_pins (molecule->atom_block_ids [i_atom])) {
346344 atom_net_id = atom_ctx.nlist .pin_net (atom_pin);
347- check_net_absorbtion (atom_net_id, new_clb, old_clb, cluster_pin, previously_absorbed, now_abosrbed );
345+ auto [previously_absorbed, now_absorbed] = check_net_absorption (atom_net_id, new_clb, old_clb, cluster_pin);
348346
349- if (!previously_absorbed && now_abosrbed ) {
347+ if (!previously_absorbed && now_absorbed ) {
350348 cur_clb_net = cluster_ctx.clb_nlist .pin_net (cluster_pin);
351349 cluster_ctx.clb_nlist .remove_net (cur_clb_net);
352350 }
@@ -496,12 +494,10 @@ static void fix_cluster_pins_after_moving(const ClusterBlockId clb_index) {
496494 }
497495}
498496
499- static void check_net_absorbtion (const AtomNetId atom_net_id,
500- const ClusterBlockId new_clb,
501- const ClusterBlockId old_clb,
502- ClusterPinId& cluster_pin_id,
503- bool & previously_absorbed,
504- bool & now_abosrbed) {
497+ static std::pair<bool , bool > check_net_absorption (const AtomNetId atom_net_id,
498+ const ClusterBlockId new_clb,
499+ const ClusterBlockId old_clb,
500+ ClusterPinId& cluster_pin_id) {
505501 auto & atom_ctx = g_vpr_ctx.atom ();
506502 auto & cluster_ctx = g_vpr_ctx.clustering ();
507503
@@ -510,6 +506,7 @@ static void check_net_absorbtion(const AtomNetId atom_net_id,
510506
511507 ClusterNetId clb_net_id = atom_ctx.lookup .clb_net (atom_net_id);
512508
509+ bool previously_absorbed;
513510 if (clb_net_id == ClusterNetId::INVALID ())
514511 previously_absorbed = true ;
515512 else {
@@ -523,16 +520,18 @@ static void check_net_absorbtion(const AtomNetId atom_net_id,
523520 }
524521
525522 // iterate over net pins and check their cluster
526- now_abosrbed = true ;
523+ bool now_absorbed = true ;
527524 for (auto & net_pin : atom_ctx.nlist .net_pins (atom_net_id)) {
528525 atom_block_id = atom_ctx.nlist .pin_block (net_pin);
529526 clb_index = atom_ctx.lookup .atom_clb (atom_block_id);
530527
531528 if (clb_index != new_clb) {
532- now_abosrbed = false ;
529+ now_absorbed = false ;
533530 break ;
534531 }
535532 }
533+
534+ return {previously_absorbed, now_absorbed};
536535}
537536
538537static void fix_atom_pin_mapping (const AtomBlockId blk) {
@@ -655,7 +654,7 @@ bool is_cluster_legal(t_lb_router_data*& router_data) {
655654}
656655
657656void commit_mol_removal (const t_pack_molecule* molecule,
658- const int & molecule_size,
657+ int molecule_size,
659658 ClusterBlockId old_clb,
660659 bool during_packing,
661660 t_lb_router_data*& router_data,
0 commit comments