tmp
authoryu.dongliang <18588496441@163.com>
Wed, 12 Jul 2023 08:29:03 +0000 (16:29 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 12 Jul 2023 08:29:03 +0000 (16:29 +0800)
main.c
ses_layout.c

diff --git a/main.c b/main.c
index c78a0b3815406bd2ea10f94d3c89b9bbb52ef6c6..cd0eda33e7153510966c3a6a066dcef1d47e54dd 100644 (file)
--- a/main.c
+++ b/main.c
@@ -77,7 +77,7 @@ int main(int argc, char* argv[])
                        for (k = 0; k < c->n_pins; k++) {
                                p  =        c->pins[k];
 
-                               printf("cid: %ld, pid: %ld\n", p->cid, p->id);
+                               printf("cid: %ld, pid: %ld, flags: %#lx\n", p->cid, p->id, p->flags);
 
                                for (m = 0; m + 1 < p->n_tos; m += 2)
                                        printf("to cid: %ld, pid: %ld\n", p->tos[m], p->tos[m + 1]);
index 8562d98537a5a1abb1d42418f193594213128812..519bc59d0d4672e76161f5e3e77397c74e3a6918 100644 (file)
@@ -398,7 +398,7 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u
                        m = j * d % f->w;
                        assert(m < l->x1);
 
-                       p->x = l->x0 + m;
+                       p->x = l->x0 + m + rand() % 5;
                        p->y = l->y0;
                }
        }
@@ -545,15 +545,28 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
                }
        }
 
+
+
        for (i = 0; i < b->n_functions; i++) {
                f  =        b->functions[i];
 
                for (j = 0; j < f->n_components; j++) {
                        c  =        f->components[j];
                
+                       scf_logw("j: %ld, c->id: %ld, n_pins: %ld, ", j, c->id, c->n_pins);
+
+                       uint8_t text[64];
+                       snprintf(text, sizeof(text) - 1, "%ld", c->id);
+
+                       cairo_set_source_rgb  (cr, 0, 0, 0);
+                       cairo_select_font_face(cr, "Georgia", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
+                       cairo_set_font_size   (cr, 20);
+                       cairo_move_to         (cr, c->x + 5, c->y - 5);
+                       cairo_show_text       (cr, text);
+                       cairo_stroke(cr);
+
                        cairo_set_source_rgb(cr, 0.5, 0.5, 0.0);
 
-                       scf_logw("j: %ld, c->id: %ld, n_pins: %ld, ", j, c->id, c->n_pins);
                        int dx0;
                        int dy0;