From: yu.dongliang <18588496441@163.com> Date: Sat, 30 Sep 2023 13:07:08 +0000 (+0800) Subject: ses_layout_function() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=4b226784ad82b05e2d2b1059e6b1c191f48739fd;p=ses.git ses_layout_function() --- diff --git a/ses_layout.c b/ses_layout.c index 2a00d8a..d73bf24 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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); + } + } } } }