From 0649129a2d48fdab4f93f5cd33b5b261bdc3c95b Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Tue, 7 Nov 2023 14:12:29 +0800 Subject: [PATCH] ses_layout_draw() --- scf_eda_pb.h | 13 +++++++------ ses_graph.c | 2 +- ses_layout.c | 14 +++++++++----- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/scf_eda_pb.h b/scf_eda_pb.h index 1579a45..109fa64 100644 --- a/scf_eda_pb.h +++ b/scf_eda_pb.h @@ -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 diff --git a/ses_graph.c b/ses_graph.c index 2817b27..89080a1 100644 --- a/ses_graph.c +++ b/ses_graph.c @@ -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) diff --git a/ses_layout.c b/ses_layout.c index dfd058b..4d40f49 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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); -- 2.25.1