Bug fixes

This commit is contained in:
Matthias Koefferlein 2023-09-23 23:58:43 +02:00
parent 1fbb907c5b
commit 439e10c982
3 changed files with 30 additions and 1 deletions

View File

@ -408,7 +408,7 @@ void Circuit::join_nets (Net *net, Net *with)
}
while (with->begin_pins () != with->end_pins ()) {
connect_pin (with->begin_pins ()->pin_id (), net);
join_pin_with_net (with->begin_pins ()->pin_id (), net);
}
if (netlist ()->callbacks ()) {
@ -698,6 +698,25 @@ void Circuit::connect_pin (size_t pin_id, Net *net)
m_pin_refs [pin_id] = Net::pin_iterator ();
}
if (net) {
net->add_pin (NetPinRef (pin_id));
}
}
void Circuit::join_pin_with_net (size_t pin_id, Net *net)
{
if (net_for_pin (pin_id) == net) {
return;
}
if (pin_id < m_pin_refs.size ()) {
Net::pin_iterator p = m_pin_refs [pin_id];
if (! tl::is_null_iterator (p) && p->net ()) {
p->net ()->erase_pin (p);
}
m_pin_refs [pin_id] = Net::pin_iterator ();
}
if (net) {
if (net->begin_pins () != net->end_pins ()) {
join_pins (net->begin_pins ()->pin_id (), pin_id);

View File

@ -702,6 +702,15 @@ public:
*/
void connect_pin (size_t pin_id, Net *net);
/**
* @brief Adds a pin to the given net
* The pin will be added to the net. If there is already a pin
* on the net, the existing and new pin will be joined.
* This usually implies that nets further up in the hierarchy
* are joined too.
*/
void join_pin_with_net (size_t pin_id, Net *net);
/**
* @brief Renames the pin with the given ID
*/

View File

@ -712,6 +712,7 @@ Class<db::LayoutToNetlist> decl_dbLayoutToNetlist ("db", "LayoutToNetlist",
"@brief Reads the extracted netlist from the file.\n"
"This method employs the native format of KLayout.\n"
) +
// @@@ Add API for logs
gsi::method_ext ("antenna_check", &antenna_check, gsi::arg ("gate"), gsi::arg ("metal"), gsi::arg ("ratio"), gsi::arg ("diodes", std::vector<tl::Variant> (), "[]"), gsi::arg ("texts", (db::Texts *) 0, "nil"),
"@brief Runs an antenna check on the extracted clusters\n"
"\n"