typedef struct ses_step_s ses_step_t;
typedef struct ses_path_s ses_path_t;
typedef struct ses_flow_s ses_flow_t;
-typedef struct ses_edge_s ses_edge_t;
typedef struct ses_info_s ses_info_t;
typedef struct ses_ctx_s ses_ctx_t;
-struct ses_edge_s
-{
- ScfEline* el0;
- ScfEline* el1;
-
- ScfEcomponent* c;
- ScfEpin* p0;
- ScfEpin* p1;
-};
-
struct ses_flow_s
{
scf_vector_t* paths;
int ses_layout_board (ScfEboard* b);
-int ses_loop_function(ScfEfunction* f, scf_vector_t* loops);
int ses_steps_analyse(ScfEfunction* f, int64_t ns, int64_t count);
void __ses_path_split_i(ScfEfunction* f, ses_path_t* path, int i, int j, double la, double jla, double* a, double* ja);
+++ /dev/null
-#include"ses_core.h"
-
-static int __ses_dfs_tree(ScfEfunction* f, ScfEline* root, scf_vector_t* edges, int64_t* total)
-{
- ScfEcomponent* c;
- ScfEline* el;
- ScfEpin* p0;
- ScfEpin* p1;
-
- ses_edge_t* e;
-
- size_t i;
- size_t j;
-
- root->vflag = 1;
-
- for (i = 0; i + 1 < root->n_pins; i += 2) {
-
- c = f->components[root->pins[i]];
- p0 = c->pins [root->pins[i + 1]];
-
- if (p0->vflag)
- continue;
- p0->vflag = 1;
-
- for (j = 0; j < c->n_pins; j++) {
- p1 = c->pins[j];
-
- if (p1->vflag)
- continue;
- p1->vflag = 1;
-
- el = f->elines[p1->lid];
-
- if (el->vflag)
- continue;
- el->vflag = 1;
-
- e = malloc(sizeof(ses_edge_t));
- if (!e)
- return -ENOMEM;
-
- e->c = c;
- e->p0 = p0;
- e->p1 = p1;
-
- e->el0 = root;
- e->el1 = el;
-
- scf_loge("l%ld --- c%ld_p%ld_p%ld --> l%ld\n", root->id, c->id, p0->id, p1->id, el->id);
-
- int ret = scf_vector_add(edges, e);
- if ( ret < 0)
- return ret;
-
- ret = __ses_dfs_tree(f, el, edges, total);
- if ( ret < 0)
- return ret;
- }
- }
-
- root->dfo = --*total;
-
- scf_logw("root->id: %ld, root->dfo: %ld\n", root->id, root->dfo);
- return 0;
-}
-
-int ses_loop_function(ScfEfunction* f, scf_vector_t* loops)
-{
- if (!f || !loops || f->n_elines < 2)
- return -EINVAL;
-
- ScfEcomponent* c;
- ScfEline* el;
- ScfEpin* p;
-
- scf_vector_t* edges = scf_vector_alloc();
- if (!edges)
- return -ENOMEM;
-
- size_t i;
- size_t j;
- size_t k;
-
- int64_t total = f->n_elines;
-
- for (i = 0; i < f->n_components; i++) {
- c = f->components[i];
- c->vflag = 0;
-
- for (j = 0; j < c->n_pins; j++) {
- p = c->pins[j];
- p->vflag = 0;
- }
- }
-
- for (i = 0; i < f->n_elines; i++) {
- el = f->elines[i];
- el->vflag = 0;
- }
-
- __ses_dfs_tree(f, f->elines[0], edges, &total);
- return 0;
-}