Commit 289fe2d1 authored by Maxime Perrotin's avatar Maxime Perrotin

Optimize timers in the vertical transformation

Add a filter mechanism that allows to specify which PI actually calls
with RIs. This can save hundreds of AADL ports in large systems.
Applied to timer only but to be extended when information linking PIs to
RIs is available.
parent 4dedd636
Pipeline #365 skipped
......@@ -114,6 +114,10 @@ int Compare_Interface (Interface *one, Interface *two)
return (!strcmp (name1, name2));
}
int Compare_FV (FV *one, FV *two)
{
return (!strcmp(one->name, two->name));
}
int Compare_Protected_Object_Name (Protected_Object_Name *one, Protected_Object_Name *two)
{
......@@ -689,6 +693,7 @@ void Create_Interface(Interface ** i)
(*i)->distant_qgen = distant_qgen;
(*i)->calling_threads = NULL;
(*i)->distant_name = NULL;
(*i)->calling_pis = NULL;
}
// this function clears up an Interface data structure
......@@ -735,16 +740,15 @@ void Clear_Interface(Interface * i)
i->distant_qgen = NULL;
}
if (NULL != i->calling_threads) {
//Clear_FV_List_Keep_Elem(i->calling_threads);
i->calling_threads = NULL;
}
if (NULL != i->distant_name) {
free(i->name);
i->name = NULL;
}
/* Don' t try to free the lists here */
i->calling_threads = NULL;
i->calling_pis = NULL;
}
......
This diff is collapsed.
......@@ -177,25 +177,26 @@ typedef struct T_name_list
Type used to describe an interface (provided or required)
*/
typedef struct t_interface {
char *name;
Port *port_name;
struct t_fv *parent_fv;
IF_type direction;
Parameter_list *in;
Parameter_list *out;
IF_kind synchronism;
RCM rcm;
long long period;
uint64_t wcet_low;
char *wcet_low_unit;
uint64_t wcet_high;
char *wcet_high_unit;
char *distant_fv;
struct t_qgen *distant_qgen;
struct t_FV_list *calling_threads;
char *distant_name;
unsigned long long queue_size;
bool ignore_params;
char *name;
Port *port_name;
struct t_fv *parent_fv;
IF_type direction;
Parameter_list *in;
Parameter_list *out;
IF_kind synchronism;
RCM rcm;
long long period;
uint64_t wcet_low;
char *wcet_low_unit;
uint64_t wcet_high;
char *wcet_high_unit;
char *distant_fv;
struct t_qgen *distant_qgen;
struct t_FV_list *calling_threads;
char *distant_name;
unsigned long long queue_size;
bool ignore_params;
struct t_Interface_list *calling_pis; // only set in RIs of passive functions
} Interface;
DECLARE_LIST (Interface)
......
......@@ -230,6 +230,7 @@ extern void add_error();
int Compare_Package(Package *one, Package *two);
int Compare_Protected_Object_Name(Protected_Object_Name *one, Protected_Object_Name *two);
int Compare_Interface (Interface *one, Interface *two);
int Compare_FV (FV *one, FV *two);
int Compare_String (String *one, String *two);
int Compare_ASN1_Filename(ASN1_Filename *one, ASN1_Filename *two);
int Compare_ASN1_Module (ASN1_Module *one, ASN1_Module *two);
......@@ -243,13 +244,13 @@ void Print_FV (FV *fv);
Example of use:
with "MyType_list *l;" and l containing elements
FOREACH(tmp, MyType,l, {
printf("%s",tmp);
printf(" ");
}
)
*/
#define FOREACH(var,type,list,stmt) {type##_list *varlist##var##type=list; type *var;while(varlist##var##type!=NULL) { var=varlist##var##type->value; stmt varlist##var##type=varlist##var##type->next; }}
......@@ -289,6 +290,16 @@ if(Compare_##type(val,elem)) result = 1; \
if (!result) APPEND_TO_LIST(type, list, val);\
}
/* return true if value of type sort is in set */
#define IN_SET(sort, set, val) \
__extension__({\
bool result = false; \
FOREACH(elem, sort, set, {\
if(Compare_##sort(val,elem)) result = true; \
});\
result;\
})
#define FREE_LIST(type, list) \
{\
type##_list *next=NULL;\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment