__ses_path_split_v()
authoryu.dongliang <18588496441@163.com>
Sat, 7 Oct 2023 06:18:59 +0000 (14:18 +0800)
committeryu.dongliang <18588496441@163.com>
Sat, 7 Oct 2023 06:18:59 +0000 (14:18 +0800)
ses_step_va.c

index 943b819d478aba1a0da15121e31f670b2d358cee..97c75026b0ddb82ad5ebcb2ba768a6a59589e362 100644 (file)
@@ -76,6 +76,7 @@ static int __ses_path_split_a(ScfEfunction* f, ses_path_t* path, int i, double*
                n++;
        }
 
+       scf_logw("*****************\n");
        return n;
 }
 
@@ -97,32 +98,30 @@ static int __ses_path_split_v(ScfEfunction* f, ses_path_t* path, ScfEpin* p0, in
                        r  = p->sr  - (p->r  + p->dr ) - p0->sr;
                        jr = p->jsr - (p->jr + p->jdr) - p0->jsr;
 
-                       ses_ir_u(&v, &jv, a, ja, r, jr);
-
-                       scf_logd("c%ldp%ld, c%ldp%ld, a: %lg + j%lg, r: %lg + j%lg, v: %lg + j%lg\n", p0->cid, p0->id, p->cid, p->id, a, ja, r, jr, v, jv);
-
                } else if (i >= 1) {
                        p2 = path->pins->data[i - 1];
 
-                       r  = p2->sr  - p0->sr;
-                       jr = p2->jsr - p0->jsr;
-
-                       ses_ir_u(&v, &jv, a, ja, r, jr);
-
-                       scf_logd("c%ldp%ld, c%ldp%ld, a: %lg + j%lg, r: %lg + j%lg, v: %lg + j%lg\n", p0->cid, p0->id, p->cid, p->id, a, ja, r, jr, v, jv);
+                       if (p2 == p0) {
+                               r  = p0->r  + p0->dr;
+                               jr = p0->jr + p0->jdr;
+                       } else {
+                               r  = p2->sr  - p0->sr;
+                               jr = p2->jsr - p0->jsr;
+                       }
                } else
                        return -EINVAL;
 
        } else {
                r  = p->sr  - p0->sr;
                jr = p->jsr - p0->jsr;
-
-               ses_ir_u(&v, &jv, a, ja, r, jr);
        }
 
+       ses_ir_u(&v, &jv, a, ja, r, jr);
+
        p->v  = p0->v  - v;
        p->jv = p0->jv - jv;
 
+       scf_logd("c%ldp%ld, c%ldp%ld, a: %lg, r: %lg, v: %lg\n", p0->cid, p0->id, p->cid, p->id, a, r, v);
        return 0;
 }