ses_step_va.c, ses_step_va_transistor.c
authoryu.dongliang <18588496441@163.com>
Sun, 10 Sep 2023 14:51:23 +0000 (22:51 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 10 Sep 2023 14:51:29 +0000 (22:51 +0800)
ses_step_va.c
ses_step_va_transistor.c

index 357c9a7959a080962020ca515287fbf3042e3462..9062ef1edd09966b6a8dbe018efcd4376031f805 100644 (file)
@@ -101,18 +101,26 @@ static int __ses_path_va(ScfEfunction* f, ses_path_t* path)
 
                c = f->components[p->cid];
 
-               if (SCF_EDA_Transistor == c->type
-                               && (SCF_EDA_Transistor_B == p->id || SCF_EDA_Transistor_C == p->id)) {
+               if (SCF_EDA_Transistor == c->type) {
 
-                       ses_ir_u(&v, &jv, a, ja, p->sr - (p->r + p->dr), p->jsr - (p->jr + p->jdr));
+                       if (SCF_EDA_Transistor_B == p->id || SCF_EDA_Transistor_C == p->id)
+                               ses_ir_u(&v, &jv, a, ja, p->sr - (p->r + p->dr), p->jsr - (p->jr + p->jdr));
+                       else {
+                               if (i < 1) {
+                                       scf_loge("\n");
+                                       return -EINVAL;
+                               }
+
+                               p2 = path->pins->data[i - 1];
+
+                               ses_ir_u(&v, &jv, a, ja, p2->sr, p2->jsr);
+                       }
                } else
                        ses_ir_u(&v, &jv, a, ja, p->sr, p->jsr);
 
                p->v   = p0->v  - v;
                p->jv  = p0->jv - jv;
 
-               scf_logd("path: %d, v: %lg + j%lg, p->sr: %lg + j%lg, a: %lg + j%lg\n", path->index, v, jv, p->sr, p->jsr, a, ja);
-
                el     = f->elines[p->lid];
                el->v  = p->v;
                el->jv = p->jv;
@@ -120,8 +128,6 @@ static int __ses_path_va(ScfEfunction* f, ses_path_t* path)
                r     += p->r  + p->dr;
                jr    += p->jr + p->jdr;
 
-               scf_logw("path: %d, i: %d, c%ldp%ld, r: %lg + j%lg, p->r: %lg + j%lg, p->dr: %lg + j%lg\n", path->index, i, p->cid, p->id, r, jr, p->r, p->jr, p->dr, p->jdr);
-
                if (i & 0x1) {
                        r   += c->r;
                        jr  += c->jr;
index 8b698e4e380581e33ed349b057d2978d6915096a..e7cf76fc4b4806434ada7434d391736b1cb6bc0f 100644 (file)
@@ -59,11 +59,11 @@ static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path)
                v   = p0->v  - pb->v;
                jv  = p0->jv - pb->jv;
 
-               pr  = pb->pr  - p0->pr;
-               jpr = pb->jpr - p0->jpr;
+               pr  = p->pr  - p0->pr;
+               jpr = p->jpr - p0->jpr;
 
-               sr  = pb->sr  - p0->sr;
-               jsr = pb->jsr - p0->jsr;
+               sr  = p->sr  - p0->sr;
+               jsr = p->jsr - p0->jsr;
 
                ses_ur_i(&el->a, &el->ja, v, jv, pr, jpr);
 
@@ -141,8 +141,8 @@ static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path)
                        v     = p0->v   - p1->v;
                        jv    = p0->jv  - p1->jv;
 
-                       pr    = p1->sr  - p0->pr;
-                       jpr   = p1->jsr - p0->jpr;
+                       pr    = pc->sr  - p0->pr;
+                       jpr   = pc->jsr - p0->jpr;
 
                        ses_ur_i(&pc->a, &pc->ja, v, jv, pr, jpr);