From: yu.dongliang <18588496441@163.com> Date: Mon, 6 Nov 2023 08:11:41 +0000 (+0800) Subject: __ses_xchg_ce() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=052e7ba45f232b403ecb549ef1380f003cc6e6b1;p=ses.git __ses_xchg_ce() --- diff --git a/ses_layout.c b/ses_layout.c index da7a3a5..cbe80f1 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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); }