Skip to content

add invalid cluster id checks #2435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion vpr/src/base/clustered_netlist_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ void ClusterAtomsLookup::init_lookup() {
for (auto atom_blk_id : atom_ctx.nlist.blocks()) {
ClusterBlockId clb_index = atom_ctx.lookup.atom_clb(atom_blk_id);

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

Expand Down
9 changes: 7 additions & 2 deletions vpr/src/pack/cluster_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3686,6 +3686,11 @@ void init_clb_atoms_lookup(vtr::vector<ClusterBlockId, std::unordered_set<AtomBl
for (auto atom_blk_id : atom_ctx.nlist.blocks()) {
ClusterBlockId clb_index = atom_ctx.lookup.atom_clb(atom_blk_id);

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