ses_flow_jr()
authoryu.dongliang <18588496441@163.com>
Wed, 15 Nov 2023 12:19:10 +0000 (20:19 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 15 Nov 2023 12:19:10 +0000 (20:19 +0800)
ses_core.h
ses_step_va_balance.c
ses_step_va_bridge.c
ses_utils.c

index 3878abc7576dfd2b52687b6081a365888524a109..ee0ccbc12fd3c416a4f19b8623a2cc306c245b92 100644 (file)
@@ -16,11 +16,14 @@ struct ses_flow_s
 
        ScfEpin*       vip;
 
-       double         pr;
-       double         jpr;
+       int            pos_pins;
+       int            neg_pins;
 
-       double         nr;
-       double         jnr;
+       double         pos_r;
+       double         pos_jr;
+
+       double         neg_r;
+       double         neg_jr;
 
        double         v;
        double         jv;
index 7dae08b304593ad9db55a8babf44627dfe2a0a3f..7db3b0f76b0ae74f4c1ee542d2b63c928564003c 100644 (file)
@@ -122,14 +122,10 @@ static int __ses_path_va_balance(ScfEfunction* f, ses_path_t* bridge, ses_flow_t
                double v4;
 
                __ses_bridge_i(&a0, &a1, &a2, &a3, &a4, &v0, &v1, &v4, v,
-                               flow1->pr, flow0->pr, flow1->nr, flow0->nr, 0,
+                               flow1->pos_r, flow0->pos_r, flow1->neg_r, flow0->neg_r, 0,
                                0, 0, 0, 0,
                                bridge->n_diodes * SCF_EDA_V_Diode_ON);
 
-               scf_loge("r0: %lg, r1: %lg, r2: %lg, r3: %lg, r4: %lg\n",
-                               flow1->pr, flow0->pr,
-                               flow1->nr, flow0->nr, bridge->r);
-
                scf_loge("v: %lg, a0: %lg, a1: %lg, a2: %lg, a3: %lg, a4: %lg\n", v, a0, a1, a2, a3, a4);
                scf_loge("v0: %lg, v1: %lg, v4: %lg, v1 - v0: %lg\n", v0, v1, v4, v1 - v0);
 
index 216b2eefe959b56f06396538bda88c4171d8a0c3..b000508da810960e4f5f112c7ec0b9d7858b0c64 100644 (file)
@@ -30,9 +30,11 @@ static int __ses_path_va_flow(ScfEfunction* f, ses_path_t* bridge, int* changed,
                return ret;
 
        ses_flow_print(flow0);
+       ses_flow_jr(flow0);
        printf("\n");
 
        ses_flow_print(flow1);
+       ses_flow_jr(flow1);
        printf("\n");
        return 0;
 }
index bab07eff8c5eeaffee32554442e187f046e012c4..6927d42c4df87684030ea919cf3cecbd32273fa1 100644 (file)
@@ -78,8 +78,8 @@ void ses_flow_v_pos(ses_flow_t* flow, double a, double ja)
        ScfEpin*    p0;
        ScfEpin*    p;
 
-       double tr  = flow->pr;
-       double jtr = flow->jpr;
+       double tr  = flow->pos_r;
+       double jtr = flow->pos_jr;
 
        int i;
        int j;
@@ -138,8 +138,8 @@ void ses_flow_v_neg(ses_flow_t* flow, double a, double ja)
        ScfEpin*    p0;
        ScfEpin*    p;
 
-       double tr  = flow->nr;
-       double jtr = flow->jnr;
+       double tr  = flow->neg_r;
+       double jtr = flow->neg_jr;
 
        int i;
        int j;
@@ -199,11 +199,11 @@ void ses_flow_jr(ses_flow_t* flow)
        if (!flow)
                return;
 
-       flow->pr  = 0;
-       flow->jpr = 0;
+       flow->pos_r  = 0;
+       flow->pos_jr = 0;
 
-       flow->nr  = 0;
-       flow->jnr = 0;
+       flow->neg_r  = 0;
+       flow->neg_jr = 0;
 
        if (!flow->paths || !flow->vip)
                return;
@@ -226,11 +226,11 @@ void ses_flow_jr(ses_flow_t* flow)
 
                                vip = path->pins->data[0];
 
-                               flow->pr  += p->pr;
-                               flow->jpr += p->jpr;
+                               flow->pos_r  += p->pr;
+                               flow->pos_jr += p->jpr;
 
-                               scf_loge("flow->pr: %lg, c%ldp%ld->pr: %lg, vip c%ldp%ld->pr: %lg\n",
-                                               flow->pr, p->cid, p->id, p->pr, vip->cid, vip->id, vip->pr);
+                               scf_logd("flow->pos_r: %lg, c%ldp%ld->pr: %lg, vip c%ldp%ld->pr: %lg\n",
+                                               flow->pos_r, p->cid, p->id, p->pr, vip->cid, vip->id, vip->pr);
                                break;
                        }
                }
@@ -253,11 +253,11 @@ void ses_flow_jr(ses_flow_t* flow)
 
                        if (p->sr != p->pr) {
 
-                               flow->nr  += p->sr  - p0->pr;
-                               flow->jnr += p->jsr - p0->jpr;
+                               flow->neg_r  += p->sr  - p0->pr;
+                               flow->neg_jr += p->jsr - p0->jpr;
 
-                               scf_logw("flow->nr: %lg, c%ldp%ld->sr: %lg, p0 c%ldp%ld->pr: %lg\n",
-                                               flow->nr, p->cid, p->id, p->sr, p0->cid, p0->id, p0->pr);
+                               scf_logd("flow->neg_r: %lg, c%ldp%ld->sr: %lg, p0 c%ldp%ld->pr: %lg\n",
+                                               flow->neg_r, p->cid, p->id, p->sr, p0->cid, p0->id, p0->pr);
 
                                p0 = p;
                        }
@@ -268,13 +268,15 @@ void ses_flow_jr(ses_flow_t* flow)
                vip = path->pins->data[j - 1];
 
                if (vip != p0) {
-                       flow->nr  += vip->sr  - p0->pr;
-                       flow->jnr += vip->jsr - p0->jpr;
+                       flow->neg_r  += vip->sr  - p0->pr;
+                       flow->neg_jr += vip->jsr - p0->jpr;
                }
 
-               scf_loge("flow->nr: %lg, vip c%ldp%ld->sr: %lg, p0 c%ldp%ld->pr: %lg\n",
-                               flow->nr, vip->cid, vip->id, vip->sr, p0->cid, p0->id, p0->pr);
+               scf_logd("flow->neg_r: %lg, vip c%ldp%ld->sr: %lg, p0 c%ldp%ld->pr: %lg\n",
+                               flow->neg_r, vip->cid, vip->id, vip->sr, p0->cid, p0->id, p0->pr);
        }
+
+       scf_loge("flow->pos_r: %lg, flow->neg_r: %lg, flow->vip: c%ldp%ld\n", flow->pos_r, flow->neg_r, flow->vip->cid, flow->vip->id);
 }
 
 void ses_flow_print(ses_flow_t* flow)