}
}
-void __ses_path_dr(ScfEpin* p0, ScfEpin* p1, ScfEpin* p)
-{
- double v = p0->v - p1->v;
- double jv = p0->jv - p1->jv;
-
- double r = p1->sr - p0->sr;
- double jr = p1->jsr - p0->jsr;
-
- ses_ui_r(&p->dr, &p->jdr, v, jv, p->a, p->ja);
-
- scf_logw("c%ldp%ld, v: %lg, r: %lg, p1->sr: %lg, p0->sr: %lg, p->a: %lg, p->dr: %lg\n",
- p->cid, p->id, v, r, p1->sr, p0->sr, p->a, p->dr);
-
- p->dr -= r;
- p->jdr -= jr;
-}
-
void __ses_path_dr_forward(ScfEfunction* f, ses_path_t* path, int i, int j, int n_diodes, double a, double ja)
{
assert(n_diodes > 0);
#include"ses_core.h"
+void __ses_path_dr_transistor(ScfEfunction* f, ses_path_t* path, int i, int j)
+{
+ 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 r;
+ double jr;
+
+ __ses_path_pr(f, path, i, j, NULL, &r, &jr);
+
+ ses_ui_r(&p->dr, &p->jdr, v, jv, p->a, p->ja);
+
+ scf_logd("c%ldp%ld, v: %lg, r: %lg, p1->sr: %lg, p->sr: %lg, p->a: %lg, p->dr: %lg\n",
+ p->cid, p->id, v, r, p1->sr, p->sr, p->a, p->dr);
+
+ p->dr -= r;
+ p->jdr -= jr;
+}
+
static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path)
{
ses_path_t* child;
p0->ja = el->ja;
}
- scf_logi("i: %d, c%ldp%ld-c%ldp%ld, pc->v: %lg, pc->a: %lg, p->a: %lg\n",
- i, p0->cid, p0->id, pc->cid, pc->id, pc->v, pc->a, p->a);
-
- __ses_path_dr(p, p1, pc);
+ __ses_path_dr_transistor(f, path, i, path->pins->size - 1);
scf_loge("i: %d, c%ldp%ld--c%ldp%ld, v: %lg, pc->v: %lg, pc->a: %lg, pr: %lg, sr: %lg, pc->dr: %lg\n",
i, p0->cid, p0->id, pc->cid, pc->id, v, pc->v, pc->a, pr, sr, pc->dr);