@@ -18,7 +18,6 @@ using std::endl;
18
18
19
19
uint Par::countMolecules (t_pack_molecule* molecule_head) {
20
20
uint cnt = 0 ;
21
- AtomNetlist myNetlist = g_vpr_ctx.atom ().nlist ;
22
21
for (auto cur_mol = molecule_head; cur_mol; cur_mol = cur_mol->next ) {
23
22
cnt++;
24
23
}
@@ -31,7 +30,7 @@ bool Par::init(t_pack_molecule* molecule_head) {
31
30
set_ltrace (3 );
32
31
auto tr = ltrace ();
33
32
34
- AtomNetlist myNetlist = g_vpr_ctx.atom ().nlist ;
33
+ const AtomNetlist& myNetlist = g_vpr_ctx.atom ().nlist ;
35
34
for (auto cur_mol = molecule_head; cur_mol; cur_mol = cur_mol->next ) {
36
35
molecules_.push_back (cur_mol);
37
36
numMolecules_++;
@@ -68,11 +67,13 @@ bool Par::init(t_pack_molecule* molecule_head) {
68
67
for (auto molecule : molecules_) {
69
68
string name_block = " " ;
70
69
for (auto abid : molecule->atom_block_ids ) {
71
- name_block += myNetlist.block_name (abid);
72
- uint bid = size_t (abid);
73
- if (bid >= numAtoms_) continue ;
74
- VTR_ASSERT (atomBlockIdToMolId_[bid] == -1 );
75
- atomBlockIdToMolId_[bid] = i;
70
+ if (abid.is_valid ()) {
71
+ name_block += myNetlist.block_name (abid);
72
+ uint bid = size_t (abid);
73
+ if (bid >= numAtoms_) continue ;
74
+ VTR_ASSERT (atomBlockIdToMolId_[bid] == -1 );
75
+ atomBlockIdToMolId_[bid] = i;
76
+ }
76
77
}
77
78
molIdToName_[i] = name_block;
78
79
i++;
@@ -163,7 +164,7 @@ bool Par::Bi_Partion(uint partition_index) {
163
164
MoleculesToIntermediate.push_back (-1 );
164
165
}
165
166
}
166
- AtomNetlist myNetlist = g_vpr_ctx.atom ().nlist ;
167
+ const AtomNetlist& myNetlist = g_vpr_ctx.atom ().nlist ;
167
168
vector<string> uniqueLines;
168
169
vector<int > lineCounts;
169
170
@@ -323,7 +324,7 @@ struct partition_position {
323
324
}
324
325
325
326
bool Par::recursive_partitioning (int molecule_per_partition) {
326
- AtomNetlist myNetlist = g_vpr_ctx.atom ().nlist ;
327
+ const AtomNetlist& myNetlist = g_vpr_ctx.atom ().nlist ;
327
328
// // auto& device_ctx = g_vpr_ctx.device();
328
329
// // auto& grid = device_ctx.grid;
329
330
vector<int > partion_size;
0 commit comments