ses_layout_function()
authoryu.dongliang <18588496441@163.com>
Thu, 13 Jul 2023 14:50:48 +0000 (22:50 +0800)
committeryu.dongliang <18588496441@163.com>
Thu, 13 Jul 2023 14:50:48 +0000 (22:50 +0800)
ses_layout.c

index 14ae46407fdcb1206f5b667f0eafdfc014e9ded7..4d7df78c8be3c1ae31a715aba32416bed87efefc 100644 (file)
@@ -362,6 +362,7 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u
        ScfEpin*       p0;
        ScfEpin*       p1;
        ScfEpin*       p2;
+       ScfEpin*       p3;
 
        size_t    i;
        size_t    j;
@@ -470,6 +471,39 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u
                }
        }
 
+       for (i = 0; i < f->n_elines; i++) {
+               el0       = f->elines[i];
+
+               for (m = 0; m + 3 < el0->n_pins; m += 2) {
+
+                       c0 = f->components[el0->pins[m]];
+
+                       if (2 != c0->n_pins)
+                               continue;
+
+                       p0 = c0->pins[ el0->pins[m + 1]];
+                       p1 = c0->pins[!el0->pins[m + 1]];
+
+                       for (n = 2; n + 1 < el0->n_pins; n += 2) {
+
+                               c1 = f->components[el0->pins[n]];
+                               if (2 != c1->n_pins)
+                                       continue;
+
+                               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 ((p0->x > p2->x && p1->x < p3->x)
+                                        || (p0->x < p2->x && p1->x > p3->x))
+                                               SCF_XCHG(p0->x, p2->x);
+                               }
+                       }
+               }
+       }
+
        scf_loge("f->x: %d, y: %d, w: %d, h: %d\n", f->x, f->y, f->w, f->h);
 
        for (i = 0; i < f->n_components; i++) {