__ses_path_jr()
authoryu.dongliang <18588496441@163.com>
Wed, 4 Oct 2023 07:13:24 +0000 (15:13 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 4 Oct 2023 07:13:24 +0000 (15:13 +0800)
ses_step_jr.c

index 327bd8c26eb6366a5ab26a2d785f65a4e712a037..d9c444b872231b7d7800d4a38c9352bb28e90321 100644 (file)
@@ -39,7 +39,6 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
 
        ses_path_t*    child;
        ScfEcomponent* c;
-       ScfEcomponent* c1;
        ScfEpin*       p;
        ScfEpin*       p0;
        ScfEpin*       p1;
@@ -92,15 +91,14 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
                        p0  = NULL;
                        p1  = NULL;
 
-                       int k0;
-                       int k1;
+                       int k;
 
                        for (j = 0; j < path->pins->size; j++) {
                                p  =        path->pins->data[j];
 
                                if (p->lid == cp0->lid) {
                                        p0 = p;
-                                       k0 = j;
+                                       k  = j;
                                        break;
                                }
                        }
@@ -113,7 +111,6 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
 
                                if (p->lid == cp1->lid) {
                                        p1 = p;
-                                       k1 = j;
                                        break;
                                }
                        }
@@ -126,7 +123,7 @@ static int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
                        double _r  =  child->r  / R;
                        double _jr = -child->jr / R;
 
-                       __ses_path_pr(f, path, k0, k1, &r, &jr);
+                       __ses_path_pr(f, path, k, j, &r, &jr);
 
                        R  =   r * r + jr * jr;
                        r  =   r / R;
@@ -147,7 +144,9 @@ 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) {
+                       c  = f->components[p1->lid];
+
+                       if (SCF_EDA_Transistor == c->type && SCF_EDA_Transistor_E == p1->id && cp1 != p1) {
 
                                p       = path->pins->data[j - 1];
                                p->pr  -= dr;