Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c062b7b

Browse files
committedAug 21, 2024·
fixed Issue When Re-Creating Elements in Atom and Clustered Netlists
1 parent 78c89f5 commit c062b7b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
 

‎vpr/src/base/atom_netlist.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ AtomBlockId AtomNetlist::create_block(const std::string& name, const t_model* mo
141141
AtomBlockId blk_id = Netlist::create_block(name);
142142

143143
//Initialize the data
144-
block_models_.push_back(model);
145-
block_truth_tables_.push_back(truth_table);
144+
// Use insert instead of push_back
145+
block_models_.insert(blk_id, model);
146+
block_truth_tables_.insert(blk_id, truth_table);
146147

147148
//Check post-conditions: size
148149
VTR_ASSERT(validate_block_sizes());
@@ -174,7 +175,8 @@ AtomPortId AtomNetlist::create_port(const AtomBlockId blk_id, const t_model_port
174175
if (!port_id) {
175176
port_id = Netlist::create_port(blk_id, model_port->name, model_port->size, type);
176177

177-
port_models_.push_back(model_port);
178+
// Use insert instead of push_back
179+
port_models_.insert(port_id, model_port);
178180
associate_port_with_block(port_id, port_type(port_id), blk_id);
179181
}
180182

‎vpr/src/base/clustered_netlist.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ ClusterPortId ClusteredNetlist::create_port(const ClusterBlockId blk_id, const s
144144
ClusterPinId ClusteredNetlist::create_pin(const ClusterPortId port_id, BitIndex port_bit, const ClusterNetId net_id, const PinType pin_type_, int pin_index, bool is_const) {
145145
ClusterPinId pin_id = Netlist::create_pin(port_id, port_bit, net_id, pin_type_, is_const);
146146

147-
pin_logical_index_.push_back(pin_index);
147+
// insert
148+
pin_logical_index_.insert(pin_id, pin_index);
148149

149150
ClusterBlockId block_id = port_block(port_id);
150151
block_logical_pins_[block_id][pin_index] = pin_id;

0 commit comments

Comments
 (0)
Please sign in to comment.