__ses_path_dr2()
authoryu.dongliang <18588496441@163.com>
Tue, 3 Oct 2023 08:21:56 +0000 (16:21 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 3 Oct 2023 08:21:56 +0000 (16:21 +0800)
ses_layout.c
ses_step_va_diode.c

index 92b578be66fcdf79760991fea7d61fe42c3e9ccf..ebc22e9f1fed80b33c7a6076814e00d6807c7a39 100644 (file)
@@ -1035,7 +1035,7 @@ int ses_layout_board(ScfEboard* b)
                        return ret;
                }
 
-//             ses_steps_analyse(f, 5, 1);
+               ses_steps_analyse(f, 5, 1);
 
                x = f->x;
                y = f->y;
index 53976d22c1454e113ca8b10ea1e96610d877d000..dc0b7711626828e26a1855dd2f2ed0b7311348f8 100644 (file)
@@ -79,22 +79,14 @@ void __ses_path_dr2(ScfEfunction* f, ses_path_t* path, int i, int j, int n_diode
        ScfEpin* p  = path->pins->data[i];
        ScfEpin* p1 = path->pins->data[j];
 
-       double   v  = p->v    - p1->v;
-       double   jv = p->jv   - p1->jv;
+       double   v  = p->v  - p1->v;
+       double   jv = p->jv - p1->jv;
 
-       double   r  = p1->sr  - p->sr;
-       double   jr = p1->jsr - p->jsr;
+       double   r;
+       double   jr;
 
-       double   dr;
-       double   jdr;
-
-       ses_ui_r(&dr, &jdr, v, jv, a, ja);
-
-       dr  -= r;
-       jdr -= jr;
-
-       dr  /= n_diodes;
-       jdr /= n_diodes;
+       v  /= n_diodes;
+       jv /= n_diodes;
 
        int k;
        for (k = i; k <= j; k++) {
@@ -105,10 +97,27 @@ void __ses_path_dr2(ScfEfunction* f, ses_path_t* path, int i, int j, int n_diode
                c  = f->components[p->cid];
 
                if (SCF_EDA_Diode == c->type && SCF_EDA_Diode_NEG == p->id) {
-                       p->dr  = dr;
-                       p->jdr = jdr;
 
-                       scf_logw("c%ldp%ld, v: %lg, r: %lg, a: %lg, dr: %lg, n_diodes: %d\n", p->cid, p->id, v, r, a, dr, n_diodes);
+                       ses_ui_r(&p->dr, &p->jdr, v, jv, a, ja);
+
+                       p->dr  -= p->r;
+                       p->jdr -= p->jr;
+
+                       scf_logw("c%ldp%ld, v: %lg, r: %lg, a: %lg, dr: %lg, n_diodes: %d\n", p->cid, p->id, v, p->r, a, p->dr, n_diodes);
+
+               } else if (SCF_EDA_Transistor == c->type && SCF_EDA_Transistor_B == p->id) {
+
+                       p1 = c->pins[SCF_EDA_Transistor_C];
+
+                       ses_ui_r(&p->dr, &p->jdr, v, jv, a, ja);
+
+                       p->dr  -= p->r;
+                       p->jdr -= p->jr;
+
+                       scf_logw("c%ldp%ld, v: %lg, r: %lg, a: %lg, dr: %lg, n_diodes: %d\n", p->cid, p->id, v, p->r, a, p->dr, n_diodes);
+
+                       a  *= (1 + p1->hfe);
+                       ja *= (1 + p1->hfe);
                }
        }
 }