__ses_xchg_ce()
authoryu.dongliang <18588496441@163.com>
Mon, 6 Nov 2023 08:11:41 +0000 (16:11 +0800)
committeryu.dongliang <18588496441@163.com>
Mon, 6 Nov 2023 08:11:41 +0000 (16:11 +0800)
ses_layout.c

index da7a3a503eb4d692675bdb02d7986f1f7ffea467..cbe80f16078754909b45e1b89d506bfcbb964d9b 100644 (file)
@@ -1283,7 +1283,10 @@ static void __ses_xchg_ce(ScfEfunction* f, int d)
                if (SCF_EDA_NPN != c->type)
                        continue;
 
-               j = (c->color - 1) % 2;
+               j = 0;
+
+               if (c->color > 0)
+                       j = (c->color - 1) % 2;
 
                pb = c->pins[SCF_EDA_NPN_B];
                pc = c->pins[SCF_EDA_NPN_C];
@@ -1304,6 +1307,9 @@ static void __ses_xchg_ce(ScfEfunction* f, int d)
 
                } else if (pc->y < pb->y) {
 
+                       pc = c->pins[SCF_EDA_NPN_C];
+                       pe = c->pins[SCF_EDA_NPN_E];
+
                        if ((0 == j && pc->x > pb->x) || (1 == j && pc->x < pb->x))
                                SCF_XCHG(pc->x, pe->x);
                }