From eb64da2e19b67cbdcd76d3aba362ce7ab6c9854b Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Wed, 26 Jul 2023 21:59:46 +0800 Subject: [PATCH] branch path --- scf_eda_pb.h | 1 + ses_step_topo.c | 37 ++++++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/scf_eda_pb.h b/scf_eda_pb.h index e4aff68..75e92a3 100644 --- a/scf_eda_pb.h +++ b/scf_eda_pb.h @@ -43,6 +43,7 @@ enum { SCF_EDA_Status_ON, SCF_EDA_Status_OFF, SCF_EDA_Path_OFF, + SCF_EDA_Path_TO, }; enum { diff --git a/ses_step_topo.c b/ses_step_topo.c index fc09978..88890d0 100644 --- a/ses_step_topo.c +++ b/ses_step_topo.c @@ -44,7 +44,7 @@ static int __dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, ses_ctx_t if (np->vflag) { if (rp != np) - scf_loge("c%ld_p%ld, l%ld, vflag: %d, pflag: %d\n", np->cid, np->id, np->lid, np->vflag, np->pflag); + scf_logd("c%ld_p%ld, l%ld, vflag: %d, pflag: %d\n", np->cid, np->id, np->lid, np->vflag, np->pflag); continue; } @@ -88,9 +88,15 @@ static int __dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, ses_ctx_t c = f->components[el->pins[j]]; p = c->pins [el->pins[j + 1]]; + if (p->pflag && p != np) { + scf_loge("branch: c%ld_p%ld, l%ld\n", c->id, p->id, el->id); + ret = SCF_EDA_Path_TO; + goto end; + } + if (p->vflag) { if (p != np) - scf_loge("c%ld_p%ld, l%ld, vflag: %d, pflag: %d\n", p->cid, p->id, p->lid, p->vflag, p->pflag); + scf_logd("c%ld_p%ld, l%ld, vflag: %d, pflag: %d\n", p->cid, p->id, p->lid, p->vflag, p->pflag); continue; } @@ -101,24 +107,24 @@ static int __dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, ses_ctx_t if (ret < 0) return ret; - if (SCF_EDA_Status_OFF == ret) - scf_loge("off: c%ld_p%ld, l%ld\n", p->cid, p->id, p->lid); - else if (SCF_EDA_Path_OFF == ret) { + if (SCF_EDA_Path_OFF == ret) { p->vflag = 0; scf_logw("off: c%ld_p%ld, l%ld\n", p->cid, p->id, p->lid); - } + + } else if (SCF_EDA_Status_OFF == ret) + scf_loge("off: c%ld_p%ld, l%ld\n", p->cid, p->id, p->lid); } if (ret > 0) { if (*ppath) scf_vector_del(*ppath, np); - if (SCF_EDA_Status_OFF == ret) - scf_loge("off: c%ld_p%ld, l%ld, *ppath: %p\n", np->cid, np->id, np->lid, *ppath); - else if (SCF_EDA_Path_OFF == ret) { + if (SCF_EDA_Path_OFF == ret) { np->vflag = 0; scf_logw("off: c%ld_p%ld, l%ld\n", np->cid, np->id, np->lid); - } + + } else if (SCF_EDA_Status_OFF == ret) + scf_loge("off: c%ld_p%ld, l%ld, *ppath: %p\n", np->cid, np->id, np->lid, *ppath); } } @@ -126,14 +132,15 @@ static int __dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, ses_ctx_t if (*ppath) scf_vector_del(*ppath, rp); - if (SCF_EDA_Status_OFF == ret) - scf_loge("off: c%ld_p%ld, l%ld\n", rp->cid, rp->id, rp->lid); - else if (SCF_EDA_Path_OFF == ret) { + if (SCF_EDA_Path_OFF == ret) { rp->vflag = 0; scf_logw("off: c%ld_p%ld, l%ld\n", rp->cid, rp->id, rp->lid); - } + + } else if (SCF_EDA_Status_OFF == ret) + scf_loge("off: c%ld_p%ld, l%ld\n", rp->cid, rp->id, rp->lid); } +end: return ret; } @@ -194,7 +201,7 @@ static int _topo_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* if (!path) continue; - if (ret > 0) { + if (SCF_EDA_Status_OFF == ret || SCF_EDA_Path_OFF == ret) { scf_vector_clear(path, NULL); continue; } -- 2.25.1