From f600400a1bda41d6cdf6012f00cca1a4cdffa58b Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Sun, 12 Nov 2023 23:21:09 +0800 Subject: [PATCH] _topo_path_completes() --- ses_step_topo.c | 33 +++++++++++++++------------------ ses_steps.c | 4 ++-- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ses_step_topo.c b/ses_step_topo.c index caaf148..6555c99 100644 --- a/ses_step_topo.c +++ b/ses_step_topo.c @@ -355,19 +355,23 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths) int j; int k; - for (i = paths->size - 1; i >= 1; i--) { + for (i = 0; i < paths->size; ) { path0 = paths->data[i]; p0 = path0->pins->data[0]; p1 = path0->pins->data[path0->pins->size - 1]; - if (p1->lid != Bn->lid) + if (p1->lid != Bn->lid) { + i++; continue; + } - if (p0->lid == Bp->lid) + if (p0->lid == Bp->lid) { + i++; continue; + } - for (j = paths->size - 1; j >= 0; j--) { + for (j = 0; j < paths->size; j++) { path1 = paths->data[j]; if (path1 == path0) @@ -379,24 +383,14 @@ 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) { - 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 (p->lid == p0->lid) + break; } if (k > 0) { @@ -444,6 +438,9 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths) break; } } + + if (path0) + i++; } return 0; diff --git a/ses_steps.c b/ses_steps.c index 2550385..c6fc664 100644 --- a/ses_steps.c +++ b/ses_steps.c @@ -38,7 +38,7 @@ static ses_step_t* ses_steps_1[] = // &ses_step_simplify, &ses_step_topo, -#if 0 +#if 1 &ses_step_jr, &ses_step_va_diode, @@ -144,7 +144,7 @@ int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count) return ret; int j; - for (j = 0; j < 1; j++) { + for (j = 0; j < 3; j++) { printf("\n\033[33m%s(), %d(), j: %d\033[0m\n", __func__, __LINE__, j); ret = __ses_steps_analyse(f, ns, i, ctx); -- 2.25.1