1, node analysis for examples/add2.cpk test ok,
authoryu.dongliang <18588496441@163.com>
Sun, 9 Jun 2024 11:44:10 +0000 (19:44 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 9 Jun 2024 11:44:21 +0000 (19:44 +0800)
2, reduce some unused code

examples/add2.cpk
main.c
ses_core.h
ses_layout.c
ses_path.c
ses_step_simplify.c
ses_step_topo.c
ses_steps.c

index 5c7bdc33aa71eae0dd14d4cedc9c74c484f0d00e..69646a7fc070240c9f952c96502cd8fb0265ab07 100644 (file)
Binary files a/examples/add2.cpk and b/examples/add2.cpk differ
diff --git a/main.c b/main.c
index f04f341d25340746ee3abc7d56551ca09de239ac..8db995fd9ebc9ab4da37da15ddc00fc5a605963b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -98,7 +98,7 @@ int main(int argc, char* argv[])
 
 //     print_board(b);
 #if 1
-       ses_layout_board(b);
+       ses_layout_board(b, 100);
 
        size_t i;
 
@@ -107,7 +107,7 @@ int main(int argc, char* argv[])
 
                printf("f: %s\n", f->name);
 
-               ses_steps_analyse(f, 100, 3);
+               ses_steps_analyse(f, 100, 5);
        }
 #endif
 
index f4eff2a3be23c1c3957307eb2d4e0f8323e66eba..7940bd0d71c49bde984f969d2cd46bbe89316343 100644 (file)
@@ -12,7 +12,6 @@ typedef struct ses_flow_s    ses_flow_t;
 typedef struct ses_node_s    ses_node_t;
 
 typedef struct ses_info_s    ses_info_t;
-typedef struct ses_data_s    ses_data_t;
 typedef struct ses_ctx_s     ses_ctx_t;
 
 struct ses_flow_s
@@ -57,28 +56,6 @@ struct ses_info_s
        int            n_capacitors;
 };
 
-typedef struct __ses_data_s
-{
-       uint64_t       id;
-
-       double         dr;
-       double         v;
-       double         a;
-       int            n_pins;
-} __ses_data_t;
-
-struct ses_data_s
-{
-       uint64_t       id;
-
-       double         dr;
-       double         v;
-       double         a;
-
-       int            n_pins;
-       __ses_data_t   pins[0];
-};
-
 struct ses_path_s
 {
        int            refs;
@@ -180,12 +157,9 @@ ses_path_t* ses_path_alloc();
 void        ses_path_free (ses_path_t* path);
 void        ses_path_print(ses_path_t* path);
 ses_path_t* ses_path_ref  (ses_path_t* src);
-int         ses_path_add  (ses_path_t* path, ses_path_t* child, ScfEfunction* f);
+int         ses_path_add  (ses_path_t* path, ses_path_t* child);
 int         ses_path_xchg (ses_path_t* path0, int k0, ses_path_t* path1, int k1);
 
-int         ses_path_save (ScfEfunction* f, ses_path_t* path, scf_vector_t** data);
-int         ses_path_load (ScfEfunction* f, ses_path_t* path, scf_vector_t*  data);
-
 ses_path_t* ses_path_same_net(ses_path_t* path0,  ses_path_t* path1);
 int         ses_path_is_child(ses_path_t* parent, ses_path_t* child);
 ses_path_t* ses_path_find_child(ses_path_t* path, int m, int n);
@@ -217,25 +191,18 @@ void        ses_ctx_free (ses_ctx_t* ctx);
 void ses_components_print(ScfEfunction* f);
 void ses_elines_print    (ScfEfunction* f);
 
+int ses_layout_board (ScfEboard*    b, int d);
 int ses_layout_paths (ScfEfunction* f, scf_vector_t*  paths);
-int ses_layout_board (ScfEboard*    b);
 int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count);
 
 int ses_simplify_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t by, uint32_t bw, uint32_t bh, int64_t ns, int64_t count);
 
-int ses_paths_find_flow(ses_flow_t* flow, scf_vector_t* paths, ScfEpin* vip,  ses_path_t* bridge);
-int ses_flow_find_pos  (ses_flow_t* flow, scf_vector_t* paths, ScfEfunction* f);
-int ses_flow_find_neg  (ses_flow_t* flow, scf_vector_t* paths, ScfEfunction* f);
-
 int  __ses_path_va_diode (ScfEfunction* f, ses_path_t* path);
-int  __ses_path_va_bridge(ScfEfunction* f, ses_path_t* bridge, int* changed, scf_vector_t* paths, int64_t ns, int64_t count);
 int  __ses_path_va_branch(ScfEfunction* f, ses_path_t* path, int m, int n, double pr, int* changed, int64_t ns, int64_t count);
 
 void __ses_path_split_i(ScfEfunction* f, ses_path_t* path, int i, int j, double la, double* a);
 int  __ses_status_check(ScfEfunction* f, ScfEcomponent* c, ScfEpin* pb, ScfEpin* pe, int vinit);
 
-void __ses_status_check_line(ScfEfunction* f, ScfEline* el, int* changed);
-
 
 int __ses_nodes_path      (ScfEfunction* f, ses_path_t* path, int vip_m, int vip_n, scf_vector_t** pnodes, scf_vector_t** pedges);
 int __ses_nodes_path_solve(ScfEfunction* f, ses_path_t* path, int vip_m, int vip_n, int* changed, int64_t ns, int64_t count);
@@ -248,7 +215,6 @@ void __ses_path_lc(ScfEfunction* f, ses_path_t* path, int m, int n, double* cv,
 int  __ses_path_va3(ScfEfunction* f, ses_path_t* path, int m, int n, double pr, int* changed, int64_t ns, int64_t count);
 int  __ses_path_va2(ScfEfunction* f, ses_path_t* path, int m, int n, double pr, int* changed, int64_t ns, int64_t count);
 int  __ses_path_va (ScfEfunction* f, ses_path_t* path, int *changed, int64_t ns, int64_t count);
-int  __ses_flow_va (ScfEfunction* f, ses_flow_t* flow, double* rp, double* rn, int* changed, int64_t ns, int64_t count);
 
 int  __ses_path_pos(ScfEfunction* f, ScfEline*   el);
 int  __ses_path_neg(ScfEfunction* f, ScfEline*   el);
index 12c13892a74aef492341a969531bb65240e18395..104f998188952e90aca2bb5af8ab1f2eb0a34670 100644 (file)
@@ -1316,7 +1316,7 @@ static int __ses_de_cross(ScfEfunction* f, int d)
        return 0;
 }
 
-static void __ses_setc_xy(ScfEfunction* f, int d)
+static void __ses_set_xy(ScfEfunction* f, int d)
 {
        ScfEcomponent* c;
        ScfEpin*       p0;
@@ -1489,7 +1489,7 @@ static void __ses_xchg_cx(ScfEfunction* f, int d)
        } while (n > 0);
 }
 
-static void __ses_layout_cx(ScfEfunction* f, int d)
+static void __ses_set_cx(ScfEfunction* f, int d)
 {
        ScfEcomponent* c;
        ScfEcomponent* c2;
@@ -1507,29 +1507,108 @@ static void __ses_layout_cx(ScfEfunction* f, int d)
 
                int tmp = c->x;
 
-               for (j = 0; j < c->n_pins; j++) {
-                       p  =        c->pins[j];
+               c->x = c2->x + d;
+
+               for (k = 0; k < c->n_pins; k++) {
+                       p         = c->pins[k];
+                       p->x     += c->x - tmp;
+               }
+       }
+       qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_id);
+}
+
+static void __ses_min_cx(ScfEfunction* f, int d)
+{
+       ScfEcomponent* c;
+       ScfEcomponent* c2;
+       ScfEpin*       p;
+       ScfEpin*       p2;
+
+       long i;
+       long j;
+       long k;
+       long m;
+
+       qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_cx);
+
+       for (i = 1; i < f->n_components; i++) {
+               c  =        f->components[i];
+
+               int tmp = c->x;
+               int max = 0;
+               int m0  = 0;
+
+               if (c->color > 0)
+                       m0 = (c->color - 1) / 2;
+
+               for (j = i - 1; j >= 0; j--) {
+                       c2 = f->components[j];
+
+                       int m1 = 0;
+
+                       if (c2->color > 0)
+                               m1 = (c2->color - 1) / 2;
+
+                       if (m0 != m1)
+                               continue;
+
+                       for (k = 0; k < c->n_pins; k++) {
+                               p  =        c->pins[k];
 
-                       for (k = 0; k < c2->n_pins; k++) {
-                               p2 =        c2->pins[k];
+                               for (m = 0; m < c2->n_pins; m++) {
+                                       p2 =        c2->pins[m];
 
-                               if (p->lid == p2->lid) {
-                                       c->x = c2->x + d;
-                                       goto _set_px;
+                                       if (p->y == p2->y) {
+                                               if ((c->y >= p->y && c2->y >= p->y) || (c->y <= p->y && c2->y <= p->y)) {
+
+                                                       if (max < c2->x) {
+                                                               max = c2->x;
+                                                               scf_logd("c%ld->x: %d, c%ld->x: %d\n", c->id, c->x, c2->id, c2->x);
+                                                       }
+                                               }
+                                       } else if (p->y > p2->y) {
+                                               if ((c->y < p->y && c2->y > c->y) || (c->y >= p->y && c2->y > p->y)) {
+                                                       if (max < c2->x)
+                                                               max = c2->x;
+                                               }
+                                       } else {
+                                               if ((c->y < p->y && c2->y < p->y) || (c->y >= p->y && c2->y < c->y)) {
+                                                       if (max < c2->x)
+                                                               max = c2->x;
+                                               }
+                                       }
                                }
                        }
                }
 
-               c->x = c2->x + d;
-
+               if (0 == max)
+                       continue;
+               c->x = max + d;
 _set_px:
                for (k = 0; k < c->n_pins; k++) {
                        p         = c->pins[k];
                        p->x     += c->x - tmp;
                }
+       }
+
+       qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_cx);
+
+       for (i = 1; i < f->n_components; i++) {
+               c  =        f->components[i];
+               c2 =        f->components[i - 1];
 
-               scf_logd("c%ld->x: %d\n", c->id, c->x);
+               int tmp = c->x;
+
+               if (c->x - c2->x > d) {
+                       c->x = c2->x + d;
+
+                       for (k = 0; k < c->n_pins; k++) {
+                               p         = c->pins[k];
+                               p->x     += c->x - tmp;
+                       }
+               }
        }
+
        qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_id);
 }
 
@@ -1617,10 +1696,10 @@ int ses_layout_function(ScfEfunction* f, int d)
        if (ret < 0)
                return ret;
 
-       __ses_setc_xy(f, d);
-       __ses_layout_cx(f, d);
-
+       __ses_set_xy(f, d);
+       __ses_set_cx(f, d);
        __ses_xchg_cx(f, d);
+       __ses_min_cx(f, d);
        __ses_xchg_ce(f, d);
 
        int tx0 = INT_MAX;
@@ -1659,7 +1738,7 @@ int ses_layout_function(ScfEfunction* f, int d)
 //             printf("\n");
        }
 
-       f->w  = tx1 + d * 3;
+       f->w  = tx1 + d * 2;
        f->h += d;
 
        scf_loge("f->x: %d, y: %d, w: %d, h: %d, tx0: %d, tx1: %d\n", f->x, f->y, f->w, f->h, tx0, tx1);
@@ -1772,7 +1851,7 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
        return 0;
 }
 
-int ses_layout_board(ScfEboard* b)
+int ses_layout_board(ScfEboard* b, int d)
 {
        ScfEfunction*  f;
        scf_vector_t*  loops;
@@ -1795,7 +1874,7 @@ int ses_layout_board(ScfEboard* b)
 
                ses_lines_same_components(f);
 
-               int ret = ses_layout_function(f, 90);
+               int ret = ses_layout_function(f, d);
                if (ret < 0) {
                        scf_loge("\n");
                        return ret;
index c3a5039170f0fae1aa31145212945f0f27f940ef..f8ad5898e930ca9263739d03c068a913be5b2cab 100644 (file)
@@ -58,42 +58,6 @@ void ses_path_free(ses_path_t* path)
        }
 }
 
-ses_path_t* ses_path_ref(ses_path_t* src)
-{
-       if (!src)
-               return NULL;
-
-       ses_path_t* dst = ses_path_alloc();
-       if (!dst)
-               return NULL;
-
-       dst->pins = scf_vector_clone(src->pins);
-       if (!dst->pins) {
-               ses_path_free(dst);
-               return NULL;
-       }
-
-       if (src->childs) {
-               dst->childs = scf_vector_clone(src->childs);
-
-               if (!dst->childs) {
-                       ses_path_free(dst);
-                       return NULL;
-               }
-
-               ses_path_t* child;
-               int i;
-
-               for (i = 0; i < dst->childs->size; i++) {
-                       child     = dst->childs->data[i];
-                       child->refs++;
-               }
-       }
-
-       dst->index = src->index;
-       return dst;
-}
-
 ses_path_t* ses_path_same_net(ses_path_t* path0, ses_path_t* path1)
 {
        while (path0->parent)
@@ -356,7 +320,7 @@ int ses_path_xchg(ses_path_t* path0, int k0, ses_path_t* path1, int k1)
        return 0;
 }
 
-int ses_path_add(ses_path_t* parent, ses_path_t* child, ScfEfunction* f)
+int ses_path_add(ses_path_t* parent, ses_path_t* child)
 {
        if (!parent || !child)
                return -EINVAL;
@@ -367,58 +331,30 @@ int ses_path_add(ses_path_t* parent, ses_path_t* child, ScfEfunction* f)
                        return -ENOMEM;
        }
 
-       ses_path_t* path;
-       ScfEpin*    p0;
-       ScfEpin*    p1;
-       ScfEpin*    cp0 = child->pins->data[0];
-       ScfEpin*    cp1 = child->pins->data[child->pins->size - 1];
-
-       int j;
+       ScfEpin*  p0;
+       ScfEpin*  p1;
+       ScfEpin*  cp0 = child->pins->data[0];
+       ScfEpin*  cp1 = child->pins->data[child->pins->size - 1];
 
        if (scf_vector_add(parent->childs, child) < 0)
                return -ENOMEM;
 
+       child->parent_p0 = -1;
+       child->parent_p1 = -1;
+
+       int j;
        for (j = 0; j < parent->pins->size; j++) {
                p0 =        parent->pins->data[j];
 
-               if (p0->lid == cp0->lid) {
+               if (p0->lid == cp0->lid)
                        child->parent_p0 = (j + 1) & ~0x1;
-                       break;
-               }
-       }
-       assert(j < parent->pins->size);
-
-       int n_transistors = 0;
-       int n_capacitors  = 0;
-       int n_diodes = 0;
-       int n_NPNs   = 0;
-
-       for ( ; j < parent->pins->size; j++) {
-               p0    = parent->pins->data[j];
-
-               if (!(j & 0x1)) {
-                       ScfEcomponent* c = f->components[p0->cid];
 
-                       if (SCF_EDA_Capacitor == c->type)
-                               n_capacitors++;
-
-                       else if (SCF_EDA_Diode == c->type)
-                               n_diodes++;
-
-                       else if (SCF_EDA_NPN == c->type) {
-                               if (SCF_EDA_NPN_B == p0->id)
-                                       n_NPNs++;
-                               else if (SCF_EDA_NPN_C == p0->id)
-                                       n_transistors++;
-                       }
-               }
-
-               if (p0->lid == cp1->lid) {
+               else if (p0->lid == cp1->lid)
                        child->parent_p1 = j;
+
+               if (child->parent_p0 >= 0 && child->parent_p1 >= 0)
                        break;
-               }
        }
-       assert(j < parent->pins->size);
 
        p0 = parent->pins->data[0];
        p1 = parent->pins->data[parent->pins->size - 1];
@@ -427,287 +363,7 @@ int ses_path_add(ses_path_t* parent, ses_path_t* child, ScfEfunction* f)
                        parent->index, p0->cid, p0->id, p1->cid, p1->id,
                        child->index, cp0->cid, cp0->id, cp1->cid, cp1->id);
 
-       if (0 == n_transistors
-                       && (n_diodes + n_NPNs < child->n_diodes + child->n_NPNs
-                               || (n_diodes + n_NPNs == child->n_diodes + child->n_NPNs && n_capacitors < child->n_capacitors))) {
-
-               int ret = ses_path_xchg(parent, child->parent_p0, child, 0);
-               if (ret < 0)
-                       return ret;
-
-               int old_parent_p1 = child->parent_p1;
-               j                 = child->parent_p1 - child->parent_p0 + 1;
-               child->parent_p1  = parent->pins->size - 1;
-
-               while (j < child->pins->size) {
-                       p0   = child->pins->data[j];
-
-                       assert(0 == scf_vector_del(child->pins, p0));
-
-                       ret = scf_vector_add(parent->pins, p0);
-                       if (ret < 0)
-                               return ret;
-               }
-
-               parent->n_NPNs   += child->n_NPNs - n_NPNs;
-               child ->n_NPNs    = n_NPNs;
-
-               parent->n_diodes += child->n_diodes - n_diodes;
-               child ->n_diodes  = n_diodes;
-
-               parent->n_capacitors += child->n_capacitors - n_capacitors;
-               child ->n_capacitors  = n_capacitors;
-
-               for (j = 0; j < parent->childs->size; ) {
-                       path      = parent->childs->data[j];
-
-                       if (path == child) {
-                               j++;
-                               continue;
-                       }
-
-                       if (path->parent_p1 <= child->parent_p0) {
-                               j++;
-                               continue;
-                       }
-
-                       if (path->parent_p0 >= child->parent_p1) {
-                               path->parent_p0 += child->parent_p1 - old_parent_p1;
-                               path->parent_p1 += child->parent_p1 - old_parent_p1;
-                               j++;
-                               continue;
-                       }
-
-                       if (path->parent_p0 == child->parent_p0 && path->parent_p1 == old_parent_p1)
-                               continue;
-
-                       cp0 = path->pins->data[0];
-                       cp1 = path->pins->data[path->pins->size - 1];
-
-                       path->parent_p0 = -1;
-                       path->parent_p1 = -1;
-
-                       int k;
-                       for (k = 0; k < parent->pins->size; k++) {
-                               p0 =        parent->pins->data[k];
-
-                               if (p0->lid == cp0->lid) {
-                                       path->parent_p0 = k;
-                                       continue;
-                               }
-
-                               if (p0->lid == cp1->lid) {
-                                       path->parent_p1 = k;
-                                       break;
-                               }
-                       }
-
-                       if (-1 == path->parent_p0 || -1 == path->parent_p1) {
-                               assert(0 == scf_vector_del(parent->childs, path));
-
-                               if (!parent->bridges) {
-                                       parent->bridges = scf_vector_alloc();
-                                       if (!parent->bridges)
-                                               return -ENOMEM;
-                               }
-
-                               ret = scf_vector_add(parent->bridges, path);
-                               if (ret < 0)
-                                       return ret;
-                       } else
-                               j++;
-               }
-
-               if (child->childs) {
-                       for (j = 0; j < child->childs->size; ) {
-                               path      = child->childs->data[j];
-
-                               cp0 = path->pins->data[0];
-                               cp1 = path->pins->data[path->pins->size - 1];
-
-                               path->parent_p0 = -1;
-                               path->parent_p1 = -1;
-
-                               int k;
-                               for (k = 0; k < child->pins->size; k++) {
-                                       p0 =        child->pins->data[k];
-
-                                       if (p0->lid == cp0->lid) {
-                                               path->parent_p0 = k;
-                                               continue;
-                                       }
-
-                                       if (p0->lid == cp1->lid) {
-                                               path->parent_p1 = k;
-                                               break;
-                                       }
-                               }
-
-                               if (-1 == path->parent_p0 || -1 == path->parent_p1) {
-                                       assert(0 == scf_vector_del(child->childs, path));
-
-                                       ret = ses_path_add(parent, path, f);
-                                       if (ret < 0)
-                                               return ret;
-                               } else
-                                       j++;
-                       }
-               }
-       }
-
        child->parent = parent;
        child->type   = SES_PATH_BRANCH;
        return 0;
 }
-
-static int __ses_path_save(ScfEfunction* f, ses_path_t* path, scf_vector_t* vec)
-{
-       ses_path_t*    child;
-       ses_data_t*    d;
-
-       ScfEcomponent* c;
-       ScfEpin*       p;
-
-       int i;
-       int j;
-
-       for (i = 0; i < path->pins->size; i += 2) {
-               p  =        path->pins->data[i];
-
-               c  = f->components[p->cid];
-               d  = NULL;
-
-               if (SCF_EDA_NPN == c->type) {
-                       for (j = vec->size - 1; j >= 0; j--) {
-                               d  = vec->data[j];
-
-                               if (d->id == c->id)
-                                       goto save_pins;
-                       }
-               }
-
-               d = malloc(sizeof(ses_data_t) * (1 + c->n_pins));
-               if (!d)
-                       return -ENOMEM;
-
-               int ret = scf_vector_add(vec, d);
-               if (ret < 0) {
-                       free(d);
-                       return ret;
-               }
-
-               d->id = c->id;
-               d->dr = c->dr;
-               d->v  = c->v;
-               d->a  = c->a;
-               d->n_pins = c->n_pins;
-
-save_pins:
-               for (j = 0; j < c->n_pins; j++) {
-                       p  =        c->pins[j];
-
-                       d->pins[j].id = p->id;
-                       d->pins[j].dr = p->dr;
-                       d->pins[j].v  = p->v;
-                       d->pins[j].a  = p->a;
-                       d->pins[j].n_pins = 0;
-               }
-       }
-
-       if (path->childs) {
-               for (i = 0; i < path->childs->size; i++) {
-                       child     = path->childs->data[i];
-
-                       int ret = __ses_path_save(f, child, vec);
-                       if (ret < 0)
-                               return ret;
-               }
-       }
-
-       return 0;
-}
-
-int ses_path_save(ScfEfunction* f, ses_path_t* path, scf_vector_t** data)
-{
-       if (!f || !path || !data)
-               return -EINVAL;
-
-       scf_vector_t* vec = scf_vector_alloc();
-       if (!vec)
-               return -ENOMEM;
-
-       int ret = __ses_path_save(f, path, vec);
-       if (ret < 0) {
-               scf_vector_clear(vec, (void (*)(void*) )free);
-               scf_vector_free(vec);
-               return ret;
-       }
-
-       *data = vec;
-       return 0;
-}
-
-void ses_data_free(scf_vector_t* vec)
-{
-       if (vec) {
-               scf_vector_clear(vec, (void (*)(void*) )free);
-               scf_vector_free(vec);
-       }
-}
-
-void ses_data_print(scf_vector_t* vec)
-{
-       __ses_data_t* p;
-       ses_data_t*   c;
-       int i;
-       int j;
-
-       if (vec) {
-               for (i = 0; i < vec->size; i++) {
-                       c  =        vec->data[i];
-
-                       printf("c%ld->v: %lg, a: %lg, dr: %lg\n", c->id, c->v, c->a, c->dr);
-
-                       for (j = 0; j < c->n_pins; j++) {
-                               p  =       &c->pins[j];
-
-                               printf("c%ldp%ld->v: %lg, a: %lg, dr: %lg\n", c->id, p->id, p->v, p->a, p->dr);
-                       }
-                       printf("\n");
-               }
-       }
-}
-
-int ses_path_load(ScfEfunction* f, ses_path_t* path, scf_vector_t* data)
-{
-       if (!f || !path || !data)
-               return -EINVAL;
-
-       ses_data_t*    d;
-       ScfEcomponent* c;
-       ScfEpin*       p;
-
-       int i;
-       int j;
-
-       for (i = 0; i < data->size; i++) {
-               d  =        data->data[i];
-
-               c     = f->components[d->id];
-               c->v  = d->v;
-               c->a  = d->a;
-               c->dr = d->dr;
-
-               assert(d->n_pins == c->n_pins);
-
-               for (j = 0; j < c->n_pins; j++) {
-                       p  =        c->pins[j];
-
-                       p->v  = d->pins[j].v;
-                       p->a  = d->pins[j].a;
-                       p->dr = d->pins[j].dr;
-               }
-       }
-
-       return 0;
-}
index c9456392a139b73f694a3bf86e8d4e2ca30325e1..ed11373ceb8e854ad5e6243f144abef5a56e9bd2 100644 (file)
@@ -558,10 +558,7 @@ int ses_simplify_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t b
                                continue;
 
                        if (!prev) {
-                               if (el->vconst)
-                                       cairo_select_font_face(cr, "Calibri", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-                               else
-                                       cairo_select_font_face(cr, "Georgia", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
+                               cairo_select_font_face(cr, "Calibri", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
 
                                cairo_set_font_size(cr, 28);
 
@@ -602,32 +599,11 @@ int ses_simplify_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t b
                                else
                                        n += snprintf(text + n, sizeof(text) - 1 - n, ", in %lguA", (int64_t)(el->ain * 1000000.0 * SHOW_BITS) / SHOW_BITS);
 #endif
-                               int cx = INT_MAX;
-                               int cy = l->y0;
-
-                               for (i = 0; i < el->n_pins; i += 2) {
-                                       c = f->components[el->pins[i]];
-
-                                       if (c->x > l->x0 && c->x < cx) {
-                                               cx = c->x;
-                                               cy = c->y;
-                                       }
-                               }
-
-                               if (INT_MAX == cx)
-                                       cx = l->x0;
-
                                cairo_set_font_size(cr, 20);
 
-                               if (cy > l->y0) {
-                                       cairo_move_to  (cr, cx - 40, l->y0 - 8);
-                                       cairo_show_text(cr, text);
-                                       cairo_stroke(cr);
-                               } else {
-                                       cairo_move_to  (cr, cx - 40, l->y0 + 24);
-                                       cairo_show_text(cr, text);
-                                       cairo_stroke(cr);
-                               }
+                               cairo_move_to  (cr, l->x0 + 10, l->y0 - 8);
+                               cairo_show_text(cr, text);
+                               cairo_stroke(cr);
                        }
 
                        cairo_set_line_width(cr, 4);
index c2861b7f3b362e08e4713285c8fabe2d91d541df..2110857f04f629769e7d0aef32aaeeb6183e6d78 100644 (file)
@@ -113,12 +113,6 @@ static int __ses_dfs_path(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* rp, scf_v
                        return __ses_dfs_add_ppath(__paths, ppath);
                }
 
-               if (SCF_EDA_NPN == rc->type && SCF_EDA_NPN_C == rp->id) {
-                       scf_logd("NPN C, c%ldp%ld\n\n", rp->cid, rp->id);
-
-                       return __ses_dfs_add_ppath(__paths, ppath);
-               }
-
                ses_path_t* off = NULL;
 
                if (SCF_EDA_Status_OFF == rc->status) {
@@ -710,11 +704,6 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths)
        for (i    = 0; i < paths->size; ) {
                path0 = paths->data[i];
 
-               if (path0->n_transistors > 0) {
-                       i++;
-                       continue;
-               }
-
                p0 = path0->pins->data[0];
                p1 = path0->pins->data[path0->pins->size - 1];
 
@@ -734,9 +723,6 @@ static int _topo_path_completes(ScfEfunction* f, scf_vector_t* paths)
                        if (path1 == path0)
                                continue;
 
-                       if (path1->n_transistors > 0)
-                               continue;
-
                        p2 = path1->pins->data[0];
                        p3 = path1->pins->data[path1->pins->size - 1];
 
@@ -1077,7 +1063,7 @@ branch:
                if (scf_vector_del(paths, child) < 0)
                        return -1;
 
-               if (ses_path_add(parent, child, f) < 0) {
+               if (ses_path_add(parent, child) < 0) {
                        ses_path_free(child);
                        return -ENOMEM;
                }
@@ -1516,7 +1502,7 @@ static int _topo_path_parallel(ScfEfunction* f, scf_vector_t* paths)
 
                        if (p0->lid == p2->lid && p1->lid == p3->lid) {
 
-                               int ret = ses_path_add(parent, child, f);
+                               int ret = ses_path_add(parent, child);
                                if (ret < 0)
                                        return ret;
 
@@ -1592,9 +1578,6 @@ static int _topo_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t*
        if (ret < 0)
                return ret;
 
-//     _topo_print(ctx->paths);
-//     scf_logi("----\n");
-
        ret = __ses_topo_layers(f, ctx->paths);
        if (ret < 0)
                return ret;
index 61c6a3b8ca8fd311c09bb812a511848397d5ea20..5b6f94c8c032a635bbe29875fab2405e771fc8ad 100644 (file)
@@ -18,11 +18,8 @@ extern ses_step_t   ses_step_status;
 extern ses_step_t   ses_step_open;
 extern ses_step_t   ses_step_va_nodes;
 
-extern ses_step_t   ses_step_a_stat;
-
 extern ses_step_t   ses_step_output;
 extern ses_step_t   ses_step_simplify;
-extern ses_step_t   ses_step_simplify2;
 
 
 static ses_step_t*  ses_steps_0[] =
@@ -51,8 +48,6 @@ static ses_step_t*  ses_steps_2[] =
        &ses_step_open,
        &ses_step_va_nodes,
 
-//     &ses_step_a_stat,
-
        &ses_step_output,
        &ses_step_simplify,
 };