ses_path_t* path;
ScfEpin* p;
+ ScfEpin* p0;
ScfEpin* vip = flow->vip;
int i;
for (i = 0; i < flow->paths->size; i++) {
path = flow->paths->data[i];
+ p0 = NULL;
for (j = 0; j < path->pins->size; j++) {
p = path->pins->data[j];
- if (p->lid == vip->lid) {
+ if (!p0) {
+ if (p->lid == vip->lid)
+ p0 = p;
+ continue;
+ }
- vip = path->pins->data[path->pins->size - 1];
+ if (p->sr != p->pr) {
- flow->nr += vip->pr - p->pr;
- flow->jnr += vip->jpr - p->jpr;
+ flow->nr += p->sr - p0->pr;
+ flow->jnr += p->jsr - p0->jpr;
- scf_loge("flow->nr: %lg + j%lg, c%ldp%ld->pr: %lg + j%lg, vip c%ldp%ld->pr: %lg + j%lg\n",
- flow->nr, flow->jnr, p->cid, p->id, p->pr, p->jpr, vip->cid, vip->id, vip->pr, vip->jpr);
- break;
+ scf_logw("flow->nr: %lg + j%lg, c%ldp%ld->sr: %lg + j%lg, p0 c%ldp%ld->pr: %lg + j%lg\n",
+ flow->nr, flow->jnr, p->cid, p->id, p->sr, p->jsr, p0->cid, p0->id, p0->pr, p0->jpr);
+
+ p0 = p;
}
}
+
+ assert(p0);
+
+ vip = path->pins->data[j - 1];
+
+ if (vip != p0) {
+ flow->nr += vip->sr - p0->pr;
+ flow->jnr += vip->jsr - p0->jpr;
+ }
+
+ scf_loge("flow->nr: %lg + j%lg, vip c%ldp%ld->sr: %lg + j%lg, p0 c%ldp%ld->pr: %lg + j%lg\n",
+ flow->nr, flow->jnr, vip->cid, vip->id, vip->sr, vip->jsr, p0->cid, p0->id, p0->pr, p0->jpr);
}
}