From 89bf518d3320855a364cf8d0bf2a454e3a67ec07 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Fri, 27 Oct 2023 22:51:16 +0800 Subject: [PATCH] __ses_path_va_diode() --- ses_step_va_diode.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ses_step_va_diode.c b/ses_step_va_diode.c index 0b8e444..877bb19 100644 --- a/ses_step_va_diode.c +++ b/ses_step_va_diode.c @@ -215,6 +215,11 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path) int i; int j; + if (path->n_diodes * 2 >= path->pins->size) { + scf_loge("all components are diodes\n\n"); + return -1; + } + p0 = path->pins->data[0]; p1 = path->pins->data[path->pins->size - 1]; @@ -248,7 +253,7 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path) r += pj->pr - pj->r - pi->pr; jr += pj->jpr - pj->jr - pi->jpr; - scf_logi("i: %d, info->i: %d, c%ldp%ld--c%ldp%ld, r: %lg, v: %lg\n", i, info->i, pi->cid, pi->id, pj->cid, pj->id, r, v); + scf_logi("c%ldp%ld--c%ldp%ld, r: %lg, v: %lg\n", pi->cid, pi->id, pj->cid, pj->id, r, v); i = info->j; } @@ -259,11 +264,13 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path) r += p1->sr - p1->r - pi->pr; jr += p1->jsr - p1->jr - pi->jpr; - scf_logi("i: %d, info->i: %d, c%ldp%ld--c%ldp%ld, r: %lg, v: %lg\n", i, path->pins->size - 1, pi->cid, pi->id, p1->cid, p1->id, r, v); + scf_logi("c%ldp%ld--c%ldp%ld, r: %lg, v: %lg\n", pi->cid, pi->id, p1->cid, p1->id, r, v); } ses_ur_i(&a, &ja, v, jv, r, jr); + scf_loge("c%ldp%ld--c%ldp%ld, r: %lg, v: %lg, a: %lg\n\n", p0->cid, p0->id, p1->cid, p1->id, r, v, a); + path->a = a; path->ja = ja; @@ -292,6 +299,9 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path) pj->v = pi->v - info->n_diodes * SCF_EDA_V_Diode_ON - info->n_NPNs * SCF_EDA_V_NPN_ON; pj->jv = pi->jv; + scf_logi("c%ldp%ld->v: %lg, c%ldp%ld->v: %lg, c%ldp%ld->v: %lg, r: %lg, v: %lg, a: %lg\n", + p0->cid, p0->id, p0->v, pi->cid, pi->id, pi->v, pj->cid, pj->id, pj->v, r, v, a); + el = f->elines[pi->lid]; el->a = a; el->ja = ja; -- 2.25.1