ses_paths_find_flow()
authoryu.dongliang <18588496441@163.com>
Wed, 15 Nov 2023 11:54:05 +0000 (19:54 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 15 Nov 2023 11:54:05 +0000 (19:54 +0800)
ses_step_va_balance.c
ses_utils.c

index f298c0aabacdbc8621befb8d070aea25701a8d6b..7dae08b304593ad9db55a8babf44627dfe2a0a3f 100644 (file)
@@ -1,48 +1,5 @@
 #include"ses_core.h"
 
-int ses_paths_find_flow(ses_flow_t* flow, scf_vector_t* paths, ScfEpin* vip, ses_path_t* bridge)
-{
-       ses_path_t* path;
-       ScfEpin*    p;
-
-       int i;
-       int j;
-
-       for (i = 0; i < paths->size; i++) {
-               path      = paths->data[i];
-
-               if (path == bridge)
-                       continue;
-
-               for (j = 0; j < path->pins->size; j++) {
-                       p  =        path->pins->data[j];
-
-                       if (vip ->lid == p->lid) {
-                               flow->vip  = p;
-
-                               if (scf_vector_add(flow->paths, path) < 0)
-                                       return -1;
-                               return 1;
-                       }
-               }
-
-               if (!path->childs)
-                       continue;
-
-               int ret = ses_paths_find_flow(flow, path->childs, vip, bridge);
-               if (ret < 0)
-                       return ret;
-
-               if (1 == ret) {
-                       if (scf_vector_add(flow->paths, path) < 0)
-                               return -1;
-                       return 1;
-               }
-       }
-
-       return 0;
-}
-
 static void inline __ses_bridge_i(double* i0, double* i1, double* i2, double* i3, double* i4,
                double* v0, double* v1, double* v4, double V,
                double  R0, double  R1, double  R2, double R3,  double R4,
index b098854f8f198c003c73a5b3ec8cea93b83c5da4..bab07eff8c5eeaffee32554442e187f046e012c4 100644 (file)
@@ -25,6 +25,49 @@ void ses_flow_free(ses_flow_t* flow)
        }
 }
 
+int ses_paths_find_flow(ses_flow_t* flow, scf_vector_t* paths, ScfEpin* vip, ses_path_t* bridge)
+{
+       ses_path_t* path;
+       ScfEpin*    p;
+
+       int i;
+       int j;
+
+       for (i = 0; i < paths->size; i++) {
+               path      = paths->data[i];
+
+               if (path == bridge)
+                       continue;
+
+               for (j = 0; j < path->pins->size; j++) {
+                       p  =        path->pins->data[j];
+
+                       if (vip ->lid == p->lid) {
+                               flow->vip  = p;
+
+                               if (scf_vector_add(flow->paths, path) < 0)
+                                       return -1;
+                               return 1;
+                       }
+               }
+
+               if (!path->childs)
+                       continue;
+
+               int ret = ses_paths_find_flow(flow, path->childs, vip, bridge);
+               if (ret < 0)
+                       return ret;
+
+               if (1 == ret) {
+                       if (scf_vector_add(flow->paths, path) < 0)
+                               return -1;
+                       return 1;
+               }
+       }
+
+       return 0;
+}
+
 void ses_flow_v_pos(ses_flow_t* flow, double a, double ja)
 {
        if (!flow || !flow->paths || flow->paths->size <= 0 || !flow->vip)