From 8da5013985090ab60e30c4e3d116a85769083d09 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 17 Oct 2023 01:10:17 +0800 Subject: [PATCH] ses_layout_function() --- ses_layout.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index d9ecdb2..548723e 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -483,8 +483,8 @@ static void __ses_layout_components(ScfEfunction* f, int d) p0 = c->pins[el0->pins[m + 1]]; p1 = c->pins[el1->pins[n + 1]]; - p0->x = el0->lines[0]->x1 + j * d + 10 + rand() % d; - p1->x = el1->lines[0]->x1 + j * d + 10 + rand() % d; + p0->x = el0->lines[0]->x1 + j * d + 10 + rand() % 20; + p1->x = el1->lines[0]->x1 + j * d + 10 + rand() % 20; p0->y = el0->lines[0]->y0; p1->y = el1->lines[0]->y0; @@ -514,7 +514,7 @@ static void __ses_layout_components(ScfEfunction* f, int d) if (0 == p0->x) { - p0->x = el0->lines[0]->x1 + d + 10 + rand() % d; + p0->x = el0->lines[0]->x1 + d + 10 + rand() % 20; p0->y = el0->lines[0]->y1; el0->lines[0]->x1 = p0->x; @@ -738,6 +738,7 @@ int ses_layout_function(ScfEfunction* f, int d) { ScfEcomponent* c; ScfEline* el; + ScfEline* el2; ScfEpin* p0; ScfEpin* p1; @@ -838,10 +839,21 @@ int ses_layout_function(ScfEfunction* f, int d) cx = c->x; for (k = 0; k < c->n_pins; k++) { + p1 = c->pins[k]; + if (k < 2) - c->pins[k]->x = c->x; + p1->x = c->x; else - c->pins[k]->x += c->x - tmp; + p1->x += c->x - tmp; + + el2 = f->elines[p1->lid]; + + if (el2->lines[0]->x1 < p1->x) { + el2->lines[0]->x1 = p1->x; + + if (f->w < p1->x) + f->w = p1->x; + } } if (x0 > p0->x) @@ -853,9 +865,12 @@ int ses_layout_function(ScfEfunction* f, int d) el->lines[0]->x0 = x0; el->lines[0]->x1 = x1; + + if (f->w < x1) + f->w = x1; } - f->w -= mx - 3 * d + px - nx; + f->w += d; f->h += d; scf_loge("f->x: %d, y: %d, w: %d, h: %d\n", f->x, f->y, f->w, f->h); -- 2.25.1