__ses_path_jr()
authoryu.dongliang <18588496441@163.com>
Thu, 19 Oct 2023 04:33:01 +0000 (12:33 +0800)
committeryu.dongliang <18588496441@163.com>
Thu, 19 Oct 2023 04:33:01 +0000 (12:33 +0800)
ses_layout.c
ses_step_jr.c
ses_step_va_diode.c
ses_steps.c

index d97599a26b9c5d46243b4a569baf6136181aedb7..8171d5e918e6cfaa83260d92e66378247968a641 100644 (file)
@@ -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;
index 5d2161d85e580f39a3ee93ad11fb989bab54317e..ae9f6517808c13940f67a673ae98aa257176acf8 100644 (file)
@@ -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;
 }
 
index 35c67b9afb85f4db65eb97710792beafbb25d31b..beeffae510d40bba1804ffeb25afd77f3867bc4d 100644 (file)
@@ -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;
 
index 0ed9cb7301bf3360884cd11369be4f390ac3295e..8b5938fd58f730aeb724c53033b9118b9a3e7c42 100644 (file)
@@ -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[] =