From 914012d561cde148315265fe9aff626ac468a22c Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 3 Oct 2023 16:21:56 +0800 Subject: [PATCH] __ses_path_dr2() --- ses_layout.c | 2 +- ses_step_va_diode.c | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index 92b578b..ebc22e9 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -1035,7 +1035,7 @@ int ses_layout_board(ScfEboard* b) return ret; } -// ses_steps_analyse(f, 5, 1); + ses_steps_analyse(f, 5, 1); x = f->x; y = f->y; diff --git a/ses_step_va_diode.c b/ses_step_va_diode.c index 53976d2..dc0b771 100644 --- a/ses_step_va_diode.c +++ b/ses_step_va_diode.c @@ -79,22 +79,14 @@ void __ses_path_dr2(ScfEfunction* f, ses_path_t* path, int i, int j, int n_diode ScfEpin* p = path->pins->data[i]; ScfEpin* p1 = path->pins->data[j]; - double v = p->v - p1->v; - double jv = p->jv - p1->jv; + double v = p->v - p1->v; + double jv = p->jv - p1->jv; - double r = p1->sr - p->sr; - double jr = p1->jsr - p->jsr; + double r; + double jr; - double dr; - double jdr; - - ses_ui_r(&dr, &jdr, v, jv, a, ja); - - dr -= r; - jdr -= jr; - - dr /= n_diodes; - jdr /= n_diodes; + v /= n_diodes; + jv /= n_diodes; int k; for (k = i; k <= j; k++) { @@ -105,10 +97,27 @@ void __ses_path_dr2(ScfEfunction* f, ses_path_t* path, int i, int j, int n_diode c = f->components[p->cid]; if (SCF_EDA_Diode == c->type && SCF_EDA_Diode_NEG == p->id) { - p->dr = dr; - p->jdr = jdr; - scf_logw("c%ldp%ld, v: %lg, r: %lg, a: %lg, dr: %lg, n_diodes: %d\n", p->cid, p->id, v, r, a, dr, n_diodes); + ses_ui_r(&p->dr, &p->jdr, v, jv, a, ja); + + p->dr -= p->r; + p->jdr -= p->jr; + + scf_logw("c%ldp%ld, v: %lg, r: %lg, a: %lg, dr: %lg, n_diodes: %d\n", p->cid, p->id, v, p->r, a, p->dr, n_diodes); + + } else if (SCF_EDA_Transistor == c->type && SCF_EDA_Transistor_B == p->id) { + + p1 = c->pins[SCF_EDA_Transistor_C]; + + ses_ui_r(&p->dr, &p->jdr, v, jv, a, ja); + + p->dr -= p->r; + p->jdr -= p->jr; + + scf_logw("c%ldp%ld, v: %lg, r: %lg, a: %lg, dr: %lg, n_diodes: %d\n", p->cid, p->id, v, p->r, a, p->dr, n_diodes); + + a *= (1 + p1->hfe); + ja *= (1 + p1->hfe); } } } -- 2.25.1