__topo_path_diodes()
authoryu.dongliang <18588496441@163.com>
Mon, 13 Nov 2023 04:13:50 +0000 (12:13 +0800)
committeryu.dongliang <18588496441@163.com>
Mon, 13 Nov 2023 04:13:50 +0000 (12:13 +0800)
ses_step_jr.c
ses_step_topo.c

index 2ce19618abbebf00a8c4aca663df8a710d5fe5b5..4e2dfb3669e1c3658dd5cb29ac773447c070129e 100644 (file)
@@ -60,9 +60,13 @@ void __ses_path_pr(ScfEfunction* f, ses_path_t* path, int i, int j, ScfEpin* cp1
                        if (cp1 != p1)
                                p1 = path->pins->data[j - 1];
 
-               } else if (j > 0)
+               } else if (j > 0) {
                        p1 = path->pins->data[j - 1];
-               else {
+                       c1 = f->components[p1->cid];
+
+                       if (SCF_EDA_NPN == c1->type && SCF_EDA_NPN_E == p1->id)
+                               p1 = path->pins->data[j - 2];
+               } else {
                        *r  = 0;
                        *jr = 0;
                        return;
@@ -92,8 +96,7 @@ void __ses_path_pr(ScfEfunction* f, ses_path_t* path, int i, int j, ScfEpin* cp1
                *r  = p1->pr  - p0->pr;
                *jr = p1->jpr - p0->jpr;
        }
-
-       scf_logd("c%ldp%ld-c%ldp%ld, r: %lg, p0->pr: %lg, p1->pr: %lg\n", p0->cid, p0->id, p1->cid, p1->id, *r, p0->pr, p1->pr);
+       scf_loge("c%ldp%ld-c%ldp%ld, r: %lg, p0->pr: %lg, p1->pr: %lg\n", p0->cid, p0->id, p1->cid, p1->id, *r, p0->pr, p1->pr);
 }
 
 static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
index fc959c17ae12492cee31493cf0462f80c8997979..af5a4bd85f14903d643b0fc5456ef1d18bf90c72 100644 (file)
@@ -499,8 +499,10 @@ static int __topo_path_diodes(ScfEfunction* f, ses_path_t* path)
                        if (SCF_EDA_Diode_NEG == p->id) {
                                info->n_diodes++;
 
-                               if (__ses_branch_exist(path, i))
+                               if (__ses_branch_exist(path, i)) {
+                                       j = i;
                                        goto _add;
+                               }
                        }
                        continue;
                }
@@ -521,16 +523,18 @@ static int __topo_path_diodes(ScfEfunction* f, ses_path_t* path)
 
                        } else if (SCF_EDA_NPN_E == p->id) {
 
-                               if (__ses_branch_exist(path, i))
+                               if (__ses_branch_exist(path, i)) {
+                                       j = i;
                                        goto _add;
-
+                               }
                                continue;
                        }
                }
 
+               j = i - 1;
 _add:
                if (info) {
-                       info->j = i - 1;
+                       info->j = j;
 
                        if (scf_vector_add(path->diodes, info) < 0) {
                                free(info);