ses_layout_function()
authoryu.dongliang <18588496441@163.com>
Sat, 30 Sep 2023 13:07:08 +0000 (21:07 +0800)
committeryu.dongliang <18588496441@163.com>
Sat, 30 Sep 2023 13:07:08 +0000 (21:07 +0800)
ses_layout.c

index 2a00d8affe5a80316ab5844db36b26bbddc7de1b..d73bf245e3a4dbafaa9464c89e3a0d83829f3fb5 100644 (file)
@@ -523,42 +523,47 @@ int ses_layout_function(ScfEfunction* f, int d)
                for (m = 0; m + 3 < el0->n_pins; m += 2) {
 
                        c0 = f->components[el0->pins[m]];
+                       p0 = c0->pins     [el0->pins[m + 1]];
 
-                       if (2 != c0->n_pins)
-                               continue;
+                       for (j = 0; j < c0->n_pins; j++) {
+                               p1 =        c0->pins[j];
 
-                       p0 = c0->pins[ el0->pins[m + 1]];
-                       p1 = c0->pins[!el0->pins[m + 1]];
+                               if (p1 == p0)
+                                       continue;
 
-                       for (n = 2; n + 1 < el0->n_pins; n += 2) {
+                               for (n = 2; n + 1 < el0->n_pins; n += 2) {
 
-                               c1 = f->components[el0->pins[n]];
-                               if (2 != c1->n_pins)
-                                       continue;
+                                       c1 = f->components[el0->pins[n]];
+                                       p2 = c1->pins     [el0->pins[n + 1]];
 
-                               p2 = c1->pins[ el0->pins[n + 1]];
-                               p3 = c1->pins[!el0->pins[n + 1]];
+                                       for (k = 0; k < c1->n_pins; k++) {
+                                               p3 =        c1->pins[k];
 
-                               if (p1->y < p0->y && p3->y < p0->y) {
+                                               if (p3 == p2)
+                                                       continue;
 
-                                       if (p0->x > p2->x) {
+                                               if (p1->y < p0->y && p3->y < p0->y) {
 
-                                               if (p1->x < p3->x || p1->y > p3->y)
-                                                       SCF_XCHG(p0->x, p2->x);
+                                                       if (p0->x > p2->x) {
 
-                                       } else {
-                                               if (p1->x > p3->x || p1->y < p3->y)
-                                                       SCF_XCHG(p0->x, p2->x);
-                                       }
+                                                               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) {
+                                                       } else {
+                                                               if (p1->x > p3->x || p1->y < p3->y)
+                                                                       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);
+                                                       }
+                                               }
                                        }
                                }
                        }