ses_layout_draw()
authoryu.dongliang <18588496441@163.com>
Tue, 7 Nov 2023 06:12:29 +0000 (14:12 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 7 Nov 2023 06:12:29 +0000 (14:12 +0800)
scf_eda_pb.h
ses_graph.c
ses_layout.c

index 1579a45e179128398fc351ae239cb679fff66167..109fa64963f4f5b9060c4d4c93e72287cd8a7e09 100644 (file)
@@ -18,12 +18,13 @@ enum {
        SCF_EDA_Components_NB,
 };
 
-#define SCF_EDA_PIN_NONE  0
-#define SCF_EDA_PIN_IN    1
-#define SCF_EDA_PIN_OUT   2
-#define SCF_EDA_PIN_POS   4
-#define SCF_EDA_PIN_NEG   8
-#define SCF_EDA_PIN_CF   16
+#define SCF_EDA_PIN_NONE   0
+#define SCF_EDA_PIN_IN     1
+#define SCF_EDA_PIN_OUT    2
+#define SCF_EDA_PIN_POS    4
+#define SCF_EDA_PIN_NEG    8
+#define SCF_EDA_PIN_CF     16
+#define SCF_EDA_PIN_BORDER 32
 
 #define SCF_EDA_V_INIT   -10001001.0
 #define SCF_EDA_V_MIN    -10000000.0
index 2817b2799435b09d4a1ca81ccaaa65813657d291..89080a13e1decf5912a7cfe910629ddd83d5420f 100644 (file)
@@ -279,7 +279,7 @@ static int __graph_kcolor(scf_vector_t* graph, int k, scf_vector_t* colors)
        if (!deleted)
                return -ENOMEM;
 
-       scf_logw("graph->size: %d, k: %d\n", graph->size, k);
+       scf_logd("graph->size: %d, k: %d\n", graph->size, k);
 
        int ret = __kcolor_delete(graph, k, deleted);
        if (ret < 0)
index dfd058bc9f3209b4ae378a833022011bf061c7f7..4d40f49be50fdcc9d22cd86ab12e35765725fa89 100644 (file)
@@ -517,7 +517,7 @@ static int __ses_layout_lines3(ScfEfunction* f)
        for (i = 0; i < f->n_elines; i++) {
                el        = f->elines[i];
 
-               scf_logw("el: %ld, n_conns: %ld, n_pins: %ld, flags: %#lx\n", el->id, el->n_conns, el->n_pins, el->flags);
+               scf_logd("el: %ld, n_conns: %ld, n_pins: %ld, flags: %#lx\n", el->id, el->n_conns, el->n_pins, el->flags);
        }
 
        scf_vector_clear(graph, ( void (*)(void*) )ses_vertex_free);
@@ -572,18 +572,21 @@ static int __ses_layout_lines2(ScfEfunction* f)
                el0       = f->elines[i];
 
                el0->n_lines = 0;
+
+               if (0 == i || i + 1 == f->n_elines)
+                       el0->flags |= SCF_EDA_PIN_BORDER;
        }
 
 #if 0
        for (i = 0; i < f->n_elines; i++) {
                el0       = f->elines[i];
 
-               scf_logw("el0: %ld, n_conns: %ld, n_pins: %ld, flags: %#lx\n", el0->id, el0->n_conns, el0->n_pins, el0->flags);
+               scf_logd("el0: %ld, n_conns: %ld, n_pins: %ld, flags: %#lx\n", el0->id, el0->n_conns, el0->n_pins, el0->flags);
 
                for (j = 0; j < el0->n_conns; j++) {
                        ec        = el0->conns[j];
 
-                       scf_logi("j: %ld, lid: %ld, n_cids: %ld, cid[0]: %ld\n", j, ec->lid, ec->n_cids, ec->cids[0]);
+                       scf_logd("j: %ld, lid: %ld, n_cids: %ld, cid[0]: %ld\n", j, ec->lid, ec->n_cids, ec->cids[0]);
                }
                printf("\n");
        }
@@ -896,7 +899,7 @@ next:
 
        scf_vector_qsort(crosses, ses_vertex_cmp_edges);
 
-#if 1
+#if 0
        for (i = 0; i < crosses->size; i++) {
                edge0     = crosses->data[i];
                c0        = edge0->data;
@@ -1475,7 +1478,8 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
                                cairo_stroke(cr);
 
                                if (prev) {
-                                       cairo_set_line_width(cr, 1);
+                                       if (!(el->flags & SCF_EDA_PIN_BORDER))
+                                               cairo_set_line_width(cr, 1);
 
                                        cairo_move_to(cr, prev->x0, prev->y0);
                                        cairo_line_to(cr, l->x0,    l->y0);