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

index eee5542a7753b14ae62edfeb3a1094fd1f668b9e..c2a3c4fc63caaed8b85c1908879c8b88c8f68a5a 100644 (file)
@@ -578,6 +578,66 @@ int ses_layout_function(ScfEfunction* f, int d)
                }
        }
 
+       for (i = 0; i < f->n_components; i++) {
+               c0 =        f->components[i];
+
+               for (j = 0; j < c0->n_pins - 1; j++) {
+                       p0 =        c0->pins[j];
+
+                       if (p0->x > 0)
+                               continue;
+
+                       for (k = j + 1; k < c0->n_pins; k++) {
+                               p1 =        c0->pins[k];
+
+                               if (p1->x > 0)
+                                       continue;
+
+                               int y0 = p0->y < p1->y ? p0->y : p1->y;
+                               int y1 = p0->y < p1->y ? p1->y : p0->y;
+
+                               for (m = 0; m < f->n_components; m++) {
+                                       c1 =        f->components[m];
+
+                                       if (c0 == c1)
+                                               continue;
+
+                                       for (n = 0; n < c1->n_pins - 1; n++) {
+                                               p2 =        c1->pins[n];
+
+                                               if (p2->x < 0)
+                                                       continue;
+
+                                               for (q = n + 1; q < c1->n_pins; q++) {
+                                                       p3 =        c1->pins[q];
+
+                                                       if (p3->x < 0)
+                                                               continue;
+
+                                                       if (p2->y - p3->y <= d && p2->y - p3->y >= -d)
+                                                               continue;
+
+                                                       int y2 = p2->y < p3->y ? p2->y : p3->y;
+                                                       int y3 = p2->y < p3->y ? p3->y : p2->y;
+
+                                                       if ((y0 < y2 && y2 < y1 && y1 < y3) || (y2 < y0 && y0 < y3 && y3 < y1))
+                                                               goto next;
+                                               }
+                                       }
+                               }
+
+                               if (p0->x < 0)
+                                       p0->x = -p0->x;
+
+                               if (p1->x < 0)
+                                       p1->x = -p1->x;
+                               scf_loge("c0: %ld, p0->x: %d, p1->x: %d\n", c0->id, p0->x, p1->x);
+                       }
+               }
+next:
+               c0 = NULL;
+       }
+
        for (i = 0; i < f->n_components; i++) {
                c0 =        f->components[i];