ses step va
authoryu.dongliang <18588496441@163.com>
Sun, 3 Sep 2023 12:56:44 +0000 (20:56 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 3 Sep 2023 12:56:44 +0000 (20:56 +0800)
ses_step_va.c

index e9c63a08138c9a69b38491c976fe38aeb7adb207..9b9e80906915397fc45f4109cca78f0d3fb9a55b 100644 (file)
@@ -2,7 +2,7 @@
 
 int _ses_path_cmp(const void* v0, const void* v1);
 
-int __ses_path_jr(ses_path_t* path)
+int __ses_path_jr(ScfEfunction* f, ses_path_t* path)
 {
        if (!path)
                return -EINVAL;
@@ -12,12 +12,13 @@ int __ses_path_jr(ses_path_t* path)
                return -EINVAL;
        }
 
-       ses_path_t* child;
-       ScfEpin*    p;
-       ScfEpin*    p0;
-       ScfEpin*    p1;
-       ScfEpin*    cp0;
-       ScfEpin*    cp1;
+       ses_path_t*    child;
+       ScfEcomponent* c;
+       ScfEpin*       p;
+       ScfEpin*       p0;
+       ScfEpin*       p1;
+       ScfEpin*       cp0;
+       ScfEpin*       cp1;
 
        double R;
        double r;
@@ -35,6 +36,12 @@ int __ses_path_jr(ses_path_t* path)
                r     += p->r;
                jr    += p->jr;
 
+               if (i & 0x1) {
+                       c   = f->components[p->cid];
+                       r  += c->r;
+                       jr += c->jr;
+               }
+
                p->tr  = r;
                p->jtr = jr;
 
@@ -54,7 +61,7 @@ int __ses_path_jr(ses_path_t* path)
                                return -EINVAL;
                        }
 
-                       int ret = __ses_path_jr(child);
+                       int ret = __ses_path_jr(f, child);
                        if (ret < 0)
                                return ret;
 
@@ -152,7 +159,7 @@ static int _va_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ct
 
                scf_logi("i: %ld, path->type: %d\n", i, path->type);
 
-               int ret = __ses_path_jr(path);
+               int ret = __ses_path_jr(f, path);
                if (ret < 0)
                        return ret;