Skip to content
Snippets Groups Projects
Commit 12118089 authored by Forget Julien's avatar Forget Julien
Browse files

Merge branch 'master' of gitlab.cristal.univ-lille.fr:otawa-plugins/cftreeextractor

parents 9486da73 12ddaf5d
Branches
No related tags found
No related merge requests found
......@@ -72,6 +72,16 @@ void compute_node(evalctx_t * ctx, formula_t * f)
awcet_ann(ctx, &f->children->aw, f);
#ifdef DEBUG
printf("compute_node: end processing ANN node\n");
#endif
break;
case KIND_INTMULT:
#ifdef DEBUG
printf("compute_node: start processing INTMULT node\n");
#endif
compute_node(ctx, &f->children[0]);
awcet_intmult(ctx, &f->children->aw, f);
#ifdef DEBUG
printf("compute_node: end processing ANN node\n");
#endif
break;
case KIND_AWCET:
......@@ -236,6 +246,15 @@ void awcet_loop(evalctx_t * ctx, awcet_t * source, formula_t * dest)
}
}
void awcet_intmult(evalctx_t * ctx, awcet_t * source, formula_t * dest)
{
int i;
(void)(ctx);
for (i = 0; i < source->eta_count; i++) {
dest->aw.eta[i] = source->eta[i] * dest->opdata.coef;
}
dest->aw.others = source->others * dest->opdata.coef;
}
void awcet_ann(evalctx_t * ctx, awcet_t * source, formula_t * dest)
{
......@@ -314,6 +333,10 @@ long long evaluate(formula_t *f, loopinfo_t *li, param_valuation_t pv, void *dat
void compute_eta_count(formula_t *f) {
switch(f->kind) {
case KIND_INTMULT:
compute_eta_count(f->children);
f->aw.eta_count = f->children[0].aw.eta_count;
break;
case KIND_ANN:
compute_eta_count(f->children);
f->aw.eta_count = f->opdata.ann.count;
......
......@@ -44,6 +44,7 @@ void awcet_alt(evalctx_t * ctx, int source_count, formula_t * source,
awcet_t * dest);
void awcet_loop(evalctx_t * ctx, awcet_t * source, formula_t * dest);
void awcet_ann(evalctx_t * ctx, awcet_t * source, formula_t * dest);
void awcet_intmult(evalctx_t * ctx, awcet_t * source, formula_t * dest);
void writeC(formula_t *f, FILE *out, int indent);
......
......@@ -54,6 +54,7 @@ union opdata_u {
int children_count; /* Number of children for Alt and Seq operators */
int loop_id; /* Loop bound for Loop operators */
annotation_t ann; /* Annotation for Ann operators */
int coef; /* Coefficient for Multiply by Integer */
};
typedef union opdata_u opdata_t;
......@@ -64,6 +65,7 @@ typedef union opdata_u opdata_t;
#define KIND_ANN 3
#define KIND_CONST 4
#define KIND_AWCET 5
#define KIND_INTMULT 6
#define IDENT_NONE 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment