Skip to content

Commit 5226207

Browse files
author
MohamedElgammal
committed
Implement a function to build the atom cluster lookup
1 parent 6a93c67 commit 5226207

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

vpr/src/pack/cluster_util.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,3 +3676,17 @@ t_pb* get_top_level_pb(t_pb* pb) {
36763676

36773677
return top_level_pb;
36783678
}
3679+
3680+
3681+
void init_clb_atoms_lookup(vtr::vector<ClusterBlockId, std::unordered_set<AtomBlockId>>& atoms_lookup) {
3682+
auto& atom_ctx = g_vpr_ctx.atom();
3683+
auto& cluster_ctx = g_vpr_ctx.clustering();
3684+
3685+
atoms_lookup.resize(cluster_ctx.clb_nlist.blocks().size());
3686+
3687+
for (auto atom_blk_id : atom_ctx.nlist.blocks()) {
3688+
ClusterBlockId clb_index = atom_ctx.lookup.atom_clb(atom_blk_id);
3689+
3690+
atoms_lookup[clb_index].insert(atom_blk_id);
3691+
}
3692+
}

vpr/src/pack/cluster_util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,4 +451,5 @@ bool cleanup_pb(t_pb* pb);
451451

452452
void alloc_and_load_pb_stats(t_pb* pb, const int feasible_block_array_size);
453453

454+
void init_clb_atoms_lookup(vtr::vector<ClusterBlockId, std::unordered_set<AtomBlockId>>& atoms_lookup);
454455
#endif

0 commit comments

Comments
 (0)