From: yu.dongliang <18588496441@163.com> Date: Sun, 12 Nov 2023 14:47:04 +0000 (+0800) Subject: _topo_path_completes() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=e6ca44cdcd67ee7d78efc12a266522a7066651f4;p=ses.git _topo_path_completes() --- diff --git a/ses_step_topo.c b/ses_step_topo.c index cc91f43..caaf148 100644 --- a/ses_step_topo.c +++ b/ses_step_topo.c @@ -340,6 +340,8 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths) ses_path_t* path0; ses_path_t* path1; + ScfEcomponent* c0; + ScfEcomponent* c1; ScfEcomponent* B = f->components[0]; ScfEpin* Bp = B->pins[SCF_EDA_Battery_POS]; ScfEpin* Bn = B->pins[SCF_EDA_Battery_NEG]; @@ -377,20 +379,30 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths) if (p2->lid != Bp->lid) continue; - if (p3->lid == Bn->lid) - continue; +// if (p3->lid == Bn->lid) +// continue; for (k = path1->pins->size - 1; k >= 0; k -= 2) { p = path1->pins->data[k]; - if (p->lid == p0->lid) - break; + if (p->lid == p0->lid) { + c0 = f->components[p0->cid]; + c1 = f->components[p->cid]; + + if (SCF_EDA_NPN == c0->type) { + if (SCF_EDA_NPN_C == p0->id) + break; + else if (SCF_EDA_NPN != c1->type || SCF_EDA_NPN_C != p->id) + break; + } else if (SCF_EDA_NPN != c1->type) + break; + } } if (k > 0) { - scf_loge("merge path: c%ldp%ld-c%ldp%ld ... c%ldp%ld-c%ldp%ld\n", - p2->cid, p2->id, p->cid, p->id, - p0->cid, p0->id, p1->cid, p1->id); + scf_loge("merge path: c%ldp%ld-c%ldp%ld (%d)... c%ldp%ld-c%ldp%ld (%d)\n", + p2->cid, p2->id, p->cid, p->id, path1->pins->size, + p0->cid, p0->id, p1->cid, p1->id, path0->pins->size); int ret = __topo_path_xchg(path0, 0, path1, k + 1); if (ret < 0) @@ -414,9 +426,9 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths) } if (k < path0->pins->size) { - scf_loge("merge path: c%ldp%ld-c%ldp%ld ... c%ldp%ld-c%ldp%ld\n", - p2->cid, p2->id, p3->cid, p3->id, - p ->cid, p ->id, p1->cid, p1->id); + scf_loge("merge path: c%ldp%ld-c%ldp%ld (%d) ... c%ldp%ld-c%ldp%ld (%d)\n", + p2->cid, p2->id, p3->cid, p3->id, path1->pins->size, + p ->cid, p ->id, p1->cid, p1->id, path0->pins->size); int ret = __topo_path_xchg(path0, k, path1, path1->pins->size); if (ret < 0) diff --git a/ses_steps.c b/ses_steps.c index 044cbc9..2550385 100644 --- a/ses_steps.c +++ b/ses_steps.c @@ -38,12 +38,12 @@ static ses_step_t* ses_steps_1[] = // &ses_step_simplify, &ses_step_topo, - +#if 0 &ses_step_jr, &ses_step_va_diode, &ses_step_va_transistor, -#if 1 + &ses_step_jr, &ses_step_va, &ses_step_va_bridge, @@ -144,7 +144,7 @@ int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count) return ret; int j; - for (j = 0; j < 3; j++) { + for (j = 0; j < 1; j++) { printf("\n\033[33m%s(), %d(), j: %d\033[0m\n", __func__, __LINE__, j); ret = __ses_steps_analyse(f, ns, i, ctx);