Skip to content

Commit c8fe4e0

Browse files
Add atom_pb_bimap locking
This lock ensures that the atom_pb_bimap structure in global context is not accessed in packing.
1 parent 7f3b274 commit c8fe4e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vpr/src/base/atom_lookup.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class AtomLookup {
2727

2828
typedef vtr::Range<pin_tnode_iterator> pin_tnode_range;
2929

30-
bool lock_atom_pb = false;
30+
bool lock_atom_pb_bimap = false;
3131

3232
public:
3333
/*
3434
* PBs
3535
*/
3636

37-
inline AtomPBBimap &mutable_atom_pb_bimap() {return atom_to_pb_bimap_;}
38-
inline const AtomPBBimap &atom_pb_bimap() const {return atom_to_pb_bimap_;}
37+
inline AtomPBBimap &mutable_atom_pb_bimap() {VTR_ASSERT(!lock_atom_pb_bimap); return atom_to_pb_bimap_;}
38+
inline const AtomPBBimap &atom_pb_bimap() const {VTR_ASSERT(!lock_atom_pb_bimap); return atom_to_pb_bimap_;}
3939

4040
/*
4141
* PB Pins

vpr/src/pack/pack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ bool try_pack(t_packer_opts* packer_opts,
176176
is_global,
177177
flat_placement_info);
178178

179-
g_vpr_ctx.mutable_atom().mutable_lookup().lock_atom_pb = true;
179+
g_vpr_ctx.mutable_atom().mutable_lookup().lock_atom_pb_bimap = true;
180180

181181
while (true) {
182182
//Cluster the netlist
@@ -320,7 +320,7 @@ bool try_pack(t_packer_opts* packer_opts,
320320
* }
321321
*/
322322
/******************** End **************************/
323-
g_vpr_ctx.mutable_atom().mutable_lookup().lock_atom_pb = false;
323+
g_vpr_ctx.mutable_atom().mutable_lookup().lock_atom_pb_bimap = false;
324324
g_vpr_ctx.mutable_atom().mutable_lookup().set_atom_to_pb_bimap(cluster_legalizer.atom_pb_lookup());
325325
//check clustering and output it
326326
check_and_output_clustering(cluster_legalizer, *packer_opts, is_clock, &arch);

0 commit comments

Comments
 (0)