Skip to content

Commit

Permalink
Merge pull request #2435 from verilog-to-routing/add_invalid_id_checks
Browse files Browse the repository at this point in the history
add invalid cluster id checks
  • Loading branch information
vaughnbetz committed Feb 12, 2024
2 parents f3a08de + 6ea348f commit b5b6e59
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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 @@ -3689,6 +3689,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);
}
}
}
}

0 comments on commit b5b6e59

Please sign in to comment.