tmp
authoryu.dongliang <18588496441@163.com>
Tue, 3 Oct 2023 13:14:36 +0000 (21:14 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 3 Oct 2023 13:14:36 +0000 (21:14 +0800)
ses_core.h
ses_step_jr.c
ses_step_va_diode.c
ses_step_va_transistor.c
ses_steps.c

index 16d873e1e30e25293a958d5f8362a06a6407a05e..b82b976994c772620a9e963be8899dc9588e1010 100644 (file)
@@ -106,7 +106,7 @@ int ses_layout_board (ScfEboard*    b);
 int ses_loop_function(ScfEfunction* f, scf_vector_t* loops);
 int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count);
 
-void __ses_path_split_i(ses_path_t* path, ScfEpin* p0, ScfEpin* p1, double la, double jla, double* a, double* ja);
+void __ses_path_split_i(ses_path_t* path, int i, int j, double la, double jla, double* a, double* ja);
 void __ses_path_dr     (ScfEpin*      p0, ScfEpin* p1, ScfEpin* p);
 
 static inline void vertical(int* px, int* py, int dx, int dy, int d)
index e1b52a3ec3745a71de59aba035fc3d3d237383b5..14006f7cd6e1979ed56c589f16f9fb21954ee2ef 100644 (file)
@@ -124,6 +124,13 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
                        p1->pr  -= dr;
                        p1->jpr -= jdr;
 
+                       if (SCF_EDA_Transistor == c->type && SCF_EDA_Transistor_E == p1->id) {
+
+                               p       = path->pins->data[j - 1];
+                               p->pr  -= dr;
+                               p->jpr -= jdr;
+                       }
+
                        scf_logw("j: %d, c%ldp%ld, p->pr: %lg + j%lg, p->sr: %lg + j%lg, dr: %lg + j%lg\n", j, p1->cid, p1->id, p1->pr, p1->jpr, p1->sr, p1->jsr, dr, jdr);
 
                        for (++j; j < path->pins->size; j++) {
index ca3ef00b9cb8397a5830c6f97a28c6823c98b77b..86ef0fe1e473310340914032fb68e1f9cc28c7e3 100644 (file)
@@ -1,10 +1,12 @@
 #include"ses_core.h"
 
-void __ses_path_split_i(ses_path_t* path, ScfEpin* p0, ScfEpin* p1, double la, double jla, double* a, double* ja)
+void __ses_path_split_i(ses_path_t* path, int i, int j, double la, double jla, double* a, double* ja)
 {
        ses_path_t*    child;
        ScfEpin*       cp0;
        ScfEpin*       cp1;
+       ScfEpin*       p0 = path->pins->data[i];
+       ScfEpin*       p1 = path->pins->data[j];
 
        double v  = p0->v   - p1->v;
        double jv = p0->jv  - p1->jv;
@@ -12,9 +14,12 @@ void __ses_path_split_i(ses_path_t* path, ScfEpin* p0, ScfEpin* p1, double la, d
        double r  = p1->pr  - p0->pr;
        double jr = p1->jpr - p0->jpr;
 
-       int j;
-       for (j    = 0; j < path->childs->size; j++) {
-               child =        path->childs->data[j];
+       scf_loge("c%ldp%ld--c%ldp%ld, r: %lg, p1->pr: %lg, p0->pr: %lg, p1->sr: %lg, p0->sr: %lg\n",
+                       p0->cid, p0->id, p1->cid, p1->id, r, p1->pr, p0->pr, p1->sr, p0->sr);
+
+       int k;
+       for (k    = 0; k < path->childs->size; k++) {
+               child =        path->childs->data[k];
 
                cp0 = child->pins->data[0];
                cp1 = child->pins->data[child->pins->size - 1];
@@ -37,7 +42,7 @@ void __ses_path_split_i(ses_path_t* path, ScfEpin* p0, ScfEpin* p1, double la, d
                cp0->jv = p0->jv;
 
                if (child->childs)
-                       __ses_path_split_i(child, cp0, cp1, child->a, child->ja, &cp1->a, &cp1->ja);
+                       __ses_path_split_i(child, 0, child->pins->size - 1, child->a, child->ja, &cp1->a, &cp1->ja);
 
                cp0->a  = cp1->a;
                cp0->ja = cp1->ja;
@@ -50,8 +55,8 @@ void __ses_path_split_i(ses_path_t* path, ScfEpin* p0, ScfEpin* p1, double la, d
                cp1->dr  -= cp1->sr;
                cp1->jdr -= cp1->jsr;
 
-               scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg + j%lg, child->r: %lg + j%lg, cp1->a: %lg + j%lg, el->a: %lg + j%lg, cp1->dr: %lg + j%lg\n",
-                               j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, jv, child->r, child->jr, cp1->a, cp1->ja, la, jla, cp1->dr, cp1->jdr);
+               scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, child->r: %lg, r: %lg, cp1->a: %lg, el->a: %lg, cp1->dr: %lg\n",
+                               j, cp0->cid, cp0->id, cp1->cid, cp1->id, v, child->r, r, cp1->a, la, cp1->dr);
        }
 }
 
@@ -307,7 +312,7 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path)
                pj->ja     = ja;
 
                if (path->childs)
-                       __ses_path_split_i(path, pj, p1, a, ja, &pj->a, &pj->ja);
+                       __ses_path_split_i(path, j, path->pins->size - 1, a, ja, &pj->a, &pj->ja);
 
                scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, pj->v: %lg, pj->a: %lg, pr: %lg, sr: %lg\n\n",
                                j, pj->cid, pj->id, p1->cid, p1->id, v, pj->v, pj->a, pr, sr);
@@ -324,8 +329,11 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path)
                pj->a      = a;
                pj->ja     = ja;
 
+               scf_logw("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, pj->v: %lg, pj->a: %lg, pr: %lg, sr: %lg\n\n",
+                               j, pj->cid, pj->id, p1->cid, p1->id, v, pj->v, pj->a, pr, sr);
+
                if (path->childs)
-                       __ses_path_split_i(path, pj, p1, a, ja, &pj->a, &pj->ja);
+                       __ses_path_split_i(path, j, path->pins->size - 1, a, ja, &pj->a, &pj->ja);
 
                scf_loge("j: %d, c%ldp%ld--c%ldp%ld, v: %lg, pj->v: %lg, pj->a: %lg, pr: %lg, sr: %lg\n\n",
                                j, pj->cid, pj->id, p1->cid, p1->id, v, pj->v, pj->a, pr, sr);
@@ -349,7 +357,7 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path)
                pi->ja     = ja;
 
                if (path->childs)
-                       __ses_path_split_i(path, p0, pi, a, ja, &pi->a, &pi->ja);
+                       __ses_path_split_i(path, 0, i, a, ja, &pi->a, &pi->ja);
 
                __ses_path_dr_reverse(f, path, 0, i, pi->n_diodes, pi->a, pi->ja);
 
@@ -367,7 +375,7 @@ static int __ses_path_va_diode(ScfEfunction* f, ses_path_t* path)
                pi->ja     = ja;
 
                if (path->childs)
-                       __ses_path_split_i(path, p0, pi, a, ja, &pi->a, &pi->ja);
+                       __ses_path_split_i(path, 0, i, a, ja, &pi->a, &pi->ja);
 
                p = c->pins[SCF_EDA_Transistor_B];
 
index a13ecf44054a1a342fab82a5fbb6eac3adb64847..738c5f277250ff21c08d88734a3400053760bbbc 100644 (file)
@@ -93,7 +93,7 @@ static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path)
                p->ja  = el->ja;
 
                if (path->childs)
-                       __ses_path_split_i(path, p0, pc, el->a, el->ja, &p->a,  &p->ja);
+                       __ses_path_split_i(path, 0, i, el->a, el->ja, &p->a,  &p->ja);
                else {
                        p0->a  = el->a;
                        p0->ja = el->ja;
index 1afadcbbb75f3b56078b41b1ffbcd2fc1fae36c9..ca14cfcc17c35ab67147025b701c3e044f9adc9a 100644 (file)
@@ -37,12 +37,13 @@ static ses_step_t*  ses_steps[] =
        &ses_step_jr,
        &ses_step_va_diode,
        &ses_step_va_transistor,
-
+#if 0
        &ses_step_jr,
        &ses_step_va,
        &ses_step_va_balance,
 
        &ses_step_output,
+#endif
 };
 
 ses_flow_t* ses_flow_alloc()