From fb7658b345bcce9a3084eb64816a26be1c52430d Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Thu, 19 Oct 2023 21:36:42 +0800 Subject: [PATCH] _va_transistor_handler() --- ses_step_va_transistor.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ses_step_va_transistor.c b/ses_step_va_transistor.c index 2c4ec99..26cde5b 100644 --- a/ses_step_va_transistor.c +++ b/ses_step_va_transistor.c @@ -22,7 +22,7 @@ void __ses_path_dr_transistor(ScfEfunction* f, ses_path_t* path, int i, int j) p->cid, p->id, v, r, p->sr, p->a, p->dr); } -static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path) +static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path, int* changed) { ses_path_t* parent = path->parent; ses_path_t* child; @@ -140,8 +140,9 @@ static int __ses_path_va_transistor(ScfEfunction* f, ses_path_t* path) return 0; } -static int ses_path_va_transistor(ScfEfunction* f, ses_path_t* path) +static int ses_path_va_transistor(ScfEfunction* f, ses_path_t* path, int* changed) { + ses_path_t* child; ScfEcomponent* B; ScfEpin* p0; ScfEpin* p1; @@ -167,14 +168,15 @@ static int ses_path_va_transistor(ScfEfunction* f, ses_path_t* path) p0 = path->pins->data[0]; p1 = path->pins->data[path->pins->size - 1]; - int ret = __ses_path_va_transistor(f, path); + int ret = __ses_path_va_transistor(f, path, changed); if (ret < 0) return ret; if (path->childs) { for (j = 0; j < path->childs->size; j++) { + child = path->childs->data[j]; - ret = ses_path_va_transistor(f, path->childs->data[j]); + ret = ses_path_va_transistor(f, child, changed); if (ret < 0) return ret; } @@ -187,21 +189,22 @@ static int _va_transistor_handler(ScfEfunction* f, int64_t ns, int64_t count, se { ses_path_t* path; - size_t i; + int changed = 0; + int i; for (i = 0; i < ctx->paths->size; i++) { path = ctx->paths->data[i]; - scf_logi("i: %ld, path->type: %d\n", i, path->type); + scf_logi("i: %d, path->index: %d\n", i, path->index); - int ret = ses_path_va_transistor(f, path); + int ret = ses_path_va_transistor(f, path, &changed); if (ret < 0) return ret; printf("\n"); } - return 0; + return changed > 0 ? -EAGAIN : 0; } ses_step_t ses_step_va_transistor = -- 2.25.1