Commit baf7e1e2 authored by yoogx's avatar yoogx

Merge branch 'master' of https://github.com/yoogx/ocarina

parents 8aca3c86 fce7adb0
......@@ -49,7 +49,8 @@ property set Deployment is
X86_LINUXTASTE, -- TASTE-specific linux distribution
MARTE_OS, -- MaRTE OS
WIN32, -- WIN32
VXWORKS -- VXWORKS
VXWORKS, -- VXWORKS
FREERTOS -- FREERTOS
);
-- Supported platforms
......
......@@ -318,6 +318,7 @@ package body Ocarina.Backends.Build_Utils is
-- The node name (in lower case)
Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id := No_Name;
-- The execution platform of the processor the current node
-- is bound to.
......@@ -962,6 +963,8 @@ package body Ocarina.Backends.Build_Utils is
M.Execution_Platform := Get_Execution_Platform
(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
-- important to ensure that the Namings package visitors
......@@ -1511,8 +1514,14 @@ package body Ocarina.Backends.Build_Utils is
Write_Name (M.Node_Name);
Write_Eol;
Write_Line ("# Execution platform : "
& M.Execution_Platform'Img);
Write_Str ("# Execution platform : ");
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 : "
& M.Transport_API'Img);
......@@ -1550,6 +1559,7 @@ package body Ocarina.Backends.Build_Utils is
(M.Appli_Name,
M.Node_Name,
M.Execution_Platform,
M.Execution_Platform_Name,
M.Transport_API,
M.Ada_Sources,
M.Asn_Sources,
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2012 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2013 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
......@@ -71,6 +71,7 @@ package Ocarina.Backends.Build_Utils is
(Appli_Name : Name_Id;
Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance;
......
......@@ -90,6 +90,7 @@ package body Ocarina.Backends.PO_HI_Ada is
(Appli_Name : Name_Id;
Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance;
......@@ -137,6 +138,7 @@ package body Ocarina.Backends.PO_HI_Ada is
(Appli_Name : Name_Id;
Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance;
......@@ -152,6 +154,7 @@ package body Ocarina.Backends.PO_HI_Ada is
is
pragma Unreferenced (Appli_Name,
Transport_API,
Execution_Platform_Name,
Ada_Sources,
C_Libraries,
User_Source_Dirs,
......
......@@ -131,12 +131,12 @@ package body Ocarina.Backends.PO_HI_C.Naming is
U : Node_Id;
Root_Sys : constant Node_Id
:= Parent_Component (Parent_Subcomponent (E));
Platform : constant Supported_Execution_Platform
Platform_Name : constant Name_Id
:= Get_Execution_Platform (Get_Bound_Processor (E));
begin
pragma Assert (AAU.Is_System (Root_Sys));
if Platform = Platform_None then
if Platform_Name = No_Name then
Display_Located_Error
(Loc (Parent_Subcomponent (E)),
"This process subcomponent is bound to a processor without"
......
......@@ -117,6 +117,7 @@ package body Ocarina.Backends.PO_HI_C is
(Appli_Name : Name_Id;
Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance;
......@@ -138,6 +139,7 @@ package body Ocarina.Backends.PO_HI_C is
(Appli_Name : Name_Id;
Node_Name : Name_Id;
Execution_Platform : Supported_Execution_Platform := Platform_None;
Execution_Platform_Name : Name_Id;
Transport_API : Supported_Transport_APIs;
Ada_Sources : Name_Tables.Instance;
Asn_Sources : Name_Tables.Instance;
......@@ -194,9 +196,16 @@ package body Ocarina.Backends.PO_HI_C is
Write_Str ("TARGET = ");
case Execution_Platform is
when Platform_Native | Platform_None =>
when Platform_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 =>
Write_Str ("compcert");
......
......@@ -2688,6 +2688,18 @@ package body Ocarina.Backends.Properties is
-- 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
(P : Node_Id)
return Supported_Execution_Platform
......@@ -2755,8 +2767,6 @@ package body Ocarina.Backends.Properties is
elsif P_Name = Platform_VxWorks_Name then
return Platform_VxWorks;
else
Display_Located_Error
(AIN.Loc (P), "Unknown execution platform", Fatal => True);
return Platform_None;
end if;
else
......
......@@ -609,6 +609,7 @@ package Ocarina.Backends.Properties is
function Get_Execution_Platform
(P : Node_Id)
return Supported_Execution_Platform;
function Get_Execution_Platform (P : Node_Id) return Name_Id;
-- Return the execution platform of the given processor P
function Get_Location (P : Node_Id) return Name_Id;
......
......@@ -950,10 +950,14 @@ package body Ocarina.Backends.Utils is
return Get_Container_Process (Parent_Component (E));
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));
elsif Is_Process (E) or else Is_Device (E) then
return Parent_Subcomponent (E);
else
raise Program_Error with "Wrong node kind in "
& "Get_Container_Process: " & Kind (E)'Img
......
......@@ -263,6 +263,7 @@ package body Ocarina.Analyzer.AADL.Semantics is
or else Kind (Container) = K_Feature_Group_Type
then
Pack_Container := Namespace (Container);
elsif Kind (Container) = K_Subcomponent
or else Kind (Container) = K_Port_Spec
or else Kind (Container) = K_Parameter
......@@ -271,6 +272,7 @@ package body Ocarina.Analyzer.AADL.Semantics is
or else Kind (Container) = K_Connection
then
Pack_Container := Namespace (Container_Component (Container));
elsif Kind (Container) = K_Package_Specification then
Pack_Container := Container;
end if;
......
......@@ -33,7 +33,7 @@ property set Deployment is
Protocol : Deployment::Protocol_Type
applies to (system);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS, FREERTOS);
Execution_Platform : Deployment::Allowed_Execution_Platform
applies to ( all);
......
......@@ -33,7 +33,7 @@ property set Deployment is
Protocol : Deployment::Protocol_Type
applies to (system);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS, FREERTOS);
Execution_Platform : Deployment::Allowed_Execution_Platform
applies to ( all);
......
......@@ -33,7 +33,7 @@ property set Deployment is
Protocol : Deployment::Protocol_Type
applies to (system);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS, FREERTOS);
Execution_Platform : Deployment::Allowed_Execution_Platform
applies to ( all);
......
......@@ -33,7 +33,7 @@ property set Deployment is
Protocol : Deployment::Protocol_Type
applies to (system);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS, FREERTOS);
Execution_Platform : Deployment::Allowed_Execution_Platform
applies to ( all);
......
......@@ -33,7 +33,7 @@ property set Deployment is
Protocol : Deployment::Protocol_Type
applies to (system);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS);
Allowed_Execution_Platform : type enumeration (Native, Native_Compcert, bench, LEON_RTEMS, LEON_RTEMS_POSIX, LEON3_SCOC3, LEON3_XTRATUM, LEON3_XM3, LEON_ORK, LEON_GNAT, LINUX32, LINUX32_XENOMAI_NATIVE, LINUX32_XENOMAI_POSIX, LINUX64, ERC32_ORK, ARM_DSLINUX, ARM_N770, GUMSTIX_RTEMS, NDS_RTEMS, X86_RTEMS, X86_RTEMS_POSIX, X86_LINUXTASTE, MARTE_OS, WIN32, VXWORKS, FREERTOS);
Execution_Platform : Deployment::Allowed_Execution_Platform
applies to ( all);
......
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