ses_layout_function
authoryu.dongliang <18588496441@163.com>
Sun, 16 Jul 2023 10:50:16 +0000 (18:50 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 16 Jul 2023 10:50:16 +0000 (18:50 +0800)
ses_layout.c

index c528d017c475e9a82fccc35094377cf80991376b..67d526914f77e1fa215493b4e01e0c76d738041c 100644 (file)
@@ -498,12 +498,27 @@ int ses_layout_function(ScfEfunction* f, int d)
                                p2 = c1->pins[ el0->pins[n + 1]];
                                p3 = c1->pins[!el0->pins[n + 1]];
 
-                               if ((p1->y < p0->y && p3->y < p0->y)
-                                               || (p1->y > p0->y && p3->y > p0->y)) {
+                               if (p1->y < p0->y && p3->y < p0->y) {
 
-                                       if ((p0->x > p2->x && p1->x < p3->x)
-                                                       || (p0->x < p2->x && p1->x > p3->x))
-                                               SCF_XCHG(p0->x, p2->x);
+                                       if (p0->x > p2->x) {
+
+                                               if (p1->x < p3->x || p1->y > p3->y)
+                                                       SCF_XCHG(p0->x, p2->x);
+
+                                       } else {
+                                               if (p1->x > p3->x || p1->y < p3->y)
+                                                       SCF_XCHG(p0->x, p2->x);
+                                       }
+
+                               } else if (p1->y > p0->y && p3->y > p0->y) {
+
+                                       if (p0->x > p2->x) {
+                                               if (p1->x < p3->x || p1->y < p3->y)
+                                                       SCF_XCHG(p0->x, p2->x);
+                                       } else {
+                                               if (p1->x > p3->x || p1->y > p3->y)
+                                                       SCF_XCHG(p0->x, p2->x);
+                                       }
                                }
                        }
                }