From: yu.dongliang <18588496441@163.com> Date: Wed, 12 Jul 2023 08:29:03 +0000 (+0800) Subject: tmp X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=973d2078076b224f3816b9a91e2a55c66bfbbdb1;p=ses.git tmp --- diff --git a/main.c b/main.c index c78a0b3..cd0eda3 100644 --- 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]); diff --git a/ses_layout.c b/ses_layout.c index 8562d98..519bc59 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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;