el->c_pins = el->n_pins;
el->id = i;
- scf_loge("line i: %ld, %p, el->flags: %#lx\n", i, el, el->flags);
+ scf_logd("line i: %ld, %p, el->flags: %#lx\n", i, el, el->flags);
for (j = 0; j + 1 < el->n_pins; j += 2) {
p->lid = i;
p->c_lid = i;
- scf_logi("pin j: %ld, c%ldp%ld\n", j, el->pins[j], el->pins[j + 1]);
+ scf_logd("pin j: %ld, c%ldp%ld\n", j, el->pins[j], el->pins[j + 1]);
}
- printf("\n");
i++;
}
}
#if 1
- for (i = 0; i < f->n_elines; i++) {
- el0 = f->elines[i];
+ k0 = INT_MAX;
- if (el0->n_pins > 4)
- continue;
+ while (1) {
+ k1 = 0;
- for (j = i + 1; j < f->n_elines; j++)
- f->elines[j - 1] = f->elines[j];
+ for (i = 0; i < f->n_elines; i++) {
+ el0 = f->elines[i];
- j = __ses_find_eline_index(f, el0->conns[0]->lid);
+ if (el0->n_pins > 4)
+ continue;
- if (el0->n_conns > 1) {
- m = __ses_find_eline_index(f, el0->conns[1]->lid);
+ for (j = i + 1; j < f->n_elines; j++)
+ f->elines[j - 1] = f->elines[j];
- if (j > m)
- SCF_XCHG(j, m);
+ j = __ses_find_eline_index(f, el0->conns[0]->lid);
- el1 = f->elines[j];
- ++j;
- } else if (j > f->n_elines / 2) {
- el1 = f->elines[j];
- ++j;
- } else {
- el1 = f->elines[j];
- }
+ if (el0->n_conns > 1) {
+ m = __ses_find_eline_index(f, el0->conns[1]->lid);
+
+ if (j > m)
+ SCF_XCHG(j, m);
+
+ el1 = f->elines[j];
+ ++j;
+ } else if (j > f->n_elines / 2) {
+ el1 = f->elines[j];
+ ++j;
+ } else {
+ el1 = f->elines[j];
+ }
- for (n = f->n_elines - 1; n > j; n--)
- f->elines[n] = f->elines[n - 1];
+ for (n = f->n_elines - 1; n > j; n--)
+ f->elines[n] = f->elines[n - 1];
- f->elines[j] = el0;
+ f->elines[j] = el0;
- if (j == i)
- continue;
+ if (j == i)
+ continue;
+
+ k1++;
- scf_loge("mov el%ld [%ld] --> [%ld] el%ld\n", el0->id, i, j, el1->id);
+ scf_loge("mov el%ld [%ld] --> [%ld] el%ld\n", el0->id, i, j, el1->id);
+ }
+ printf("\n");
+
+ if (k0 <= k1)
+ break;
+
+ k0 = k1;
}
#endif
el0->n_lines = 0;
- scf_logw("el0: %ld, n_conns: %ld, n_pins: %ld, flags: %#lx\n", el0->id, el0->n_conns, el0->n_pins, el0->flags);
+ scf_logd("el0: %ld, n_conns: %ld, n_pins: %ld, flags: %#lx\n", el0->id, el0->n_conns, el0->n_pins, el0->flags);
for (j = 0; j < el0->n_conns; j++) {
ec = el0->conns[j];
- scf_logi("j: %ld, lid: %ld, n_cids: %ld, cid[0]: %ld\n", j, ec->lid, ec->n_cids, ec->cids[0]);
+ scf_logd("j: %ld, lid: %ld, n_cids: %ld, cid[0]: %ld\n", j, ec->lid, ec->n_cids, ec->cids[0]);
}
- printf("\n");
}
#endif
p1->x = c->x;
else {
p1->x += c->x - tmp;
- p1->x = (c->x * 3 + p1->x) / 4;
+// p1->x = (c->x * 3 + p1->x) / 4;
}
if (tx0 > p1->x)