tmp
authoryu.dongliang <18588496441@163.com>
Fri, 10 Nov 2023 12:55:08 +0000 (20:55 +0800)
committeryu.dongliang <18588496441@163.com>
Fri, 10 Nov 2023 12:55:08 +0000 (20:55 +0800)
ses_core.h
ses_graph.h
ses_layout.c

index 431968d93a6af0180778c59ddb4b7b1b1132df5b..3a08b02a7a95066e44315dc43497b6983687c845 100644 (file)
@@ -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
index 459920eb1b37e2fa7938cf974fcdc01a8d0922ee..249803c557a0e8dd94f8cbe2e312dc283f7736f5 100644 (file)
@@ -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;
index 43853acaf916fc51c4335525fecb8bf04fb25639..2ce14944bea55e406094a855be2ca66f2c250514 100644 (file)
@@ -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++) {