Commit bdb2af0a authored by julien.delange's avatar julien.delange
Browse files

* ocarina/src/backends/ocarina-backends-c_common-types.adb

   - Generate ALL types that are used in the system, prevent
     any compilation issues with the request_t type

 * ocarina/src/backends/ocarina-backends-po_hi_c-request.adb
   - Generate ALL requests that may happen within the system.
     Ensure that the definition of __po_hi_request_t is the same
     on all nodes and so that the __PO_HI_MESSAGES_SIZE will have
     the same value on all nodes.



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1523 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 6d597682
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2010, GET-Telecom Paris. --
-- Copyright (C) 2008-2010, European Space Agency (ESA). --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -789,6 +789,7 @@ package body Ocarina.Backends.C_Common.Types is
Declaration : Node_Id;
The_System : constant Node_Id := Parent_Component
(Parent_Subcomponent (E));
Remote_Process : Node_Id;
begin
if Real_Process then
U := CTN.Distributed_Application_Unit
......@@ -888,6 +889,21 @@ package body Ocarina.Backends.C_Common.Types is
D := First_Node (Destinations (C));
I := Item (D);
if Get_Category_Of_Component
(Parent_Component (I)) = CC_Process then
Remote_Process := Parent_Component (I);
if not AINU.Is_Empty (Subcomponents (Remote_Process)) then
S := First_Node (Subcomponents (Remote_Process));
while Present (S) loop
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end if;
if Present (I) and then
Kind (I) = K_Port_Spec_Instance and then
not AINU.Is_Empty (Destinations (I)) then
......@@ -906,6 +922,48 @@ package body Ocarina.Backends.C_Common.Types is
C := Next_Node (C);
end loop;
C := First_Node (Features (E));
while Present (C) loop
if Kind (C) = K_Port_Spec_Instance and then
not AINU.Is_Empty (Sources (C)) then
D := First_Node (Sources (C));
I := Item (D);
if Get_Category_Of_Component
(Parent_Component (I)) = CC_Process then
Remote_Process := Parent_Component (I);
if not AINU.Is_Empty (Subcomponents (Remote_Process)) then
S := First_Node (Subcomponents (Remote_Process));
while Present (S) loop
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end if;
if Present (I) and then
Kind (I) = K_Port_Spec_Instance and then
not AINU.Is_Empty (Sources (I)) then
F := First_Node (Sources (I));
while Present (F) loop
J := Item (F);
if Present (J) then
Visit (Parent_Component (J));
end if;
F := Next_Node (F);
end loop;
end if;
D := Next_Node (D);
end if;
C := Next_Node (C);
end loop;
end if;
-- Unmark all the marked types
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009, GET-Telecom Paris. --
-- Copyright (C) 2008-2010, European Space Agency (ESA). --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -156,12 +156,9 @@ package body Ocarina.Backends.PO_HI_C.Request is
Push_Entity (U);
Set_Request_Header;
Start_Recording_Handlings;
-- Create the global lists
Request_Struct := New_List (CTN.K_Enumeration_Literals);
Request_Union_List := New_List (CTN.K_Enumeration_Literals);
Operation_Identifier := 0;
Request_Declared := False;
......@@ -290,8 +287,6 @@ package body Ocarina.Backends.PO_HI_C.Request is
(Identifier (E), N);
end if;
Reset_Handlings;
Pop_Entity; -- U
Pop_Entity; -- P
end Visit_Process_Instance;
......@@ -305,6 +300,10 @@ package body Ocarina.Backends.PO_HI_C.Request is
begin
Push_Entity (C_Root);
Start_Recording_Handlings;
Request_Union_List := New_List (CTN.K_Enumeration_Literals);
Ports_Names_Array := Make_Array_Values;
-- Visit all the subcomponents of the system
......@@ -319,6 +318,8 @@ package body Ocarina.Backends.PO_HI_C.Request is
end loop;
end if;
Reset_Handlings;
Pop_Entity; -- C_Root
end Visit_System_Instance;
......@@ -334,6 +335,8 @@ package body Ocarina.Backends.PO_HI_C.Request is
begin
if Has_Ports (E) then
F := First_Node (Features (E));
Request_Declared := True;
Add_Include (RH (RH_Types));
while Present (F) loop
if Kind (F) = K_Port_Spec_Instance
and then No (Get_Handling (F, By_Node, H_C_Request_Spec))
......
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