tmp
authoryu.dongliang <18588496441@163.com>
Tue, 7 Nov 2023 16:59:41 +0000 (00:59 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 7 Nov 2023 16:59:41 +0000 (00:59 +0800)
ses_layout.c
ses_step_topo.c

index 131efaf3e33c4713613ccb6c1d124f037c87c7ef..d17fb4abef3c9e0b0b7b3f6bc2b3638d03845adf 100644 (file)
@@ -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];
index 06838cd6802b869c6ac403fc62b4e6c3318a32c8..5a7799ffbaf6735afdfa92dcf65cf7bc1cf25dfe 100644 (file)
@@ -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;
 }