Skip to content

Commit 7017683

Browse files
author
MohamedElgammal
committed
Check if the lookup is built or not everytime you query it, to avoid problems of missing a stage (e.g. starting from routing)
1 parent 786fe0a commit 7017683

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

vpr/src/pack/pack.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ bool try_pack(t_packer_opts* packer_opts,
266266
/* Use the re-cluster API to edit it */
267267
/******************* Start *************************/
268268
VTR_LOG("Start the iterative improvement process\n");
269-
init_clb_atoms_lookup(helper_ctx.atoms_lookup);
270269
//iteratively_improve_packing(*packer_opts, clustering_data, 2);
271270
VTR_LOG("the iterative improvement process is done\n");
272271

vpr/src/pack/re_cluster_util.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ ClusterBlockId atom_to_cluster(const AtomBlockId& atom) {
5050

5151
std::unordered_set<AtomBlockId>* cluster_to_atoms(const ClusterBlockId& cluster) {
5252
auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
53+
54+
//If the lookup is not built yet, build it first
55+
if (helper_ctx.atoms_lookup.empty())
56+
init_clb_atoms_lookup(helper_ctx.atoms_lookup);
57+
5358
return &(helper_ctx.atoms_lookup[cluster]);
5459
}
5560

0 commit comments

Comments
 (0)