p->dr -= r;
p->jdr -= jr;
- scf_logd("c%ldp%ld, v: %lg, r: %lg, p->sr: %lg, p->a: %lg, p->dr: %lg\n",
- p->cid, p->id, v, r, p->sr, p->a, p->dr);
+ scf_logd("c%ldp%ld--c%ldp%ld, v: %lg, r: %lg, p->sr: %lg, p->a: %lg, p->dr: %lg\n",
+ p->cid, p->id, p1->cid, p1->id, v, r, p->sr, p->a, p->dr);
}
int __ses_status_check(ScfEfunction* f, ScfEcomponent* c, ScfEpin* pb, ScfEpin* pe)
ScfEcomponent* B;
ScfEline* el;
ScfEpin* p0;
- ScfEpin* p1;
+ ScfEpin* pj;
ScfEpin* Bp;
ScfEpin* Bn;
Bn = parent->pins->data[parent->pins->size - 1];
}
+ int i;
+ int j = path->pins->size - 1;
+
p0 = path->pins->data[0];
- p1 = path->pins->data[path->pins->size - 1];
+ pj = path->pins->data[j];
el = f->elines[p0->lid];
p0->v = el->v;
p0->jv = el->jv;
- el = f->elines[p1->lid];
- p1->v = el->v;
- p1->jv = el->jv;
-
- int i;
-
- for (i = 0; i < path->pins->size - 1; i++) {
- pc = path->pins->data[i];
-
- c = f->components[pc->cid];
-
- if (SCF_EDA_NPN != c->type)
- continue;
-
- if (SCF_EDA_NPN_C != pc->id)
- continue;
+ el = f->elines[pj->lid];
+ pj->v = el->v;
+ pj->jv = el->jv;
- if (!pc->aconst)
- continue;
+ for (i = path->pins->size - 1; i >= 0; i--) {
+ pc = path->pins->data[i];
+ pj = path->pins->data[j];
double v;
double jv;
double _pr;
double _jpr;
+ c = f->components[pc->cid];
+
+ scf_logd("i: %d, c%ldp%ld--c%ldp%ld, pc->v: %lg, pc->a: %lg\n", i, p0->cid, p0->id, pc->cid, pc->id, pc->v, pc->a);
+
+ if (SCF_EDA_NPN != c->type || SCF_EDA_NPN_C != pc->id) {
+
+ if (j < path->pins->size - 1) {
+
+ pc->a = pj->a;
+ pc->ja = pj->ja;
+
+ if (pc->lid != pj->lid) {
+
+ __ses_path_pr(f, path, i, j, NULL, &pr, &jpr);
+
+ ses_ir_u(&v, &jv, pj->a, pj->ja, pr, jpr);
+
+ pc->v = p0->v - v;
+ pc->jv = p0->jv - jv;
+
+ if (path->childs)
+ __ses_path_split_i(f, path, i, j, pj->a, pj->ja, &pc->a, &pc->ja);
+
+ } else {
+ pc->v = pj->v;
+ pc->jv = pj->jv;
+ }
+
+ j = i;
+ }
+ continue;
+ }
+
+ if (!pc->aconst)
+ continue;
+
__ses_path_pr(f, path, 0, i, NULL, &pr, &jpr);
ses_ir_u(&v, &jv, pc->a, pc->ja, pr, jpr);
pc->v = p0->v - v;
pc->jv = p0->jv - jv;
- if (pc->v < p1->v) {
+ if (pc->v < pj->v) {
pr += path->parent_r0;
jpr += path->parent_jr0;
- v = Bp->v - p1->v;
- jv = Bp->jv - p1->jv;
+ v = Bp->v - pj->v;
+ jv = Bp->jv - pj->jv;
_pr = pc->pr + path->parent_r0;
_jpr = pc->jpr + path->parent_jr0;
ses_ur_i(&pc->a, &pc->ja, v, jv, _pr, _jpr);
- scf_logd("i: %d, c%ldp%ld--c%ldp%ld, v: %lg, pc->v: %lg, pc->a: %lg, pr: %lg, _pr: %lg pc->pr: %lg\n",
- i, p0->cid, p0->id, pc->cid, pc->id, v, pc->v, pc->a, pr, _pr, pc->pr);
-
ses_ir_u(&v, &jv, pc->a, pc->ja, pr, jpr);
pc->v = Bp->v - v;
pc->jv = Bp->jv - jv;
+
+ scf_logd("i: %d, c%ldp%ld--c%ldp%ld, v: %lg, pc->v: %lg, pc->a: %lg, pr: %lg, _pr: %lg pc->pr: %lg\n",
+ i, p0->cid, p0->id, pc->cid, pc->id, v, pc->v, pc->a, pr, _pr, pc->pr);
}
el = f->elines[pc->lid];
i, p0->cid, p0->id, pc->cid, pc->id, v, pc->v, pc->a, pr, pc->dr);
if (path->childs) {
- __ses_path_split_i(f, path, i, path->pins->size - 1, el->a, el->ja, &pc->a, &pc->ja);
+ __ses_path_split_i(f, path, i, j, el->a, el->ja, &pc->a, &pc->ja);
if (i > 0) {
p = path->pins->data[i - 1];
p0->ja = el->ja;
}
- __ses_path_dr_transistor(f, path, i, path->pins->size - 1);
+ __ses_path_dr_transistor(f, path, i, j);
scf_loge("i: %d, c%ldp%ld--c%ldp%ld, v: %lg, pc->v: %lg, pc->a: %lg, pr: %lg, pc->dr: %lg\n\n",
i, p0->cid, p0->id, pc->cid, pc->id, v, pc->v, pc->a, pr, pc->dr);
+
+ j = i;
}
return 0;