From: yu.dongliang <18588496441@163.com> Date: Wed, 15 Nov 2023 12:19:10 +0000 (+0800) Subject: ses_flow_jr() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=d809271af836feb640bba15086b2f70de2e3c24f;p=ses.git ses_flow_jr() --- diff --git a/ses_core.h b/ses_core.h index 3878abc..ee0ccbc 100644 --- a/ses_core.h +++ b/ses_core.h @@ -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; diff --git a/ses_step_va_balance.c b/ses_step_va_balance.c index 7dae08b..7db3b0f 100644 --- a/ses_step_va_balance.c +++ b/ses_step_va_balance.c @@ -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); diff --git a/ses_step_va_bridge.c b/ses_step_va_bridge.c index 216b2ee..b000508 100644 --- a/ses_step_va_bridge.c +++ b/ses_step_va_bridge.c @@ -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; } diff --git a/ses_utils.c b/ses_utils.c index bab07ef..6927d42 100644 --- a/ses_utils.c +++ b/ses_utils.c @@ -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)