From 977edc8e3072d39e5dd7ffbaa272a7dd9e82bb4a Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 31 Oct 2023 14:46:32 +0800 Subject: [PATCH] tmp --- ses_layout.c | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index f605985..af6da6d 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -828,14 +828,33 @@ static void __ses_de_cross(ScfEfunction* f, int d) } } } - - __ses_flip_pos(c0); } + + __ses_flip_pos(c0); next: c0 = NULL; } } +static void __ses_set_cx(ScfEfunction* f, int d) +{ + ScfEcomponent* c; + ScfEpin* p0; + ScfEpin* p1; + + size_t i; + + for (i = 0; i < f->n_components; i++) { + c = f->components[i]; + + p0 = c->pins[0]; + p1 = c->pins[1]; + + c->x = (p0->x + p1->x) / 2; + c->y = (p0->y + p1->y) / 2; + } +} + static inline void __ses_xchg_cx2(ScfEcomponent* c0, ScfEcomponent* c1) { ScfEpin* p; @@ -929,7 +948,6 @@ static void __ses_layout_cx(ScfEfunction* f, int d) ScfEcomponent* c; ScfEcomponent* c2; ScfEline* el; - ScfEline* el2; ScfEpin* p0; ScfEpin* p1; @@ -937,16 +955,6 @@ static void __ses_layout_cx(ScfEfunction* f, int d) size_t j; size_t k; - for (i = 0; i < f->n_components; i++) { - c = f->components[i]; - - p0 = c->pins[0]; - p1 = c->pins[1]; - - c->x = (p0->x + p1->x) / 2; - c->y = (p0->y + p1->y) / 2; - } - for (i = 0; i < f->n_elines; i++) { el = f->elines[i]; @@ -997,8 +1005,10 @@ static void __ses_layout_cx(ScfEfunction* f, int d) if (k < 2) p1->x = c->x; else - p1->x += c->x - tmp; + p1->x += c->x - tmp; } + + scf_logi("c%ld->x: %d\n", c->id, c->x); } qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_id); } @@ -1073,13 +1083,15 @@ int ses_layout_function(ScfEfunction* f, int d) qsort(f->elines, f->n_elines, sizeof(ScfEline*), eline_cmp_id); - __ses_de_cross (f, d); + __ses_de_cross(f, d); - __ses_layout_cx(f, d); - __ses_xchg_cx (f, d); + __ses_set_cx (f, d); + __ses_xchg_cx(f, d); __ses_xchg_npn_ce(f, d); + __ses_layout_cx(f, d); + int mx = 0; int nx = INT_MIN; int px = INT_MAX; -- 2.25.1