ScfEline* el;
ScfEpin* p0;
ScfEpin* p1;
+
+ ScfEpin* p;
ScfEpin* pb;
ScfEpin* pc;
ScfEpin* pe;
if (SCF_EDA_Transistor_B != pb->id)
continue;
+ p = path->pins->data[i - 1];
+
v = p0->v - pb->v;
jv = p0->jv - pb->jv;
ses_ur_i(&el->a, &el->ja, v, jv, pr, jpr);
- pb->a = el->a;
- pb->ja = el->ja;
+ pb->a = el->a;
+ pb->ja = el->ja;
+
+ p->v = el->v;
+ p->jv = el->jv;
+ p->a = el->a;
+ p->ja = el->ja;
+
el->aconst = 1;
- if (path->childs)
+ if (path->childs) {
+
+ __ses_path_split_i(path, p0, pb, el, &p->a, &p->ja);
__ses_path_split_i(path, pb, p1, el, &pb->a, &pb->ja);
- __ses_path_dr(pb, p1, pb);
+ } else {
+ p0->a = el->a;
+ p0->ja = el->ja;
+ }
+
+ __ses_path_dr(p, p1, pb);
- scf_loge("i: %d, c%ldp%ld, v: %lg + j%lg, pb->v: %lg + j%lg, pb->a: %lg + j%lg, pr: %lg + j%lg, sr: %lg + j%lg, pb->dr: %lg + j%lg\n",
- i, pb->cid, pb->id, v, jv, pb->v, pb->jv, pb->a, pb->ja, pr, jpr, sr, jsr, pb->dr, pb->jdr);
+ scf_loge("i: %d, c%ldp%ld--c%ldp%ld, v: %lg + j%lg, pb->v: %lg + j%lg, pb->a: %lg + j%lg, pr: %lg + j%lg, sr: %lg + j%lg, pb->dr: %lg + j%lg\n",
+ i, p0->cid, p0->id, pb->cid, pb->id, v, jv, pb->v, pb->jv, pb->a, pb->ja, pr, jpr, sr, jsr, pb->dr, pb->jdr);
pc = c->pins[SCF_EDA_Transistor_C];
pe = c->pins[SCF_EDA_Transistor_E];
pe->a = pc->a + pb->a;
pe->ja = pc->ja + pb->ja;
+ pb->aconst = 1;
+ pc->aconst = 1;
+ pe->aconst = 1;
+
scf_loge("i: %d, c%ldp%ld, pc->a: %lg + j%lg\n", i, pc->cid, pc->id, pc->a, pc->ja);
scf_loge("i: %d, c%ldp%ld, pe->a: %lg + j%lg\n", i, pe->cid, pe->id, pe->a, pe->ja);
}
- printf("\n");
+
+ for (i = 1; i < path->pins->size - 1; i++) {
+ pc = path->pins->data[i];
+
+ el = f->elines [pc->lid];
+ c = f->components[pc->cid];
+
+ if (SCF_EDA_Transistor != c->type)
+ continue;
+
+ if (SCF_EDA_Transistor_C != pc->id)
+ continue;
+
+ if (!pc->aconst)
+ continue;
+
+ p = path->pins->data[i - 1];
+
+ pr = p->pr - p0->pr;
+ jpr = p->jpr - p0->jpr;
+
+ sr = p->sr - p0->sr;
+ jsr = p->jsr - p0->jsr;
+
+ 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) {
+ v = p0->v - p1->v;
+ jv = p0->jv - p1->jv;
+
+ pr = p1->sr - p0->pr;
+ jpr = p1->jsr - p0->jpr;
+
+ ses_ur_i(&pc->a, &pc->ja, v, jv, pr, jpr);
+
+ pr = p->pr - p0->pr;
+ jpr = p->jpr - p0->jpr;
+
+ ses_ir_u(&v, &jv, pc->a, pc->ja, pr, jpr);
+
+ pc->v = p0->v - v;
+ pc->jv = p0->jv - jv;
+ }
+
+ el->v = pc->v;
+ el->jv = pc->jv;
+ el->a = pc->a;
+ el->ja = pc->ja;
+
+ p->v = el->v;
+ p->jv = el->jv;
+ p->a = el->a;
+ p->ja = el->ja;
+
+ if (path->childs)
+ __ses_path_split_i(path, p0, pc, el, &p->a, &p->ja);
+ else {
+ p0->a = el->a;
+ p0->ja = el->ja;
+ }
+
+ __ses_path_dr(p, p1, pc);
+
+ scf_loge("i: %d, c%ldp%ld--c%ldp%ld, v: %lg + j%lg, pc->v: %lg + j%lg, pc->a: %lg + j%lg, pr: %lg + j%lg, sr: %lg + j%lg, pc->dr: %lg + j%lg\n",
+ i, p0->cid, p0->id, pc->cid, pc->id, v, jv, pc->v, pc->jv, pc->a, pc->ja, pr, jpr, sr, jsr, pc->dr, pc->jdr);
+ }
return 0;
}