Skip to content

Commit 8dcc826

Browse files
committed
adressed PR suggestions
1 parent c45bb5e commit 8dcc826

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

vpr/src/base/atom_netlist.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ 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-
// Use insert instead of push_back
144+
// Push back new data or overwrite existing data
145145
block_models_.insert(blk_id, model);
146146
block_truth_tables_.insert(blk_id, truth_table);
147147

@@ -175,7 +175,7 @@ AtomPortId AtomNetlist::create_port(const AtomBlockId blk_id, const t_model_port
175175
if (!port_id) {
176176
port_id = Netlist::create_port(blk_id, model_port->name, model_port->size, type);
177177

178-
// Use insert instead of push_back
178+
// Push back new data or overwrite existing data
179179
port_models_.insert(port_id, model_port);
180180
associate_port_with_block(port_id, port_type(port_id), blk_id);
181181
}

vpr/src/base/atom_netlist.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class AtomNetlist : public Netlist<AtomBlockId, AtomPortId, AtomPinId, AtomNetId
165165
*/
166166

167167
/**
168-
* @brief Create or return an existing block in the netlist
168+
* @brief Create or return an existing block in the netlist. If the block already exists, its associated data (model and truth table) will be overwritten.
169169
*
170170
* @param name The unique name of the block
171171
* @param model The primitive type of the block
@@ -176,15 +176,15 @@ class AtomNetlist : public Netlist<AtomBlockId, AtomPortId, AtomPinId, AtomNetId
176176
AtomBlockId create_block(const std::string& name, const t_model* model, const TruthTable& truth_table = TruthTable());
177177

178178
/**
179-
* @brief Create or return an existing port in the netlist
179+
* @brief Create or return an existing port in the netlist. If the port already exists, its associated data (model) will be overwritten.
180180
*
181181
* @param blk_id The block the port is associated with
182182
* @param model_port The model port the port is associated with
183183
*/
184184
AtomPortId create_port(const AtomBlockId blk_id, const t_model_ports* model_port);
185185

186186
/**
187-
* @brief Create or return an existing pin in the netlist
187+
* @brief Create or return an existing pin in the netlist.
188188
*
189189
* @param port_id The port this pin is associated with
190190
* @param port_bit The bit index of the pin in the port

vpr/src/base/clustered_netlist.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ ClusterBlockId ClusteredNetlist::create_block(const char* name, t_pb* pb, t_logi
107107
if (blk_id == ClusterBlockId::INVALID()) {
108108
blk_id = Netlist::create_block(name);
109109

110+
// Push back new data or overwrite existing data
110111
block_pbs_.insert(blk_id, pb);
111112
block_types_.insert(blk_id, type);
112113

@@ -144,7 +145,7 @@ ClusterPortId ClusteredNetlist::create_port(const ClusterBlockId blk_id, const s
144145
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) {
145146
ClusterPinId pin_id = Netlist::create_pin(port_id, port_bit, net_id, pin_type_, is_const);
146147

147-
// insert
148+
// Push back new data or overwrite existing data
148149
pin_logical_index_.insert(pin_id, pin_index);
149150

150151
ClusterBlockId block_id = port_block(port_id);

vpr/src/base/clustered_netlist.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class ClusteredNetlist : public Netlist<ClusterBlockId, ClusterPortId, ClusterPi
175175

176176
public: //Public Mutators
177177
/**
178-
* @brief Create or return an existing block in the netlist
178+
* @brief Create or return an existing block in the netlist. If the block already exists, its associated data (physical block, type, and logical pins) will be overwritten.
179179
*
180180
* @param name The unique name of the block
181181
* @param pb The physical representation of the block
@@ -184,7 +184,7 @@ class ClusteredNetlist : public Netlist<ClusterBlockId, ClusterPortId, ClusterPi
184184
ClusterBlockId create_block(const char* name, t_pb* pb, t_logical_block_type_ptr type);
185185

186186
/**
187-
* @brief Create or return an existing port in the netlist
187+
* @brief Create or return an existing port in the netlist.
188188
*
189189
* @param blk_id The block the port is associated with
190190
* @param name The name of the port (must match the name of a port in the block's model)
@@ -193,7 +193,8 @@ class ClusteredNetlist : public Netlist<ClusterBlockId, ClusterPortId, ClusterPi
193193
*/
194194
ClusterPortId create_port(const ClusterBlockId blk_id, const std::string& name, BitIndex width, PortType type);
195195
/**
196-
* @brief Create or return an existing pin in the netlist
196+
* @brief Create or return an existing pin in the netlist. If the pin already exists, its associated data (logical index) will be overwritten.
197+
*
197198
*
198199
* @param port_id The port this pin is associated with
199200
* @param port_bit The bit index of the pin in the port

0 commit comments

Comments
 (0)