el->c_pins = el->n_pins;
el->id = i;
- scf_logd("line i: %ld, %p, el->flags: %#lx\n", i, el, el->flags);
+ scf_loge("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_logd("pin j: %ld, c%ldp%ld\n", j, el->pins[j], el->pins[j + 1]);
+ scf_logi("pin j: %ld, c%ldp%ld\n", j, el->pins[j], el->pins[j + 1]);
}
-// printf("\n");
+ printf("\n");
i++;
}
return 0;
}
+static inline int __ses_find_eline_index(ScfEfunction* f, uint64_t lid)
+{
+ ScfEline* el;
+ size_t j;
+
+ for (j = 0; j < f->n_elines; j++) {
+ el = f->elines[j];
+
+ if (el->id == lid)
+ break;
+ }
+ assert(j < f->n_elines);
+
+ return j;
+}
+
int ses_lines_same_components(ScfEfunction* f)
{
ScfEline* tmp;
ScfEline* el0;
ScfEline* el1;
+ ScfEline* el2;
ScfEconn* ec;
size_t i;
if (f->n_elines <= 2)
return 0;
- size_t k;
size_t m;
size_t n;
for (i = 0; i < el0->n_conns && i < 2; i++) {
ec = el0->conns[i];
- for (j = 0; j < f->n_elines; j++) {
- el1 = f->elines[j];
-
- if (el1->id == ec->lid)
- break;
- }
- assert(j < f->n_elines);
+ j = __ses_find_eline_index(f, ec->lid);
+ el1 = f->elines[j];
n = m + (i << 1) - 1;
for (i = 0; i < el0->n_conns; i++) {
ec = el0->conns[i];
- for (j = 0; j < f->n_elines; j++) {
- el1 = f->elines[j];
-
- if (el1->id == ec->lid)
- break;
- }
- assert(j < f->n_elines);
+ j = __ses_find_eline_index(f, ec->lid);
+ el1 = f->elines[j];
if (0 == el1->n_lines)
break;
for (i = 0; i < el0->n_conns; i++) {
ec = el0->conns[i];
- for (j = 0; j < f->n_elines; j++) {
- el1 = f->elines[j];
-
- if (el1->id == ec->lid)
- break;
- }
- assert(j < f->n_elines);
+ j = __ses_find_eline_index(f, ec->lid);
+ el1 = f->elines[j];
if (0 == el1->n_lines)
break;
el0->n_lines = 0;
- scf_logd("el0: %ld, n_conns: %ld, n_pins: %ld, flags: %#lx\n", el0->id, el0->n_conns, el0->n_pins, el0->flags);
+ scf_logw("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_logd("j: %ld, lid: %ld, n_cids: %ld, cid[0]: %ld\n", j, ec->lid, ec->n_cids, ec->cids[0]);
+ scf_logi("j: %ld, lid: %ld, n_cids: %ld, cid[0]: %ld\n", j, ec->lid, ec->n_cids, ec->cids[0]);
}
+ printf("\n");
}
#endif
return ret;
}
- ses_steps_analyse(f, 5, 1);
+// ses_steps_analyse(f, 5, 1);
x = f->x;
y = f->y;