Skip to content

Commit b46a8ed

Browse files
Remove atom_clb and atom_net global context mutation from packer
1 parent 5090124 commit b46a8ed

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

vpr/src/base/clustered_netlist.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,15 @@ ClusterNetId ClusteredNetlist::create_net(const std::string& name) {
170170
}
171171

172172
void ClusteredNetlist::remove_block_impl(const ClusterBlockId blk_id) {
173+
AtomPBBimap& atom_pb_bimap = g_vpr_ctx.mutable_atom().mutable_lookup().mutable_atom_pb_bimap();
174+
AtomBlockId atom_blk_id = atom_pb_bimap.pb_atom(block_pbs_[blk_id]);
175+
176+
// Remove the corresponding atom_clb lookup entry from global context (if exsits)
177+
if (atom_blk_id) {
178+
g_vpr_ctx.mutable_atom().mutable_lookup().set_atom_clb(atom_blk_id, ClusterBlockId::INVALID());
179+
}
173180
//Remove & invalidate pointers
174-
free_pb(block_pbs_[blk_id], g_vpr_ctx.mutable_atom().mutable_lookup().mutable_atom_pb_bimap());
181+
free_pb(block_pbs_[blk_id], atom_pb_bimap);
175182
delete block_pbs_[blk_id];
176183
block_pbs_.insert(blk_id, NULL);
177184
block_types_.insert(blk_id, NULL);

vpr/src/pack/pack.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,8 @@ bool try_pack(const t_packer_opts& packer_opts,
250250
VPR_FATAL_ERROR(VPR_ERROR_OTHER, "Failed to find device which satisfies resource requirements required: %s (available %s)", resource_reqs.c_str(), resource_avail.c_str());
251251
}
252252

253-
//Reset clustering for re-packing
254-
for (auto net : g_vpr_ctx.atom().netlist().nets()) {
255-
g_vpr_ctx.mutable_atom().mutable_lookup().remove_atom_net(net);
256-
}
253+
//Reset floorplanning constraints for re-packing
257254
g_vpr_ctx.mutable_floorplanning().cluster_constraints.clear();
258-
//attraction_groups.reset_attraction_groups();
259255

260256
// Reset the cluster legalizer for re-clustering.
261257
cluster_legalizer.reset();

vpr/src/util/vpr_utils.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ int num_ext_inputs_atom_block(AtomBlockId blk_id) {
13661366

13671367
/**
13681368
* @brief Free pb and remove its lookup data.
1369-
* CLB lookup data is removed from the global context
1369+
* CLB lookup data is *not* removed from the global context
13701370
* and PB to Atom bimap data is removed from atom_pb_bimap
13711371
*
13721372
* @param pb
@@ -1411,11 +1411,8 @@ void free_pb(t_pb* pb, AtomPBBimap& atom_pb_bimap) {
14111411

14121412
} else {
14131413
/* Primitive */
1414-
auto& atom_ctx = g_vpr_ctx.mutable_atom();
14151414
auto blk_id = atom_pb_bimap.pb_atom(pb);
14161415
if (blk_id) {
1417-
//Update atom netlist mapping
1418-
atom_ctx.mutable_lookup().set_atom_clb(blk_id, ClusterBlockId::INVALID());
14191416
atom_pb_bimap.set_atom_pb(blk_id, nullptr);
14201417
}
14211418
atom_pb_bimap.set_atom_pb(AtomBlockId::INVALID(), pb);

0 commit comments

Comments
 (0)