From ed96d82372fb3b813f9ea8e0b0c7e34bac8d09eb Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Sun, 10 Sep 2023 22:51:23 +0800 Subject: [PATCH] ses_step_va.c, ses_step_va_transistor.c --- ses_step_va.c | 20 +++++++++++++------- ses_step_va_transistor.c | 12 ++++++------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ses_step_va.c b/ses_step_va.c index 357c9a7..9062ef1 100644 --- a/ses_step_va.c +++ b/ses_step_va.c @@ -101,18 +101,26 @@ static int __ses_path_va(ScfEfunction* f, ses_path_t* path) c = f->components[p->cid]; - if (SCF_EDA_Transistor == c->type - && (SCF_EDA_Transistor_B == p->id || SCF_EDA_Transistor_C == p->id)) { + if (SCF_EDA_Transistor == c->type) { - ses_ir_u(&v, &jv, a, ja, p->sr - (p->r + p->dr), p->jsr - (p->jr + p->jdr)); + if (SCF_EDA_Transistor_B == p->id || SCF_EDA_Transistor_C == p->id) + ses_ir_u(&v, &jv, a, ja, p->sr - (p->r + p->dr), p->jsr - (p->jr + p->jdr)); + else { + if (i < 1) { + scf_loge("\n"); + return -EINVAL; + } + + p2 = path->pins->data[i - 1]; + + ses_ir_u(&v, &jv, a, ja, p2->sr, p2->jsr); + } } else ses_ir_u(&v, &jv, a, ja, p->sr, p->jsr); p->v = p0->v - v; p->jv = p0->jv - jv; - scf_logd("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; @@ -120,8 +128,6 @@ static int __ses_path_va(ScfEfunction* f, ses_path_t* path) r += p->r + p->dr; jr += p->jr + p->jdr; - scf_logw("path: %d, i: %d, c%ldp%ld, r: %lg + j%lg, p->r: %lg + j%lg, p->dr: %lg + j%lg\n", path->index, i, p->cid, p->id, r, jr, p->r, p->jr, p->dr, p->jdr); - if (i & 0x1) { r += c->r; jr += c->jr; diff --git a/ses_step_va_transistor.c b/ses_step_va_transistor.c index 8b698e4..e7cf76f 100644 --- a/ses_step_va_transistor.c +++ b/ses_step_va_transistor.c @@ -59,11 +59,11 @@ static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path) v = p0->v - pb->v; jv = p0->jv - pb->jv; - pr = pb->pr - p0->pr; - jpr = pb->jpr - p0->jpr; + pr = p->pr - p0->pr; + jpr = p->jpr - p0->jpr; - sr = pb->sr - p0->sr; - jsr = pb->jsr - p0->jsr; + sr = p->sr - p0->sr; + jsr = p->jsr - p0->jsr; ses_ur_i(&el->a, &el->ja, v, jv, pr, jpr); @@ -141,8 +141,8 @@ static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path) v = p0->v - p1->v; jv = p0->jv - p1->jv; - pr = p1->sr - p0->pr; - jpr = p1->jsr - p0->jpr; + pr = pc->sr - p0->pr; + jpr = pc->jsr - p0->jpr; ses_ur_i(&pc->a, &pc->ja, v, jv, pr, jpr); -- 2.25.1