ses_step_va
authoryu.dongliang <18588496441@163.com>
Sun, 10 Sep 2023 07:26:49 +0000 (15:26 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 10 Sep 2023 07:26:49 +0000 (15:26 +0800)
ses_step_va.c
ses_steps.c

index 4a2a2ef05c549ec827651f212feb16ba79237f6b..577189bdc91ecae21eab5d5ca307f53afe16f3c2 100644 (file)
@@ -103,12 +103,14 @@ static int __ses_path_va(ScfEfunction* f, ses_path_t* path)
                p->v   = p0->v  - v;
                p->jv  = p0->jv - jv;
 
+               scf_loge("path: %d, v: %lg + j%lg, p->sr: %lg + j%lg, a: %lg + j%lg\n", path->index, v, jv, p->sr, p->jsr, a, ja);
+
                el     = f->elines[p->lid];
                el->v  = p->v;
                el->jv = p->jv;
 
-               r     += p->r;
-               jr    += p->jr;
+               r     += p->r  + p->dr;
+               jr    += p->jr + p->jdr;
 
                if (i & 0x1) {
                        c    = f->components[p->cid];
@@ -120,17 +122,31 @@ static int __ses_path_va(ScfEfunction* f, ses_path_t* path)
 
                        ses_ur_i(&p->a, &p->ja, dv, jdv, r, jr);
 
-                       scf_loge("i: %d, c%ldp%ld, v: %lg + j%lg, p->v: %lg + j%lg, dv: %lg + j%lg, r: %lg + j%lg, a: %lg + j%lg\n\n", i, p->cid, p->id,
-                                       v, jv, p->v, p->jv, dv, jdv, r, jr, p->a, p->ja);
+                       scf_loge("i: %d, c%ldp%ld, dv: %lg + j%lg, p->v: %lg + j%lg, dv: %lg + j%lg, r: %lg + j%lg, a: %lg + j%lg\n\n", i, p->cid, p->id,
+                                       dv, jdv, p->v, p->jv, dv, jdv, r, jr, p->a, p->ja);
 
                        r   = 0;
                        jr  = 0;
 
+                       if (path->childs) {
+                               for (j    = 0; j < path->childs->size; j++) {
+                                       child =        path->childs->data[j];
+
+                                       cp0 = child->pins->data[0];
+                                       cp1 = child->pins->data[child->pins->size - 1];
+
+                                       if (p->lid == cp1->lid) {
+                                               a  += child->a;
+                                               ja += child->ja;
+                                       }
+                               }
+                       }
+
                } else {
                        dv  = p->v;
                        jdv = p->jv;
 
-                       scf_loge("i: %d, c%ldp%ld, v: %lg + j%lg, p->v: %lg + j%lg\n", i, p->cid, p->id, v, jv, p->v, p->jv);
+                       scf_loge("i: %d, c%ldp%ld, dv: %lg + j%lg, p->v: %lg + j%lg, a: %lg + j%lg\n", i, p->cid, p->id, dv, jdv, p->v, p->jv, a, ja);
                }
        }
        printf("\n");
index 781c48c285e0d7a40a494cad0ddfb80f5736edf0..fea076e206406a2c35db7ff80366018b69683a46 100644 (file)
@@ -37,7 +37,9 @@ static ses_step_t*  ses_steps[] =
        &ses_step_jr,
        &ses_step_va_diode,
        &ses_step_va_transistor,
-//     &ses_step_va,
+
+       &ses_step_jr,
+       &ses_step_va,
 //     &ses_step_va_balance,
 
        &ses_step_output,