__ses_path_va_bridge()
authoryu.dongliang <18588496441@163.com>
Wed, 15 Nov 2023 12:58:01 +0000 (20:58 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 15 Nov 2023 12:58:01 +0000 (20:58 +0800)
ses_core.h
ses_step_va_bridge.c

index ee0ccbc12fd3c416a4f19b8623a2cc306c245b92..5b4369cdaf86042ac2720a9d96bd232357195fb2 100644 (file)
@@ -66,6 +66,9 @@ struct ses_path_s
        double         r0;
        double         jr0;
 
+       double         a0;
+       double         ja0;
+
        double         r;
        double         jr;
 
index b000508da810960e4f5f112c7ec0b9d7858b0c64..6fcb4e44694ba34cab8936c40a41f4b8b394062a 100644 (file)
@@ -1,44 +1,5 @@
 #include"ses_core.h"
 
-static int __ses_path_va_flow(ScfEfunction* f, ses_path_t* bridge, int* changed, scf_vector_t* paths)
-{
-       ses_flow_t*  flow0;
-       ses_flow_t*  flow1;
-
-       ScfEpin*     p0;
-       ScfEpin*     p1;
-
-       flow0 = ses_flow_alloc();
-       if (!flow0)
-               return -ENOMEM;
-
-       flow1 = ses_flow_alloc();
-       if (!flow1) {
-               ses_flow_free(flow0);
-               return -ENOMEM;
-       }
-
-       p0 = bridge->pins->data[0];
-       p1 = bridge->pins->data[bridge->pins->size - 1];
-
-       int ret = ses_paths_find_flow(flow0, paths, p0, bridge);
-       if (ret < 0)
-               return ret;
-
-       ret = ses_paths_find_flow(flow1, paths, p1, bridge);
-       if (ret < 0)
-               return ret;
-
-       ses_flow_print(flow0);
-       ses_flow_jr(flow0);
-       printf("\n");
-
-       ses_flow_print(flow1);
-       ses_flow_jr(flow1);
-       printf("\n");
-       return 0;
-}
-
 static int __ses_path_va_bridge(ScfEfunction* f, ses_path_t* bridge, int* changed, scf_vector_t* paths)
 {
        if (!bridge)
@@ -49,6 +10,8 @@ static int __ses_path_va_bridge(ScfEfunction* f, ses_path_t* bridge, int* change
                return -EINVAL;
        }
 
+       ses_flow_t*    flow;
+
        ScfEcomponent* B;
        ScfEline*      el;
        ScfEpin*       Bp;
@@ -84,7 +47,20 @@ static int __ses_path_va_bridge(ScfEfunction* f, ses_path_t* bridge, int* change
        scf_logw("bridge: %d, c%ldp%ld--c%ldp%ld, v: %lg, p0->v: %lg, p1->v: %lg, n_diodes: %d, p0->a: %lg, p1->a: %lg\n",
                        bridge->index, p0->cid, p0->id, p1->cid, p1->id, v, p0->v, p1->v, bridge->n_diodes, p0->a, p1->a);
 
-       return __ses_path_va_flow(f, bridge, changed, paths);
+       flow = ses_flow_alloc();
+       if (!flow)
+               return -ENOMEM;
+
+       ret = ses_paths_find_flow(flow, paths, p0, bridge);
+       if (ret < 0) {
+               ses_flow_free(flow);
+               return ret;
+       }
+
+       ses_flow_print(flow);
+       ses_flow_jr(flow);
+
+       return 0;
 }
 
 static int ses_path_va_bridge(ScfEfunction* f, ses_path_t* path, int* changed, scf_vector_t* paths)