#include"ses_core.h"
-void __ses_path_split_i(ses_path_t* path, ScfEpin* p0, ScfEpin* p1, double la, double jla, double* a, double* ja)
+void __ses_path_split_i(ses_path_t* path, int i, int j, double la, double jla, double* a, double* ja)
{
ses_path_t* child;
ScfEpin* cp0;
ScfEpin* cp1;
+ ScfEpin* p0 = path->pins->data[i];
+ ScfEpin* p1 = path->pins->data[j];
double v = p0->v - p1->v;
double jv = p0->jv - p1->jv;
double r = p1->pr - p0->pr;
double jr = p1->jpr - p0->jpr;
- int j;
- for (j = 0; j < path->childs->size; j++) {
- child = path->childs->data[j];
+ scf_loge("c%ldp%ld--c%ldp%ld, r: %lg, p1->pr: %lg, p0->pr: %lg, p1->sr: %lg, p0->sr: %lg\n",
+ p0->cid, p0->id, p1->cid, p1->id, r, p1->pr, p0->pr, p1->sr, p0->sr);
+
+ int k;
+ for (k = 0; k < path->childs->size; k++) {
+ child = path->childs->data[k];
cp0 = child->pins->data[0];
cp1 = child->pins->data[child->pins->size - 1];
cp0->jv = p0->jv;
if (child->childs)
- __ses_path_split_i(child, cp0, cp1, child->a, child->ja, &cp1->a, &cp1->ja);
+ __ses_path_split_i(child, 0, child->pins->size - 1, child->a, child->ja, &cp1->a, &cp1->ja);
cp0->a = cp1->a;
cp0->ja = cp1->ja;
cp1->dr -= cp1->sr;
cp1->jdr -= cp1->jsr;
- scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg + j%lg, child->r: %lg + j%lg, cp1->a: %lg + j%lg, el->a: %lg + j%lg, cp1->dr: %lg + j%lg\n",
- j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, jv, child->r, child->jr, cp1->a, cp1->ja, la, jla, cp1->dr, cp1->jdr);
+ scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, child->r: %lg, r: %lg, cp1->a: %lg, el->a: %lg, cp1->dr: %lg\n",
+ j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, child->r, r, cp1->a, la, cp1->dr);
}
}
pj->ja = ja;
if (path->childs)
- __ses_path_split_i(path, pj, p1, a, ja, &pj->a, &pj->ja);
+ __ses_path_split_i(path, j, path->pins->size - 1, a, ja, &pj->a, &pj->ja);
scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, pj->v: %lg, pj->a: %lg, pr: %lg, sr: %lg\n\n",
j, pj->cid, pj->id, p1->cid, p1->id, v, pj->v, pj->a, pr, sr);
pj->a = a;
pj->ja = ja;
+ scf_logw("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, pj->v: %lg, pj->a: %lg, pr: %lg, sr: %lg\n\n",
+ j, pj->cid, pj->id, p1->cid, p1->id, v, pj->v, pj->a, pr, sr);
+
if (path->childs)
- __ses_path_split_i(path, pj, p1, a, ja, &pj->a, &pj->ja);
+ __ses_path_split_i(path, j, path->pins->size - 1, a, ja, &pj->a, &pj->ja);
scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, pj->v: %lg, pj->a: %lg, pr: %lg, sr: %lg\n\n",
j, pj->cid, pj->id, p1->cid, p1->id, v, pj->v, pj->a, pr, sr);
pi->ja = ja;
if (path->childs)
- __ses_path_split_i(path, p0, pi, a, ja, &pi->a, &pi->ja);
+ __ses_path_split_i(path, 0, i, a, ja, &pi->a, &pi->ja);
__ses_path_dr_reverse(f, path, 0, i, pi->n_diodes, pi->a, pi->ja);
pi->ja = ja;
if (path->childs)
- __ses_path_split_i(path, p0, pi, a, ja, &pi->a, &pi->ja);
+ __ses_path_split_i(path, 0, i, a, ja, &pi->a, &pi->ja);
p = c->pins[SCF_EDA_Transistor_B];