Commit 0d2050cd authored by Maxime Perrotin's avatar Maxime Perrotin

Fix cornercase with unconnected functions

When a function had only unconnected sporadic PIs there was an issue in
the build because a thread was created but without any activation
condition or connected port - which was incorrect AADL semantics.
parent ae62b0e3
......@@ -2,7 +2,7 @@ buildsupport is a low-level TASTE command, responsible for the generation of ske
License: LGPL (see LICENSE file)
Copyright (c) 2008-2016 European Space Agency
Copyright (c) 2008-2017 European Space Agency
......@@ -751,13 +751,25 @@ void Preprocess_FV (FV *fv)
fv->runtime_nature = passive_runtime;
FOREACH (i, Interface, fv->interfaces, {
if (PI==i->direction) switch (i->rcm) {
if (PI==i->direction) {
switch (i->rcm) {
case cyclic:
fv->runtime_nature = thread_runtime;
break;
case sporadic:
case variator: fv->runtime_nature = thread_runtime; break;
case variator:
if (NULL != Find_All_Calling_FV(i)) {
fv->runtime_nature = thread_runtime;
}
else {
printf("unconnected interface %s %s\n", i->name, i->distant_name);
}
break;
default: break;
}
}
});
if(thread_runtime == fv->runtime_nature) {
/* Set the (unique) thread ID */
fv->thread_id = ++thread_id;
......@@ -927,7 +939,7 @@ void Add_api(Process *node, FV_list *all_fv)
/* Naming of ports/task id is different if there is more than 1 active PI */
int active = CountActivePI(function->interfaces);
FOREACH(pi, Interface, function->interfaces, {
if(PI == pi->direction && asynch == pi->synchronism && cyclic != pi->rcm) {
if(PI == pi->direction && asynch == pi->synchronism && cyclic != pi->rcm && NULL != Find_All_Calling_FV(pi)) {
if (1 == active) {
task_id = make_string("%s_%s_k", node->name, function->name);
port = make_string("%s_local_inport_%s", function->name, pi->name);
......
......@@ -335,6 +335,12 @@ void Add_IF_to_VT (Interface *i)
default:
break;
}
/* If it is a sporadic PI, check that it is actually connected,
* and otherwise do not generate any aadl FEATURE (port)
*/
if (sporadic == op_kind && NULL == Find_All_Calling_FV(i)) {
return;
}
}
......
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