if (cp1 != p1)
p1 = path->pins->data[j - 1];
- } else if (j > 0)
+ } else if (j > 0) {
p1 = path->pins->data[j - 1];
- else {
+ c1 = f->components[p1->cid];
+
+ if (SCF_EDA_NPN == c1->type && SCF_EDA_NPN_E == p1->id)
+ p1 = path->pins->data[j - 2];
+ } else {
*r = 0;
*jr = 0;
return;
*r = p1->pr - p0->pr;
*jr = p1->jpr - p0->jpr;
}
-
- 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);
+ 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);
}
static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
if (SCF_EDA_Diode_NEG == p->id) {
info->n_diodes++;
- if (__ses_branch_exist(path, i))
+ if (__ses_branch_exist(path, i)) {
+ j = i;
goto _add;
+ }
}
continue;
}
} else if (SCF_EDA_NPN_E == p->id) {
- if (__ses_branch_exist(path, i))
+ if (__ses_branch_exist(path, i)) {
+ j = i;
goto _add;
-
+ }
continue;
}
}
+ j = i - 1;
_add:
if (info) {
- info->j = i - 1;
+ info->j = j;
if (scf_vector_add(path->diodes, info) < 0) {
free(info);