if (!l)
return -ENOMEM;
- l->x0 = d * abs(i - f->n_elines / 2);
+ l->x0 = d;
l->x1 = d + l->x0;
l->y0 = d + i * d;
l->y1 = l->y0;
intptr_t N = 2;
intptr_t i;
intptr_t j;
+ intptr_t k;
int ret = __ses_get_crosses(f, d, graph);
if (ret < 0)
colors = NULL;
graph = NULL;
- for (i = 0; i < f->n_elines; i++) {
- el = f->elines[i];
+ int x1 = 0;
- qsort_r(el->pins, el->n_pins / 2, sizeof(uint64_t) * 2, epin_cmp_color, f);
+ N = j + 1;
- el->lines[0]->x1 = el->lines[0]->x0 + d;
+ for (j = 1; j <= N; j++) {
- for (j = 0; j + 1 < el->n_pins; j += 2) {
+ intptr_t j0 = (j - 1) / 2;
+ intptr_t j1 = (j - 1) % 2;
- c = f->components[el->pins[j]];
- p = c->pins [el->pins[j + 1]];
-
- intptr_t k = (c->color - 1) / 2;
- intptr_t m = (c->color - 1) % 2;
+ for (i = 0; i < f->n_elines; i++) {
+ el = f->elines[i];
- while (el->n_lines <= k) {
+ if (0 == j0)
+ el->lines[0]->x1 = el->lines[0]->x0;
- scf_logw("el->n_lines: %ld, k: %ld\n", el->n_lines, k);
+ else if (el->n_lines <= j0) {
- l0 = el->lines[el->n_lines - 1];
+ l0 = el->lines[0];
l = malloc(sizeof(ScfLine));
if (!l)
return -ENOMEM;
- l->x0 = l0->x1 + d;
+ l->x0 = x1 + d;
l->x1 = l->x0;
l->y0 = l0->y0;
l->y1 = l0->y1;
}
}
- l = el->lines[k];
- p->x = l->x1 + d;
- l->x1 = p->x;
+ for (k = 0; k + 1 < el->n_pins; k += 2) {
+
+ c = f->components[el->pins[k]];
+ p = c->pins [el->pins[k + 1]];
+
+ if ((c->color - 1) / 2 != j0)
+ continue;
+
+ l = el->lines[j0];
+ p->x = l->x1 + d;
+ l->x1 = p->x;
+
+ if (x1 < l->x1)
+ x1 = l->x1;
+ }
}
}