Commit 7dcb5cff authored by yoogx's avatar yoogx

* If the Execution_Platform is given in deployment.aadl, but

          unknown by Ocarina, simply assume it is user-defined and let
          PolyORB-HI/C Makefile.common makefile include
          Makefile.<platform_name>
parent 36aeb6dc
...@@ -318,6 +318,7 @@ package body Ocarina.Backends.Build_Utils is ...@@ -318,6 +318,7 @@ package body Ocarina.Backends.Build_Utils is
-- The node name (in lower case) -- The node name (in lower case)
Execution_Platform : Supported_Execution_Platform := Platform_None; Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id := No_Name;
-- The execution platform of the processor the current node -- The execution platform of the processor the current node
-- is bound to. -- is bound to.
...@@ -962,6 +963,8 @@ package body Ocarina.Backends.Build_Utils is ...@@ -962,6 +963,8 @@ package body Ocarina.Backends.Build_Utils is
M.Execution_Platform := Get_Execution_Platform M.Execution_Platform := Get_Execution_Platform
(Get_Bound_Processor (E)); (Get_Bound_Processor (E));
M.Execution_Platform_Name := Get_Execution_Platform
(Get_Bound_Processor (E));
-- Get the transport API used by this node. It is -- Get the transport API used by this node. It is
-- important to ensure that the Namings package visitors -- important to ensure that the Namings package visitors
...@@ -1511,8 +1514,14 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1511,8 +1514,14 @@ package body Ocarina.Backends.Build_Utils is
Write_Name (M.Node_Name); Write_Name (M.Node_Name);
Write_Eol; Write_Eol;
Write_Line ("# Execution platform : " Write_Str ("# Execution platform : ");
& M.Execution_Platform'Img); Write_Name (M.Execution_Platform_Name);
if M.Execution_Platform = Platform_None then
Write_Eol;
Write_Str ("# Note: user defined");
end if;
Write_Eol;
Write_Line ("# Transport API : " Write_Line ("# Transport API : "
& M.Transport_API'Img); & M.Transport_API'Img);
...@@ -1550,6 +1559,7 @@ package body Ocarina.Backends.Build_Utils is ...@@ -1550,6 +1559,7 @@ package body Ocarina.Backends.Build_Utils is
(M.Appli_Name, (M.Appli_Name,
M.Node_Name, M.Node_Name,
M.Execution_Platform, M.Execution_Platform,
M.Execution_Platform_Name,
M.Transport_API, M.Transport_API,
M.Ada_Sources, M.Ada_Sources,
M.Asn_Sources, M.Asn_Sources,
......
...@@ -90,6 +90,7 @@ package body Ocarina.Backends.PO_HI_Ada is ...@@ -90,6 +90,7 @@ package body Ocarina.Backends.PO_HI_Ada is
(Appli_Name : Name_Id; (Appli_Name : Name_Id;
Node_Name : Name_Id; Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None; Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs; Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance; Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance; Asn_Sources : Name_Tables.Instance;
...@@ -137,6 +138,7 @@ package body Ocarina.Backends.PO_HI_Ada is ...@@ -137,6 +138,7 @@ package body Ocarina.Backends.PO_HI_Ada is
(Appli_Name : Name_Id; (Appli_Name : Name_Id;
Node_Name : Name_Id; Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None; Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs; Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance; Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance; Asn_Sources : Name_Tables.Instance;
...@@ -152,6 +154,7 @@ package body Ocarina.Backends.PO_HI_Ada is ...@@ -152,6 +154,7 @@ package body Ocarina.Backends.PO_HI_Ada is
is is
pragma Unreferenced (Appli_Name, pragma Unreferenced (Appli_Name,
Transport_API, Transport_API,
Execution_Platform_Name,
Ada_Sources, Ada_Sources,
C_Libraries, C_Libraries,
User_Source_Dirs, User_Source_Dirs,
......
...@@ -131,12 +131,12 @@ package body Ocarina.Backends.PO_HI_C.Naming is ...@@ -131,12 +131,12 @@ package body Ocarina.Backends.PO_HI_C.Naming is
U : Node_Id; U : Node_Id;
Root_Sys : constant Node_Id Root_Sys : constant Node_Id
:= Parent_Component (Parent_Subcomponent (E)); := Parent_Component (Parent_Subcomponent (E));
Platform : constant Supported_Execution_Platform Platform_Name : constant Name_Id
:= Get_Execution_Platform (Get_Bound_Processor (E)); := Get_Execution_Platform (Get_Bound_Processor (E));
begin begin
pragma Assert (AAU.Is_System (Root_Sys)); pragma Assert (AAU.Is_System (Root_Sys));
if Platform = Platform_None then if Platform_Name = No_Name then
Display_Located_Error Display_Located_Error
(Loc (Parent_Subcomponent (E)), (Loc (Parent_Subcomponent (E)),
"This process subcomponent is bound to a processor without" "This process subcomponent is bound to a processor without"
......
...@@ -117,6 +117,7 @@ package body Ocarina.Backends.PO_HI_C is ...@@ -117,6 +117,7 @@ package body Ocarina.Backends.PO_HI_C is
(Appli_Name : Name_Id; (Appli_Name : Name_Id;
Node_Name : Name_Id; Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None; Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs; Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance; Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance; Asn_Sources : Name_Tables.Instance;
...@@ -138,6 +139,7 @@ package body Ocarina.Backends.PO_HI_C is ...@@ -138,6 +139,7 @@ package body Ocarina.Backends.PO_HI_C is
(Appli_Name : Name_Id; (Appli_Name : Name_Id;
Node_Name : Name_Id; Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None; Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs; Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance; Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance; Asn_Sources : Name_Tables.Instance;
...@@ -194,9 +196,16 @@ package body Ocarina.Backends.PO_HI_C is ...@@ -194,9 +196,16 @@ package body Ocarina.Backends.PO_HI_C is
Write_Str ("TARGET = "); Write_Str ("TARGET = ");
case Execution_Platform is case Execution_Platform is
when Platform_Native | Platform_None => when Platform_Native =>
Write_Str ("native"); Write_Str ("native");
when Platform_None =>
if Execution_Platform_Name /= No_Name then
Write_Name (Execution_Platform_Name);
else
Write_Str ("native");
end if;
when Platform_Native_Compcert => when Platform_Native_Compcert =>
Write_Str ("compcert"); Write_Str ("compcert");
......
...@@ -2688,6 +2688,18 @@ package body Ocarina.Backends.Properties is ...@@ -2688,6 +2688,18 @@ package body Ocarina.Backends.Properties is
-- Get_Execution_Platform -- -- Get_Execution_Platform --
---------------------------- ----------------------------
function Get_Execution_Platform (P : Node_Id) return Name_Id is
pragma Assert (AINU.Is_Processor (P)
or else AINU.Is_Virtual_Processor (P));
begin
if Is_Defined_Enumeration_Property (P, Execution_Platform) then
return Get_Enumeration_Property (P, Execution_Platform);
else
return No_Name;
end if;
end Get_Execution_Platform;
function Get_Execution_Platform function Get_Execution_Platform
(P : Node_Id) (P : Node_Id)
return Supported_Execution_Platform return Supported_Execution_Platform
...@@ -2755,8 +2767,6 @@ package body Ocarina.Backends.Properties is ...@@ -2755,8 +2767,6 @@ package body Ocarina.Backends.Properties is
elsif P_Name = Platform_VxWorks_Name then elsif P_Name = Platform_VxWorks_Name then
return Platform_VxWorks; return Platform_VxWorks;
else else
Display_Located_Error
(AIN.Loc (P), "Unknown execution platform", Fatal => True);
return Platform_None; return Platform_None;
end if; end if;
else else
......
...@@ -950,10 +950,14 @@ package body Ocarina.Backends.Utils is ...@@ -950,10 +950,14 @@ package body Ocarina.Backends.Utils is
return Get_Container_Process (Parent_Component (E)); return Get_Container_Process (Parent_Component (E));
when others => when others =>
if Is_Thread (E) or else Is_Subprogram (E) then if Is_Thread (E) or else Is_Subprogram (E)
or else AAU.Is_Data (E)
then
return Get_Container_Process (Parent_Subcomponent (E)); return Get_Container_Process (Parent_Subcomponent (E));
elsif Is_Process (E) or else Is_Device (E) then elsif Is_Process (E) or else Is_Device (E) then
return Parent_Subcomponent (E); return Parent_Subcomponent (E);
else else
raise Program_Error with "Wrong node kind in " raise Program_Error with "Wrong node kind in "
& "Get_Container_Process: " & Kind (E)'Img & "Get_Container_Process: " & Kind (E)'Img
......
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