_topo_layers()
authoryu.dongliang <18588496441@163.com>
Sat, 14 Oct 2023 08:28:29 +0000 (16:28 +0800)
committeryu.dongliang <18588496441@163.com>
Sat, 14 Oct 2023 08:28:29 +0000 (16:28 +0800)
ses_step_topo.c

index fea2e68498221975f19536cd97d6122370948003..64aa14a8054d6c854eb0e5b516b92da08efaf8d7 100644 (file)
@@ -174,10 +174,12 @@ static void _topo_path_sort(ses_path_t* path)
        scf_vector_qsort(path->childs, _ses_child_cmp);
 }
 
-static int _topo_layers(scf_vector_t* paths)
+static int _topo_layers(scf_vector_t* paths, ScfEcomponent* B)
 {
        ses_path_t*      child;
        ses_path_t*      parent;
+       ScfEpin*         Bp;
+       ScfEpin*         Bn;
        ScfEpin*         p0;
        ScfEpin*         p1;
        ScfEpin*         p;
@@ -186,6 +188,9 @@ static int _topo_layers(scf_vector_t* paths)
        int j;
        int k;
 
+       Bp = B->pins[SCF_EDA_Battery_POS];
+       Bn = B->pins[SCF_EDA_Battery_NEG];
+
        for (i = 0;  i   < paths->size; i++) {
                child        = paths->data[i];
                child->index = i;
@@ -199,6 +204,9 @@ static int _topo_layers(scf_vector_t* paths)
                p0   = child->pins->data[0];
                p1   = child->pins->data[child->pins->size - 1];
 
+               if (p0->lid == Bp->lid && p1->lid == Bn->lid)
+                       continue;
+
                for (j     = paths->size - 1; j >= 0; j--) {
                        parent = paths->data[j];
 
@@ -353,7 +361,7 @@ static int _topo_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t*
                }
        }
 
-       int ret = _topo_layers(ctx->paths);
+       int ret = _topo_layers(ctx->paths, B);
        if (ret < 0)
                return ret;