ses_flow_jr()
authoryu.dongliang <18588496441@163.com>
Fri, 15 Sep 2023 09:08:47 +0000 (17:08 +0800)
committeryu.dongliang <18588496441@163.com>
Fri, 15 Sep 2023 09:08:47 +0000 (17:08 +0800)
ses_steps.c

index 3ed7fcc027f2153457146f95ce33ad1606055c72..6c2d001b57846033d7a95acb3b17731298e69f8f 100644 (file)
@@ -86,6 +86,7 @@ void ses_flow_jr(ses_flow_t* flow)
 
        ses_path_t* path;
        ScfEpin*    p;
+       ScfEpin*    p0;
        ScfEpin*    vip = flow->vip;
 
        int i;
@@ -116,21 +117,39 @@ void ses_flow_jr(ses_flow_t* flow)
        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);
        }
 }