return 0;
}
+int epin_cmp_cx(const void* v0, const void* v1, void* arg)
+{
+ const uint64_t* t0 = v0;
+ const uint64_t* t1 = v1;
+
+ ScfEfunction* f = arg;
+ ScfEcomponent* c0 = f->components[t0[0]];
+ ScfEcomponent* c1 = f->components[t1[0]];
+
+ if (c0->x < c1->x)
+ return -1;
+
+ if (c0->x > c1->x)
+ return 1;
+
+ return 0;
+}
+
int econn_cmp(const void* v0, const void* v1)
{
const ScfEconn* ec0 = *(const ScfEconn**)v0;
}
qsort(f->elines, f->n_elines, sizeof(ScfEline*), eline_cmp_id);
-#if 1
+
for (i = 0; i < f->n_components - 1; i++) {
c0 = f->components[i];
p0 = c0->pins[0];
next:
c0 = NULL;
}
-#endif
+
int mx = 0;
int nx = INT_MIN;
int px = INT_MAX;
c0->x = cx / 2;
c0->y = cy / 2;
-
- for (j = 0; j < c0->n_pins; j++) {
- p0 = c0->pins[j];
-
- if (j < 2)
- p0->x = c0->x;
- // else
- // p0->x = (c0->x * 3 + p0->x) / 4;
- }
}
for (i = 0; i < f->n_elines; i++) {
int x0 = INT_MAX;
int x1 = 0;
+ int cx = 0;
+
+ qsort_r(el0->pins, el0->n_pins / 2, sizeof(uint64_t) * 2, epin_cmp_cx, f);
for (j = 0; j < el0->n_pins; j += 2) {
c0 = f ->components[el0->pins[j]];
p0 = c0->pins [el0->pins[j + 1]];
+ int tmp = c0->x;
+
+ if (j > 0 && c0->x < cx + d)
+ c0->x = cx + d;
+ cx = c0->x;
+
+ for (k = 0; k < c0->n_pins; k++) {
+ if (k < 2)
+ c0->pins[k]->x = c0->x;
+ else
+ c0->pins[k]->x += c0->x - tmp;
+ }
+
if (x0 > p0->x)
x0 = p0->x;
}
}
-
-
for (i = 0; i < b->n_functions; i++) {
f = b->functions[i];