_topo_path_completes()
authoryu.dongliang <18588496441@163.com>
Sun, 12 Nov 2023 15:21:09 +0000 (23:21 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 12 Nov 2023 15:21:09 +0000 (23:21 +0800)
ses_step_topo.c
ses_steps.c

index caaf14814b0c39c6d9b32db3d6f490ffa9355ac4..6555c9963864add05b5c29820aaab88b2b06d392 100644 (file)
@@ -355,19 +355,23 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths)
        int j;
        int k;
 
-       for (i    = paths->size - 1; i >= 1; i--) {
+       for (i    = 0; i < paths->size; ) {
                path0 = paths->data[i];
 
                p0 = path0->pins->data[0];
                p1 = path0->pins->data[path0->pins->size - 1];
 
-               if (p1->lid != Bn->lid)
+               if (p1->lid != Bn->lid) {
+                       i++;
                        continue;
+               }
 
-               if (p0->lid == Bp->lid)
+               if (p0->lid == Bp->lid) {
+                       i++;
                        continue;
+               }
 
-               for (j    = paths->size - 1; j >= 0; j--) {
+               for (j    = 0; j < paths->size; j++) {
                        path1 = paths->data[j];
 
                        if (path1 == path0)
@@ -379,24 +383,14 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths)
                        if (p2->lid != Bp->lid)
                                continue;
 
-//                     if (p3->lid == Bn->lid)
-//                             continue;
+                       if (p3->lid == Bn->lid)
+                               continue;
 
                        for (k = path1->pins->size - 1; k >= 0; k -= 2) {
                                p  = path1->pins->data[k];
 
-                               if (p->lid == p0->lid) {
-                                       c0 = f->components[p0->cid];
-                                       c1 = f->components[p->cid];
-
-                                       if (SCF_EDA_NPN == c0->type) {
-                                               if (SCF_EDA_NPN_C == p0->id)
-                                                       break;
-                                               else if (SCF_EDA_NPN != c1->type || SCF_EDA_NPN_C != p->id)
-                                                       break;
-                                       } else if (SCF_EDA_NPN != c1->type)
-                                               break;
-                               }
+                               if (p->lid == p0->lid)
+                                       break;
                        }
 
                        if (k > 0) {
@@ -444,6 +438,9 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths)
                                break;
                        }
                }
+
+               if (path0)
+                       i++;
        }
 
        return 0;
index 25503856b0677eebcde5ba0130be459d023274a4..c6fc664140627af32c85c90cc73bf1a336d57c5d 100644 (file)
@@ -38,7 +38,7 @@ static ses_step_t*  ses_steps_1[] =
 
 //     &ses_step_simplify,
        &ses_step_topo,
-#if 0
+#if 1
        &ses_step_jr,
 
        &ses_step_va_diode,
@@ -144,7 +144,7 @@ int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count)
                        return ret;
 
                int j;
-               for (j = 0; j < 1; j++) {
+               for (j = 0; j < 3; j++) {
                        printf("\n\033[33m%s(), %d(), j: %d\033[0m\n", __func__, __LINE__, j);
 
                        ret = __ses_steps_analyse(f, ns, i, ctx);