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) {
case cyclic:
case sporadic:
case variator: fv->runtime_nature = thread_runtime; break;
default: break;
}
if (PI==i->direction) {
switch (i->rcm) {
case cyclic:
fv->runtime_nature = thread_runtime;
break;
case sporadic:
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);
......
......@@ -277,7 +277,7 @@ int Init_VT_Backend(FV *fv)
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n"
"-- This file contains a part of the system CONCURRENCY VIEW.\n"
"-- It is an input file for OCARINA.\n\n");
int hasparam=0;
fprintf(thread,
"package %s_CV_Thread\n"
......@@ -285,15 +285,15 @@ int Init_VT_Backend(FV *fv)
"\twith Deployment;\n"
"\twith process_package;\n",
fv->name);
FOREACH(i, Interface, fv->interfaces, {
CheckForAsn1Params(i, &hasparam);
})
if (hasparam){
fprintf(thread, "\twith Dataview;\n\n");
}
fv->runtime_nature = thread_runtime;
write_thread_preamble(fv);
free(path);
......@@ -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;
}
}
......@@ -345,7 +351,7 @@ void Add_IF_to_VT (Interface *i)
if (cyclic != i->rcm) {
/*
/*
* Add a "FEATURE" keyword (once) if
* the interface is sporadic or protected but NOT unprotected
* (protected appear in the concurrency view, not unpro).
......@@ -610,18 +616,18 @@ int Create_Nodes_file(Process_list *p)
}
build_string(&path, "ConcurrencyView", strlen("ConcurrencyView"));
/* create the nodes file in a directory called "ConcurrencyView" */
create_file(path, filename, &nodes);
assert (NULL != nodes);
/* Write file headers. */
fprintf(nodes,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n"
"-- This file contains the description of the system distribution.\n"
"-- It is an input file for the TASTE ORCHESTRATOR\n\n");
free(path);
return 0;
}
......
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