From ab56cb96fad523439babae0533e1a5a83ec8cf4f Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Sun, 10 Sep 2023 15:26:49 +0800 Subject: [PATCH] ses_step_va --- ses_step_va.c | 26 +++++++++++++++++++++----- ses_steps.c | 4 +++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ses_step_va.c b/ses_step_va.c index 4a2a2ef..577189b 100644 --- a/ses_step_va.c +++ b/ses_step_va.c @@ -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"); diff --git a/ses_steps.c b/ses_steps.c index 781c48c..fea076e 100644 --- a/ses_steps.c +++ b/ses_steps.c @@ -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, -- 2.25.1