From 10fb24ca8d0703cf56b49dffb51f4758f955f121 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Sun, 16 Jul 2023 18:50:16 +0800 Subject: [PATCH] ses_layout_function --- ses_layout.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index c528d01..67d5269 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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); + } } } } -- 2.25.1