From 2c7462251562fdeca4ae45aa37a338a92bd19d16 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 31 Oct 2023 15:33:24 +0800 Subject: [PATCH] __ses_layout_cx() --- ses_layout.c | 64 +++++++++++++++++----------------------------------- 1 file changed, 21 insertions(+), 43 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index c724502..680354f 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -956,45 +956,13 @@ static void __ses_layout_cx(ScfEfunction* f, int d) { ScfEcomponent* c; ScfEcomponent* c2; - ScfEline* el; - ScfEpin* p0; - ScfEpin* p1; + ScfEpin* p; + ScfEpin* p2; size_t i; size_t j; size_t k; - for (i = 0; i < f->n_elines; i++) { - el = f->elines[i]; - - int cx = 0; - - qsort_r(el->pins, el->n_pins / 2, sizeof(uint64_t) * 2, epin_cmp_cx, f); - - for (j = 0; j < el->n_pins; j += 2) { - - c = f->components[el->pins[j]]; - p0 = c->pins [el->pins[j + 1]]; - - int tmp = c->x; - - if (j > 0) { - if (c->x < cx + d) - c->x = cx + d; - } - cx = c->x; - - for (k = 0; k < c->n_pins; k++) { - p1 = c->pins[k]; - - if (k < 2) - p1->x = c->x; - else - p1->x += c->x - tmp; - } - } - } - qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_cx); for (i = 1; i < f->n_components; i++) { c = f->components[i]; @@ -1002,22 +970,32 @@ static void __ses_layout_cx(ScfEfunction* f, int d) int tmp = c->x; - if (c->x > c2->x + d) - c->x = c2->x + d; + for (j = 0; j < c->n_pins; j++) { + p = c->pins[j]; + + for (k = 0; k < c2->n_pins; k++) { + p2 = c2->pins[k]; + + if (p->lid == p2->lid) { + c->x = c2->x + d; + goto _set_px; + } + } + } - if (c->x < c2->x + d / 2) - c->x = c2->x + d / 2; + c->x = c2->x + d / 2; +_set_px: for (k = 0; k < c->n_pins; k++) { - p1 = c->pins[k]; + p = c->pins[k]; if (k < 2) - p1->x = c->x; + p->x = c->x; else - p1->x += c->x - tmp; + p->x += c->x - tmp; } - scf_logi("c%ld->x: %d\n", c->id, c->x); + scf_logd("c%ld->x: %d\n", c->id, c->x); } qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_id); } @@ -1157,7 +1135,7 @@ int ses_layout_function(ScfEfunction* f, int d) __ses_xchg_cx(f, d); __ses_xchg_ce(f, d); __ses_mov_pos(f, d); -// __ses_layout_cx(f, d); + __ses_layout_cx(f, d); int tx0 = INT_MAX; int tx1 = 0; -- 2.25.1