From: yu.dongliang <18588496441@163.com> Date: Thu, 19 Oct 2023 04:33:01 +0000 (+0800) Subject: __ses_path_jr() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=46c988bbad30b5879c8510cdde5043cabe5c0b92;p=ses.git __ses_path_jr() --- diff --git a/ses_layout.c b/ses_layout.c index d97599a..8171d5e 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -903,8 +903,10 @@ int ses_layout_function(ScfEfunction* f, int d) if (k < 2) p1->x = c->x; - else - p1->x += c->x - tmp; + else { + p1->x += c->x - tmp; + p1->x = (c->x * 3 + p1->x) / 4; + } if (tx0 > p1->x) tx0 = p1->x; diff --git a/ses_step_jr.c b/ses_step_jr.c index 5d2161d..ae9f651 100644 --- a/ses_step_jr.c +++ b/ses_step_jr.c @@ -81,7 +81,7 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path) p->pr = r; p->jpr = jr; - scf_loge("i: %d, c%ldp%ld, p->sr: %lg\n", i, p->cid, p->id, p->sr); + scf_loge("path: %d, i: %d, c%ldp%ld, p->sr: %lg\n", path->index, i, p->cid, p->id, p->sr); } printf("\n"); @@ -126,28 +126,15 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path) if (!p1) return -EINVAL; - R = child->r * child->r + child->jr * child->jr; + double pr; + double jpr; - double _r = child->r / R; - double _jr = -child->jr / R; + __ses_path_pr(f, path, k, j, NULL, &pr, &jpr); - __ses_path_pr(f, path, k, j, NULL, &r, &jr); + ses_merge_r(&r, &jr, pr, jpr, child->r, child->jr); - R = r * r + jr * jr; - r = r / R; - jr = -jr / R; - - r += _r; - jr += _jr; - - R = r * r + jr * jr; - r = r / R; - jr = -jr / R; - - scf_logw("j: %d, c%ldp%ld, p1->pr: %lg, p1->sr: %lg, r: %lg\n", j, p1->cid, p1->id, p1->pr, p1->sr, r); - - double dr = p1->pr - (p0->pr + r); - double jdr = p1->jpr - (p0->jpr + jr); + double dr = pr - r; + double jdr = jpr - jr; p1->pr -= dr; p1->jpr -= jdr; @@ -160,10 +147,10 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path) p->pr -= dr; p->jpr -= jdr; - scf_logw("j: %d, c%ldp%ld, p->pr: %lg, p->sr: %lg, dr: %lg\n", j, p->cid, p->id, p->pr, p->sr, dr); + scf_logi("j: %d, c%ldp%ld, p->pr: %lg, p->sr: %lg, pr: %lg, dr: %lg\n", j, p->cid, p->id, p->pr, p->sr, pr, dr); } - scf_logw("j: %d, c%ldp%ld, p->pr: %lg, p->sr: %lg, dr: %lg\n", j, p1->cid, p1->id, p1->pr, p1->sr, dr); + scf_logi("j: %d, c%ldp%ld, p->pr: %lg, p->sr: %lg, pr: %lg, dr: %lg\n", j, p1->cid, p1->id, p1->pr, p1->sr, pr, dr); for (++j; j < path->pins->size; j++) { p = path->pins->data[j]; @@ -174,10 +161,10 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path) p->sr -= dr; p->jsr -= jdr; - scf_logw("j: %d, c%ldp%ld, p->pr: %lg, p->sr: %lg\n", j, p->cid, p->id, p->pr, p->sr); + scf_logd("j: %d, c%ldp%ld, p->pr: %lg, p->sr: %lg\n", j, p->cid, p->id, p->pr, p->sr); } - scf_logw("child: %d, r: %lg, dr: %lg\n\n", child->index, child->r, dr); + scf_logw("child: %d, r: %lg, dr: %lg\n", child->index, child->r, dr); } } @@ -186,7 +173,7 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path) path->r = p->pr; path->jr = p->jpr; - scf_loge("path: %d, r: %lg, r0: %lg\n", path->index, path->r, path->r0); + scf_loge("path: %d, r: %lg, r0: %lg\n\n", path->index, path->r, path->r0); return 0; } diff --git a/ses_step_va_diode.c b/ses_step_va_diode.c index 35c67b9..beeffae 100644 --- a/ses_step_va_diode.c +++ b/ses_step_va_diode.c @@ -18,7 +18,7 @@ void __ses_path_split_i(ScfEfunction* f, ses_path_t* path, int i, int j, double __ses_path_pr(f, path, i, j, NULL, &r, &jr); - scf_logd("c%ldp%ld--c%ldp%ld, r: %lg\n", p0->cid, p0->id, p1->cid, p1->id, r); + scf_loge("c%ldp%ld--c%ldp%ld, r: %lg\n", p0->cid, p0->id, p1->cid, p1->id, r); int k; for (k = 0; k < path->childs->size; k++) { @@ -37,9 +37,16 @@ void __ses_path_split_i(ScfEfunction* f, ses_path_t* path, int i, int j, double if (child->a >= la) ses_split_i(&child->a, &child->ja, la, jla, child->r, child->jr, r, jr); - } else + scf_logw("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, child->r: %lg, r: %lg, child->a: %lg, el->a: %lg\n", + j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, child->r, r, child->a, la); + + } else { ses_split_i(&child->a, &child->ja, la, jla, child->r, child->jr, r, jr); + scf_logw("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, child->r: %lg, r: %lg, child->a: %lg, el->a: %lg\n", + j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, child->r, r, child->a, la); + } + *a -= child->a; *ja -= child->ja; diff --git a/ses_steps.c b/ses_steps.c index 0ed9cb7..8b5938f 100644 --- a/ses_steps.c +++ b/ses_steps.c @@ -38,12 +38,14 @@ static ses_step_t* ses_steps_1[] = &ses_step_topo, &ses_step_jr, +#if 0 &ses_step_va_diode, &ses_step_va_transistor, &ses_step_jr, &ses_step_va, &ses_step_va_balance, +#endif }; static ses_step_t* ses_steps_2[] =