p1 = path->pins->data[j - 1];
c1 = f->components[p1->cid];
-// if (SCF_EDA_NPN == c1->type && SCF_EDA_NPN_E == p1->id)
-// p1 = path->pins->data[j - 2];
+ if (SCF_EDA_NPN == c1->type && SCF_EDA_NPN_E == p1->id)
+ p1 = path->pins->data[j - 2];
} else {
*r = 0;
*jr = 0;
*r = p1->pr - p0->pr;
*jr = p1->jpr - p0->jpr;
}
- scf_loge("c%ldp%ld-c%ldp%ld, r: %lg, p0->pr: %lg, p1->pr: %lg\n", p0->cid, p0->id, p1->cid, p1->id, *r, p0->pr, p1->pr);
+ scf_logd("c%ldp%ld-c%ldp%ld, r: %lg, p0->pr: %lg, p1->pr: %lg\n", p0->cid, p0->id, p1->cid, p1->id, *r, p0->pr, p1->pr);
}
static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
r += _r;
jr += _jr;
- scf_logi("c%ldp%ld--c%ldp%ld, r: %lg, v: %lg, _r: %lg\n", pi->cid, pi->id, pj->cid, pj->id, r, v, _r);
+ scf_logd("c%ldp%ld--c%ldp%ld, r: %lg, v: %lg, _r: %lg\n", pi->cid, pi->id, pj->cid, pj->id, r, v, _r);
i = info->j;
}
ScfEcomponent* c;
ScfEline* el;
- ScfEpin* p;
ScfEpin* p0;
ScfEpin* p1;
ScfEpin* pi;
ScfEpin* pj;
- int i;
int j;
if (path->n_diodes * 2 >= path->pins->size) {
p1->v = el->v;
p1->jv = el->jv;
- double v = p0->v - p1->v;
- double jv = p0->jv - p1->jv;
+ double v;
+ double jv;
- double r = 0;
- double jr = 0;
+ double r;
+ double jr;
double a;
double ja;
- __ses_path_a_diode(f, path, 0, &a, &ja);
-
- path->a = a;
- path->ja = ja;
-
- i = 0;
-
- scf_logi("**************\n");
-
for (j = 0; j < path->diodes->size; j++) {
info = path->diodes->data[j];
pi = path->pins->data[info->i];
assert((SCF_EDA_Diode == c->type && SCF_EDA_Diode_POS == pi->id)
|| (SCF_EDA_NPN == c->type && SCF_EDA_NPN_B == pi->id));
+ __ses_path_a_diode(f, path, j, &a, &ja);
+
+ if (0 == j) {
+ path->a = a;
+ path->ja = ja;
+ }
+
pi->a = a;
pi->ja = ja;
- scf_logi("j: %d, ---------------\n", j);
-
- __ses_path_pr(f, path, i, info->i, NULL, &r, &jr);
+ __ses_path_pr(f, path, 0, info->i, NULL, &r, &jr);
ses_ir_u(&v, &jv, a, ja, r, jr);
info->i, info->j, pi->cid, pi->id, pj->cid, pj->id, pi->v, pj->v, pi->a);
__ses_path_dr_forward(f, path, info->i, info->j, pi->a, pi->ja);
- printf("\n");
}
return 0;