From a4bc411a63b6464c5b5f5d6ad3739f4f804e80b4 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Fri, 10 Nov 2023 20:55:08 +0800 Subject: [PATCH] tmp --- ses_core.h | 21 +++++++++++++++++++++ ses_graph.h | 12 ------------ ses_layout.c | 6 ++++-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/ses_core.h b/ses_core.h index 431968d..3a08b02 100644 --- a/ses_core.h +++ b/ses_core.h @@ -220,4 +220,25 @@ static inline void ses_merge_r(double* tr, double* jtr, double r0, double jr0, d *jtr = jr0 / -R; } +static int ses_vertex_cmp_edges(const void* v0, const void* v1) +{ + const ses_vertex_t* sv0 = *(const ses_vertex_t**)v0; + const ses_vertex_t* sv1 = *(const ses_vertex_t**)v1; + + const ScfEcomponent* c0 = sv0->data; + const ScfEcomponent* c1 = sv1->data; + + if (sv0->edges->size > sv1->edges->size) + return -1; + if (sv0->edges->size < sv1->edges->size) + return 1; + + if (SCF_EDA_NPN == c0->type) + return -1; + if (SCF_EDA_NPN == c1->type) + return 1; + + return 0; +} + #endif diff --git a/ses_graph.h b/ses_graph.h index 459920e..249803c 100644 --- a/ses_graph.h +++ b/ses_graph.h @@ -21,18 +21,6 @@ void ses_vertex_free (ses_vertex_t* v); int ses_graph_kcolor(ses_graph_t* graph, int k, scf_vector_t* colors); -static int ses_vertex_cmp_edges(const void* v0, const void* v1) -{ - const ses_vertex_t* sv0 = *(const ses_vertex_t**)v0; - const ses_vertex_t* sv1 = *(const ses_vertex_t**)v1; - - if (sv0->edges->size > sv1->edges->size) - return -1; - if (sv0->edges->size < sv1->edges->size) - return 1; - return 0; -} - static int ses_vertex_cmp(const void* v0, const void* v1) { const ses_vertex_t* sv0 = v0; diff --git a/ses_layout.c b/ses_layout.c index 43853ac..2ce1494 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -1180,16 +1180,18 @@ static int __ses_de_cross(ScfEfunction* f, int d) scf_loge("**********\n"); } + int n = 0; for (i = 0; i < graph->size; i++) { v = graph->data[i]; if (v->color < 0) { + c = v->data; scf_loge("j: %ld, i: %ld, c%ld->color: %ld\n", j, i, c->id, v->color); - break; + n++; } } - if (i < graph->size) + if (n > 0) break; for (i = 0; i < graph->size; i++) { -- 2.25.1