Skip to content

Commit b5b6e59

Browse files
authored
Merge pull request #2435 from verilog-to-routing/add_invalid_id_checks
add invalid cluster id checks
2 parents f3a08de + 6ea348f commit b5b6e59

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

vpr/src/base/clustered_netlist_utils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ void ClusterAtomsLookup::init_lookup() {
4848
for (auto atom_blk_id : atom_ctx.nlist.blocks()) {
4949
ClusterBlockId clb_index = atom_ctx.lookup.atom_clb(atom_blk_id);
5050

51-
cluster_atoms[clb_index].push_back(atom_blk_id);
51+
/* if this data structure is being built alongside the clustered netlist */
52+
/* e.g. when ingesting and legalizing a flat placement solution, some atoms */
53+
/* may not yet be mapped to a valid clb_index */
54+
if (clb_index != ClusterBlockId::INVALID()) {
55+
cluster_atoms[clb_index].push_back(atom_blk_id);
56+
}
5257
}
5358
}
5459

vpr/src/pack/cluster_util.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3689,6 +3689,11 @@ void init_clb_atoms_lookup(vtr::vector<ClusterBlockId, std::unordered_set<AtomBl
36893689
for (auto atom_blk_id : atom_ctx.nlist.blocks()) {
36903690
ClusterBlockId clb_index = atom_ctx.lookup.atom_clb(atom_blk_id);
36913691

3692-
atoms_lookup[clb_index].insert(atom_blk_id);
3692+
/* if this data structure is being built alongside the clustered netlist */
3693+
/* e.g. when ingesting and legalizing a flat placement solution, some atoms */
3694+
/* may not yet be mapped to a valid clb_index */
3695+
if (clb_index != ClusterBlockId::INVALID()) {
3696+
atoms_lookup[clb_index].insert(atom_blk_id);
3697+
}
36933698
}
3694-
}
3699+
}

0 commit comments

Comments
 (0)