From: yu.dongliang <18588496441@163.com> Date: Tue, 3 Oct 2023 08:21:56 +0000 (+0800) Subject: __ses_path_dr2() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=914012d561cde148315265fe9aff626ac468a22c;p=ses.git __ses_path_dr2() --- 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); } } }