static inline void eline_mov_before(ScfEfunction* f, intptr_t dst, intptr_t src)
{
+ if (dst == src)
+ return;
+
ScfEline* el = f->elines[src];
intptr_t i;
f->elines[i] = f->elines[i - 1];
f->elines[dst] = el;
+
+ scf_logd("f->elines[%ld]->id: %ld, f->elines[%ld]->id: %ld\n", src, f->elines[src]->id, dst, f->elines[dst]->id);
}
+int _topo_print(scf_vector_t* paths);
+
static int __ses_layout_lines4(ScfEfunction* f)
{
scf_vector_t* paths;
scf_vector_qsort(paths, epath_cmp_pins);
+ _topo_print(paths);
+
B = f->components[0];
Bp = B->pins[SCF_EDA_Battery_POS];
Bn = B->pins[SCF_EDA_Battery_NEG];
p = Bpath->pins->data[j - 1];
n = __ses_find_eline_index(f, p->lid);
SCF_XCHG(f->elines[n], f->elines[j / 2 + 1]);
+ scf_logd("j: %ld, l%ld\n", j / 2 + 1, f->elines[j / 2 + 1]->id);
for (i = 0; i < paths->size; i++) {
path = paths->data[i];
continue;
__n = __ses_find_eline_index(f, Bn->lid);
+ scf_logd("path: %d, __n: %ld, l%ld\n", path->index, __n, f->elines[__n]->id);
for (j = path->pins->size - 1; j > 0; j -= 2) {
p = path->pins->data[j];
if (p->lid == Bp->lid) {
__n = __ses_find_eline_index(f, Bp->lid);
+
+ scf_logw("__n: %ld, l%ld\n", __n, f->elines[__n]->id);
break;
}
}
n = __ses_find_eline_index(f, p->lid);
eline_mov_before(f, __n, n);
- __n = n;
}
}
n = __ses_find_eline_index(f, p->lid);
eline_mov_before(f, __n, n);
- __n = n;
}
+ printf("\n");
}
ret = 0;
SCF_XCHG(c0->x, c1->x);
- scf_logw("c%ld <--> c%ld, color: %ld, %ld, cx: %d, %d\n", c0->id, c1->id, c0->color, c1->color, c0->x, c1->x);
+ scf_logd("c%ld <--> c%ld, color: %ld, %ld, cx: %d, %d\n", c0->id, c1->id, c0->color, c1->color, c0->x, c1->x);
for (i = 0; i < c0->n_pins; i++) {
p = c0->pins[i];