Skip to content

Commit e38c0f3

Browse files
authored
Merge pull request #2711 from ZohairZaidi/netlistissue
Update Netlist Creation Function Documentation to Prevent Duplicates
2 parents d554ff9 + c19e95f commit e38c0f3

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

vpr/src/base/atom_netlist.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ 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 a new block in the netlist.
169+
*
170+
* @note If a block with the specified name already exists, the function will crash.
169171
*
170172
* @param name The unique name of the block
171173
* @param model The primitive type of the block
@@ -176,15 +178,17 @@ class AtomNetlist : public Netlist<AtomBlockId, AtomPortId, AtomPinId, AtomNetId
176178
AtomBlockId create_block(const std::string& name, const t_model* model, const TruthTable& truth_table = TruthTable());
177179

178180
/**
179-
* @brief Create or return an existing port in the netlist
181+
* @brief Create a new port in the netlist.
182+
*
183+
* @note If a port with the specified name already exists for the given block, the function will crash.
180184
*
181185
* @param blk_id The block the port is associated with
182186
* @param model_port The model port the port is associated with
183187
*/
184188
AtomPortId create_port(const AtomBlockId blk_id, const t_model_ports* model_port);
185189

186190
/**
187-
* @brief Create or return an existing pin in the netlist
191+
* @brief Create a new pin in the netlist.
188192
*
189193
* @param port_id The port this pin is associated with
190194
* @param port_bit The bit index of the pin in the port
@@ -195,7 +199,7 @@ class AtomNetlist : public Netlist<AtomBlockId, AtomPortId, AtomPinId, AtomNetId
195199
AtomPinId create_pin(const AtomPortId port_id, BitIndex port_bit, const AtomNetId net_id, const PinType pin_type, bool is_const = false);
196200

197201
/**
198-
* @brief Create an empty, or return an existing net in the netlist
202+
* @brief Create a net in the netlist
199203
*
200204
* @param name The unique name of the net
201205
*/

vpr/src/base/clustered_netlist.h

Lines changed: 5 additions & 4 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 a new block in the netlist.
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 a new 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 a new pin in the netlist.
197+
* @note If a pin with the specified ID already exists, the function will crash.
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
@@ -205,7 +206,7 @@ class ClusteredNetlist : public Netlist<ClusterBlockId, ClusterPortId, ClusterPi
205206
ClusterPinId create_pin(const ClusterPortId port_id, BitIndex port_bit, const ClusterNetId net_id, const PinType pin_type, int pin_index, bool is_const = false);
206207

207208
/**
208-
* @brief Create an empty, or return an existing net in the netlist
209+
* @brief Create a net in the netlist
209210
*
210211
* @param name The unique name of the net
211212
*/

0 commit comments

Comments
 (0)