if (SCF_EDA_NPN_E == p1->id) {
if (cp1 != p1)
p1 = path->pins->data[j - 1];
- } else
+
+ } else if (j > 0)
p1 = path->pins->data[j - 1];
+ else {
+ *r = 0;
+ *jr = 0;
+ }
}
if (SCF_EDA_NPN == c0->type) {
return 0;
}
+static void __ses_path_parent_jr(ScfEfunction* f, ses_path_t* path)
+{
+ if (!path->childs)
+ return;
+
+ ses_path_t* child;
+
+ int i;
+
+ for (i = 0; i < path->childs->size; i++) {
+ child = path->childs->data[i];
+
+ child->parent_r0 = 0;
+ child->parent_jr0 = 0;
+
+ child->parent_r1 = 0;
+ child->parent_jr1 = 0;
+
+ if (child->parent_p0 > 0)
+ __ses_path_pr(f, path, 0, child->parent_p0, NULL, &child->parent_r0, &child->parent_jr0);
+
+ if (child->parent_p1 < path->pins->size - 1)
+ __ses_path_pr(f, path, child->parent_p1, path->pins->size - 1, NULL, &child->parent_r1, &child->parent_jr1);
+
+ child->parent_r0 += path->parent_r0;
+ child->parent_jr0 += path->parent_jr0;
+
+ child->parent_r1 += path->parent_r1;
+ child->parent_jr1 += path->parent_jr1;
+
+ scf_logw("child: %d, parent_p0: %d, parent_p1: %d, r0: %lg, r1: %lg\n",
+ child->index, child->parent_p0, child->parent_p1, child->parent_r0, child->parent_r1);
+
+ __ses_path_parent_jr(f, child);
+ }
+}
+
static int _jr_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t* ctx)
{
ses_path_t* path;
if (ret < 0)
return ret;
+ path->parent_r0 = 0;
+ path->parent_jr0 = 0;
+
+ path->parent_r1 = 0;
+ path->parent_jr1 = 0;
+
+ __ses_path_parent_jr(f, path);
printf("\n");
}