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++) {
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);
}
}
}