Skip to content

Commit 6573250

Browse files
removed unnecessary referneces
1 parent 5b20e71 commit 6573250

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed

vpr/src/pack/re_cluster_util.cpp

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
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
1414
const 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,
1919
static void fix_atom_pin_mapping(const AtomBlockId blk);
2020

2121
static 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

2928
static 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

115114
bool 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

538537
static void fix_atom_pin_mapping(const AtomBlockId blk) {
@@ -655,7 +654,7 @@ bool is_cluster_legal(t_lb_router_data*& router_data) {
655654
}
656655

657656
void 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,

vpr/src/pack/re_cluster_util.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* It can also be used during placement to allow fine-grained moves that can move a BLE or a single FF/LUT.
1717
*
1818
* Note: Some of the helper functions defined here might be useful in different places in VPR.
19-
*
2019
*/
2120

2221
/**
@@ -57,7 +56,7 @@ t_lb_router_data* lb_load_router_data(std::vector<t_lb_type_rr_node>* lb_type_rr
5756
* illegal.
5857
*
5958
* This function updates the intra-logic block router data structure (router_data) and
60-
* remove all the atoms of the moecule from old_clb_atoms vector.
59+
* remove all the atoms of the molecule from old_clb_atoms vector.
6160
*
6261
* @param old_clb: The original cluster of this molecule
6362
* @param old_clb_atoms: A vector containing the list of atoms in the old cluster of the molecule.
@@ -88,9 +87,9 @@ void remove_mol_from_cluster(const t_pack_molecule* molecule,
8887
* @param temp_cluster_noc_grp_id returns the NoC group ID of the new cluster
8988
*/
9089
bool start_new_cluster_for_mol(t_pack_molecule* molecule,
91-
const t_logical_block_type_ptr& type,
92-
const int& mode,
93-
const int& feasible_block_array_size,
90+
t_logical_block_type_ptr type,
91+
int mode,
92+
int feasible_block_array_size,
9493
bool enable_pin_feasibility_filter,
9594
ClusterBlockId clb_index,
9695
bool during_packing,
@@ -157,7 +156,6 @@ void revert_mol_move(ClusterBlockId old_clb,
157156
t_clustering_data& clustering_data);
158157

159158
/**
160-
*
161159
* @brief A function that checks the legality of a cluster by running the intra-cluster routing
162160
*/
163161
bool is_cluster_legal(t_lb_router_data*& router_data);
@@ -169,7 +167,7 @@ bool is_cluster_legal(t_lb_router_data*& router_data);
169167
* @params new_clb_created: true if the move is creating a new cluster (e.g. move_mol_to_new_cluster)
170168
*/
171169
void commit_mol_removal(const t_pack_molecule* molecule,
172-
const int& molecule_size,
170+
int molecule_size,
173171
ClusterBlockId old_clb,
174172
bool during_packing,
175173
t_lb_router_data*& router_data,

0 commit comments

Comments
 (0)