...
 
Commits (3)
......@@ -220,11 +220,11 @@ package body Buildsupport_Utils is
function Get_Instance_Of (Device : Node_Id) return Name_Id is
Instance_Of : Name_id := No_Name;
begin
if Is_Defined_Property (Device, "taste_iv_properties::instance_of")
if Is_Defined_Property (Device, "taste_iv_properties::is_instance_of")
then
Instance_Of := Get_String_Property
(Device, Get_String_Name
("taste_iv_properties::instance_of"));
("taste_iv_properties::is_instance_of"));
end if;
return Instance_Of;
end Get_Instance_Of;
......
......@@ -791,7 +791,6 @@ void Generate_Ada_CallingStack(FV * fv)
(void) ct;
count ++;
})
printf("FV: %s has %d calling threads\n", fv->name, count);
if (2 > count)
return;
......@@ -896,7 +895,7 @@ void GLUE_Ada_Wrappers_Backend(FV * fv)
});
FOREACH (pi, Interface, fv->interfaces, {
if (synch == pi->synchronism) {
count_sync_pi ++;
count_sync_pi ++;
}
});
if (1 < count_ct && 0 < count_sync_pi) {
......
......@@ -121,7 +121,7 @@ void C_End()
);
}
if (get_context()->gw && (false == fv->is_component_type) &&
if (get_context()->gw && // (false == fv->is_component_type) &&
(NULL == fv->zipfile || get_context()->glue)) {
GW_SDL_Backend(fv);
GW_Simulink_Backend(fv);
......
......@@ -258,7 +258,8 @@ void GW_SDL_Interface(Interface * i)
void GW_SDL_Backend(FV * fv)
{
if (fv->system_ast->context->onlycv) return;
if ((sdl == fv->language || opengeode == fv->language) && (false == fv->is_component_type)) {
if ((sdl == fv->language || opengeode == fv->language)) {
Create_New_SDL_Structure(fv);
FOREACH(i, Interface, fv->interfaces, {
GW_SDL_Interface(i);
......
......@@ -107,10 +107,6 @@ bool MultiInstance_SDL_Interface_Check(Interface * i, Interface * j)
int out_param_cnt_i = 0;
int out_param_cnt_j = 0;
if (!Compare_Interface (i, j)) {
result=false;
}
if (i->direction != j->direction) {
result=false;
}
......@@ -319,68 +315,70 @@ void Function_Semantic_Check(FV * fv)
Interface_Semantic_Check(i);
}
);
/*
/*
* SDL specific checks: is_component_type can only be true for SDL functions.
* instance_of can only point to functions with is_component_type set to true.
*/
if (fv->is_component_type) {
if (sdl != fv->language) {
ERROR
("** Error: Is_Component_Type is True for \"%s\". This is allowed only for SDL functions.\n",
("[ERROR] Is_Component_Type is True for \"%s\". This is allowed only for SDL functions.\n",
fv->name);
add_error();
}
}
if (NULL != fv->instance_of) {
FV *definition = FindFV (fv->instance_of);
FV *definition = FindFV (string_to_lower(fv->instance_of));
if (definition == NULL) {
ERROR
("** Error: Defining function \"%s\" for \"%s\" not found.\n",
("[ERROR] Component type \"%s\" (for instance \"%s\") not found.\n",
fv->instance_of, fv->name);
add_error();
return;
}
if (false == definition->is_component_type) {
ERROR
("** Error: Is_Component_Type is False for \"%s\". It should be True,\n",
definition->name);
ERROR
(" because function \"%s\" claims that it is an instance of \"%s\".\n",
fv->name, definition->name);
add_error();
}
int fv_intf_cnt = 0;
int definition_intf_cnt = 0;
FOREACH(i, Interface, fv->interfaces, {
Interface *def_i = FindInterface (definition, i->name);
if (def_i == NULL) {
ERROR
("** Error: Interface \"%s\" of instance \"%s\" not found from definition \"%s\".\n",
i->name, fv->name, definition->name);
add_error();
} else {
if (!MultiInstance_SDL_Interface_Check (i, def_i)) {
else {
if (false == definition->is_component_type) {
ERROR
("[ERROR] Is_Component_Type is False for \"%s\". It should be True,\n",
definition->name);
ERROR
(" because function \"%s\" claims that it is an instance of \"%s\".\n",
fv->name, definition->name);
add_error();
}
int fv_intf_cnt = 0;
int definition_intf_cnt = 0;
FOREACH(i, Interface, fv->interfaces, {
Interface *def_i = FindInterface (definition, i->name);
if (def_i == NULL) {
ERROR
("** Error: Interface \"%s\" of instance \"%s\" not matching with definition \"%s\".\n",
("[ERROR] Interface \"%s\" of instance \"%s\" not found from definition \"%s\".\n",
i->name, fv->name, definition->name);
add_error();
} else {
if (!MultiInstance_SDL_Interface_Check (i, def_i)) {
ERROR
("[ERROR] Interface \"%s\" of instance \"%s\" not matching with definition \"%s\".\n",
i->name, fv->name, definition->name);
add_error();
}
}
}
fv_intf_cnt++;
});
FOREACH(i, Interface, definition->interfaces, {
UNUSED (i);
definition_intf_cnt++;
});
if (fv_intf_cnt != definition_intf_cnt) {
ERROR
("** Error: Interface count mismatch between definition \"%s\" and instance \"%s\".\n",
definition->name, fv->name);
add_error();
fv_intf_cnt++;
});
FOREACH(i, Interface, definition->interfaces, {
UNUSED (i);
definition_intf_cnt++;
});
if (fv_intf_cnt != definition_intf_cnt) {
ERROR
("[ERROR] Interface count mismatch between definition \"%s\" and instance \"%s\".\n",
definition->name, fv->name);
add_error();
}
}
}
}
......