Trim mismatched connection to be same (smallest) size
authorEddie Hung <eddie@fpgeh.com>
Sat, 21 Sep 2019 00:48:37 +0000 (17:48 -0700)
committerEddie Hung <eddie@fpgeh.com>
Sat, 21 Sep 2019 00:51:36 +0000 (17:51 -0700)
passes/techmap/techmap.cc

index 3cc3edbcb60049ed8a2de6ad2b36fef66052d40e..1d0362ad67b3e24eeece7d0942b22cbcce72a769 100644 (file)
@@ -359,6 +359,12 @@ struct TechmapWorker
                                for (auto &attr : w->attributes) {
                                        if (attr.first == ID(src))
                                                continue;
+                                       auto lhs = GetSize(extra_connect.first);
+                                       auto rhs = GetSize(extra_connect.second);
+                                       if (lhs > rhs)
+                                               extra_connect.first.remove(rhs, lhs-rhs);
+                                       else if (rhs > lhs)
+                                               extra_connect.second.remove(lhs, rhs-lhs);
                                        module->connect(extra_connect);
                                        break;
                                }