Skip to content

Commit 724f717

Browse files
committed
Added ability to lock down clusters with primitive names
1 parent 257b53e commit 724f717

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

vpr/src/base/read_place.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ void read_place_body(std::ifstream& placement_file,
173173
auto& cluster_ctx = g_vpr_ctx.clustering();
174174
auto& device_ctx = g_vpr_ctx.device();
175175
auto& place_ctx = g_vpr_ctx.mutable_placement();
176+
auto& atom_ctx = g_vpr_ctx.atom();
176177

177178
std::string line;
178179
int lineno = 0;
@@ -218,9 +219,15 @@ void read_place_body(std::ifstream& placement_file,
218219

219220
ClusterBlockId blk_id = cluster_ctx.clb_nlist.find_block(block_name);
220221

221-
//Check if block name is valid
222+
//If block name is not found in cluster netlist check if it is in atom netlist
222223
if (blk_id == ClusterBlockId::INVALID()) {
223-
VPR_THROW(VPR_ERROR_PLACE, "Block %s has an invalid name.\n", c_block_name);
224+
AtomBlockId atom_blk_id = atom_ctx.nlist.find_block(block_name);
225+
226+
if (atom_blk_id == AtomBlockId::INVALID()) {
227+
VPR_THROW(VPR_ERROR_PLACE, "Block %s has an invalid name.\n", c_block_name);
228+
} else {
229+
blk_id = atom_ctx.lookup.atom_clb(atom_blk_id);
230+
}
224231
}
225232

226233
//Check if block is listed twice in constraints file

0 commit comments

Comments
 (0)