From d2da56b149f5c2ba0b8e034547ce489316ad6311 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Sun, 16 Jul 2023 18:20:16 +0800 Subject: [PATCH] ses layout --- ses_layout.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/ses_layout.c b/ses_layout.c index eee5542..c2a3c4f 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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]; -- 2.25.1