__ses_layout_npn()
authoryu.dongliang <18588496441@163.com>
Fri, 10 Nov 2023 04:20:17 +0000 (12:20 +0800)
committeryu.dongliang <18588496441@163.com>
Fri, 10 Nov 2023 04:20:17 +0000 (12:20 +0800)
ses_layout.c

index 0833fc9896bcdcca670a83a7dc7e124da5180e73..b2fd915afb20bf45cc9ffd48063f95c0b15d6edf 100644 (file)
@@ -688,22 +688,14 @@ end:
        return ret;
 }
 
-static int __ses_layout_lines2(ScfEfunction* f)
+static void __ses_layout_npn(ScfEfunction* f)
 {
-       ScfEline* tmp;
        ScfEline* el0;
        ScfEline* el1;
-       ScfEconn* ec;
 
        size_t i;
        size_t j;
-       size_t m;
 
-       if (f->n_elines <= 2)
-               return 0;
-
-       __ses_layout_lines4(f);
-#if 1
        for (i  = 0; i < f->n_elines; i++) {
                el0 =        f->elines[i];
 
@@ -727,7 +719,7 @@ static int __ses_layout_lines2(ScfEfunction* f)
                        if (SCF_EDA_NPN_C == p->id)
                                cflag = 1;
 
-                       m = __ses_find_eline_index(f, c->pins[SCF_EDA_NPN_B]->lid);
+                       intptr_t m = __ses_find_eline_index(f, c->pins[SCF_EDA_NPN_B]->lid);
 
                        if (ib > m)
                                ib = m;
@@ -741,7 +733,26 @@ static int __ses_layout_lines2(ScfEfunction* f)
                        scf_logi("mov el%ld [%ld] <--> [%ld] el%ld\n", el0->id, i, ib, el1->id);
                }
        }
-#endif
+}
+
+static int __ses_layout_lines2(ScfEfunction* f)
+{
+       ScfEline* tmp;
+       ScfEline* el0;
+       ScfEline* el1;
+       ScfEconn* ec;
+
+       size_t i;
+       size_t j;
+       size_t m;
+
+       if (f->n_elines <= 2)
+               return 0;
+
+       __ses_layout_lines4(f);
+
+       __ses_layout_npn(f);
+
 #if 1
        for (i = 0; i < f->n_elines; i++) {
                el0       = f->elines[i];
@@ -1670,8 +1681,8 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
                                if (l->x0 > l->x1)
                                        continue;
 
-                               if (!prev) {
-                                       snprintf(text, sizeof(text) - 1, "%ld", el->id);
+                               if (1 || !prev) {
+                                       snprintf(text, sizeof(text) - 1, "%ld_%ld", el->id, k);
 
                                        cairo_move_to  (cr, l->x0 - 30, l->y0 + 5);
                                        cairo_show_text(cr, text);