From 42c802b90645caf174e8675e51fc8816947e408f Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Thu, 13 Jul 2023 22:50:48 +0800 Subject: [PATCH] ses_layout_function() --- ses_layout.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ses_layout.c b/ses_layout.c index 14ae464..4d7df78 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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++) { -- 2.25.1