From 4643316ff5bb2c500168ea8ae34e73c641230a65 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Wed, 8 Nov 2023 12:08:01 +0800 Subject: [PATCH] __ses_layout_path() --- ses_layout.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index 1bdcfa7..ccfe5c1 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -558,7 +558,7 @@ static inline void eline_mov_before(ScfEfunction* f, intptr_t dst, intptr_t src) int _topo_print(scf_vector_t* paths); -static int __ses_layout_path(ScfEfunction* f, ses_path_t* path, ses_path_t* base) +static void __ses_layout_path(ScfEfunction* f, ses_path_t* path, ses_path_t* base) { ScfEcomponent* c; ScfEline* el; @@ -575,7 +575,7 @@ static int __ses_layout_path(ScfEfunction* f, ses_path_t* path, ses_path_t* base bp = base->pins->data[base->pins->size - 1]; __n = __ses_find_eline_index(f, bp->lid); - scf_logd("path: %d, __n: %ld, l%ld\n", path->index, __n, f->elines[__n]->id); + scf_logw("path: %d, __n: %ld, l%ld\n", path->index, __n, f->elines[__n]->id); for (j = path->pins->size - 1; j > 0; j -= 2) { p = path->pins->data[j]; @@ -644,6 +644,27 @@ static int __ses_layout_path(ScfEfunction* f, ses_path_t* path, ses_path_t* base eline_mov_before(f, __n, n); } + printf("\n"); + + base = path; + + if (base->childs) { + for (j = 0; j < base->childs->size; j++) { + path = base->childs->data[j]; + + __ses_layout_path(f, path, base); + } + } + + if (base->bridges) { + for (j = 0; j < base->bridges->size; j++) { + path = base->bridges->data[j]; + + __ses_layout_path(f, path, base); + } + } + + scf_loge("path: %d\n\n", path->index); } static int __ses_layout_lines4(ScfEfunction* f) @@ -653,13 +674,9 @@ static int __ses_layout_lines4(ScfEfunction* f) ses_path_t* path; ScfEcomponent* B; - ScfEcomponent* c; ScfEline* el; ScfEpin* Bp; - ScfEpin* Bn; ScfEpin* p; - ScfEpin* pc; - ScfEpin* pe; intptr_t i; intptr_t j; @@ -681,7 +698,6 @@ static int __ses_layout_lines4(ScfEfunction* f) B = f->components[0]; Bp = B->pins[SCF_EDA_Battery_POS]; - Bn = B->pins[SCF_EDA_Battery_NEG]; for (i = 0; i < paths->size; i++) { base = paths->data[i]; @@ -698,12 +714,15 @@ static int __ses_layout_lines4(ScfEfunction* f) p = base->pins->data[j]; n = __ses_find_eline_index(f, p->lid); + SCF_XCHG(f->elines[n], f->elines[j / 2]); } p = base->pins->data[j - 1]; n = __ses_find_eline_index(f, p->lid); + SCF_XCHG(f->elines[n], f->elines[j / 2 + 1]); + scf_logd("j: %ld, l%ld\n", j / 2 + 1, f->elines[j / 2 + 1]->id); for (i = 0; i < paths->size; i++) { -- 2.25.1