From: yu.dongliang <18588496441@163.com> Date: Tue, 7 Nov 2023 16:59:41 +0000 (+0800) Subject: tmp X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=d8c2e295429197668b00f7f4ff0cd7ba5deb8ca2;p=ses.git tmp --- diff --git a/ses_layout.c b/ses_layout.c index 131efaf..d17fb4a 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -539,6 +539,9 @@ int epath_cmp_pins(const void* v0, const void* v1) static inline void eline_mov_before(ScfEfunction* f, intptr_t dst, intptr_t src) { + if (dst == src) + return; + ScfEline* el = f->elines[src]; intptr_t i; @@ -549,8 +552,12 @@ static inline void eline_mov_before(ScfEfunction* f, intptr_t dst, intptr_t src) f->elines[i] = f->elines[i - 1]; f->elines[dst] = el; + + scf_logd("f->elines[%ld]->id: %ld, f->elines[%ld]->id: %ld\n", src, f->elines[src]->id, dst, f->elines[dst]->id); } +int _topo_print(scf_vector_t* paths); + static int __ses_layout_lines4(ScfEfunction* f) { scf_vector_t* paths; @@ -579,6 +586,8 @@ static int __ses_layout_lines4(ScfEfunction* f) scf_vector_qsort(paths, epath_cmp_pins); + _topo_print(paths); + B = f->components[0]; Bp = B->pins[SCF_EDA_Battery_POS]; Bn = B->pins[SCF_EDA_Battery_NEG]; @@ -604,6 +613,7 @@ static int __ses_layout_lines4(ScfEfunction* f) p = Bpath->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++) { path = paths->data[i]; @@ -612,6 +622,7 @@ static int __ses_layout_lines4(ScfEfunction* f) continue; __n = __ses_find_eline_index(f, Bn->lid); + scf_logd("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]; @@ -621,6 +632,8 @@ static int __ses_layout_lines4(ScfEfunction* f) if (p->lid == Bp->lid) { __n = __ses_find_eline_index(f, Bp->lid); + + scf_logw("__n: %ld, l%ld\n", __n, f->elines[__n]->id); break; } } @@ -629,7 +642,6 @@ static int __ses_layout_lines4(ScfEfunction* f) n = __ses_find_eline_index(f, p->lid); eline_mov_before(f, __n, n); - __n = n; } } @@ -648,8 +660,8 @@ static int __ses_layout_lines4(ScfEfunction* f) n = __ses_find_eline_index(f, p->lid); eline_mov_before(f, __n, n); - __n = n; } + printf("\n"); } ret = 0; @@ -1233,7 +1245,7 @@ static inline void __ses_xchg_cx2(ScfEcomponent* c0, ScfEcomponent* c1) SCF_XCHG(c0->x, c1->x); - scf_logw("c%ld <--> c%ld, color: %ld, %ld, cx: %d, %d\n", c0->id, c1->id, c0->color, c1->color, c0->x, c1->x); + scf_logd("c%ld <--> c%ld, color: %ld, %ld, cx: %d, %d\n", c0->id, c1->id, c0->color, c1->color, c0->x, c1->x); for (i = 0; i < c0->n_pins; i++) { p = c0->pins[i]; diff --git a/ses_step_topo.c b/ses_step_topo.c index 06838cd..5a7799f 100644 --- a/ses_step_topo.c +++ b/ses_step_topo.c @@ -466,7 +466,7 @@ static int _topo_diodes(ScfEfunction* f, ses_path_t* path) return 0; } -static int _topo_print(scf_vector_t* paths) +int _topo_print(scf_vector_t* paths) { ses_path_t* path; @@ -605,7 +605,7 @@ int __ses_topo_paths(ScfEfunction* f, scf_vector_t* paths) if (ret < 0) return ret; - _topo_print(paths); +// _topo_print(paths); return 0; }