diff --git a/vpr/src/base/clustered_netlist_utils.cpp b/vpr/src/base/clustered_netlist_utils.cpp index a7488d9ba89..8fbdff8b658 100644 --- a/vpr/src/base/clustered_netlist_utils.cpp +++ b/vpr/src/base/clustered_netlist_utils.cpp @@ -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); + } } } diff --git a/vpr/src/pack/cluster_util.cpp b/vpr/src/pack/cluster_util.cpp index 0e12305dc70..53e6acc7fc0 100644 --- a/vpr/src/pack/cluster_util.cpp +++ b/vpr/src/pack/cluster_util.cpp @@ -3686,6 +3686,11 @@ void init_clb_atoms_lookup(vtr::vector