c->y = cy / 2;
}
+ int tx0 = INT_MAX;
+ int tx1 = 0;
+
for (i = 0; i < f->n_elines; i++) {
el = f->elines[i];
- int x0 = INT_MAX;
- int x1 = 0;
int cx = 0;
qsort_r(el->pins, el->n_pins / 2, sizeof(uint64_t) * 2, epin_cmp_cx, f);
else
p1->x += c->x - tmp;
- el2 = f->elines[p1->lid];
-
- if (el2->lines[0]->x1 < p1->x) {
- el2->lines[0]->x1 = p1->x;
+ if (tx0 > p1->x)
+ tx0 = p1->x;
- if (f->w < p1->x)
- f->w = p1->x;
- }
+ if (tx1 < p1->x)
+ tx1 = p1->x;
}
+ }
+ }
+
+ for (i = 0; i < f->n_elines; i++) {
+ el = f->elines[i];
+
+ int x0 = INT_MAX;
+ int x1 = 0;
+
+ for (j = 0; j < el->n_pins; j += 2) {
+
+ c = f->components[el->pins[j]];
+ p0 = c->pins [el->pins[j + 1]];
if (x0 > p0->x)
x0 = p0->x;
x1 = p0->x;
}
- el->lines[0]->x0 = x0;
- el->lines[0]->x1 = x1;
+ el->lines[0]->x0 = x0 - tx0 + d;
+ el->lines[0]->x1 = x1 - tx0 + d;
+ }
+
+ for (i = 0; i < f->n_components; i++) {
+ c = f->components[i];
+
+ c->x -= tx0 - d;
- if (f->w < x1)
- f->w = x1;
+ for (j = 0; j < c->n_pins; j++) {
+ p0 = c->pins[j];
+ p0->x -= tx0 - d;
+ }
}
- f->w += d;
+ f->w = tx1 - tx0 + 2 * d;
f->h += d;
- scf_loge("f->x: %d, y: %d, w: %d, h: %d\n", f->x, f->y, f->w, f->h);
+ scf_loge("f->x: %d, y: %d, w: %d, h: %d, tx0: %d, tx1: %d\n", f->x, f->y, f->w, f->h, tx0, tx1);
return 0;
}