Commit 3afe0163 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Merge remote-tracking branch 'GITHUB-ocarina/master'

parents 070f524f 964a1a8e
......@@ -37,29 +37,4 @@ properties
Cheddar_Properties::Preemptive_Scheduler => true;
end stm32f4_discovery.gnat;
processor nds extends arm
end nds;
processor implementation nds.rtems
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255;
Cheddar_Properties::Scheduler_Quantum => 0 Ms;
Cheddar_Properties::Preemptive_Scheduler => true;
Deployment::Execution_Platform => NDS_RTEMS;
end nds.rtems;
processor gumstix extends arm
end gumstix;
processor implementation gumstix.rtems
properties
Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
Priority_Range => 0 .. 255;
Cheddar_Properties::Scheduler_Quantum => 0 Ms;
Cheddar_Properties::Preemptive_Scheduler => true;
Deployment::Execution_Platform => GUMSTIX_RTEMS;
end gumstix.rtems;
end ocarina_processors_arm;
......@@ -47,16 +47,6 @@ properties
Deployment::Execution_Platform => Native_Compcert;
end x86.native_compcert;
processor implementation x86.rtems
properties
Deployment::Execution_Platform => X86_RTEMS;
end x86.rtems;
processor implementation x86.rtems_posix
properties
Deployment::Execution_Platform => X86_RTEMS_POSIX;
end x86.rtems_posix;
processor implementation x86.xenomai_posix
properties
Deployment::Execution_Platform => linux32_xenomai_posix;
......
......@@ -23,30 +23,27 @@ property set Deployment is
Native_Compcert, -- Native platforms using the Compcert compiler
bench, -- Benchmark platform (native with instrumentation).
GNAT_Runtime, -- Use a GNAT Runtime, e.g. from the Ada_Drivers_Library
LEON_ORK,
LEON_RTEMS, -- LEON2 board or tsim-leon (RTEMS)
LEON_RTEMS_POSIX, -- LEON2 board or tsim-leon (RTEMS)
LEON3_SCOC3, -- LEON3 with RTEMS for SCOC3
LEON3_XTRATUM, -- LEON3 with Xtratum
LEON3_XM3, -- RTEMS for XTRATUM/LEON3
LEON_ORK, -- LEON2 board or tsim-leon (ORK)
LEON_GNAT, -- LEON2 board or qemu (GNATPRO/HI-E)
LINUX32, -- Linux 32 bits
LINUX32_DLL, -- Linux 32 bits/Dynamic Library
LINUX32_XENOMAI_NATIVE, -- Linux 32 bits with native Xenomai
LINUX32_XENOMAI_POSIX, -- Linux 32 bits with Xenomai and POSIX skin
LINUX64, -- Linux 64 bits
LINUX64_DLL, -- Linux 64 bits/Dynamic Library
ERC32_ORK, -- ERC32 board or tsim-erc32 (ORK)
ARM_CORTEX, -- ARM XXXX
ARM_DSLINUX, -- Nintendo DS (tm) (DSLinux)
ARM_N770, -- Nokia N770 (tm)
GUMSTIX_RTEMS, -- Gumstix under RTEMS
NDS_RTEMS, -- Nintendo DS under RTEMS
X86_RTEMS, -- x86 under RTEMS
X86_RTEMS_POSIX, -- x86 under RTEMS with POSIX layer
X86_LINUXTASTE, -- TASTE-specific linux distribution
MARTE_OS, -- MaRTE OS
WIN32, -- WIN32
VXWORKS, -- VXWORKS
FREERTOS -- FREERTOS
FREERTOS, -- FREERTOS
AIR -- AIR Hypervisor, by GMV
);
-- Supported platforms
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -41,7 +41,6 @@ package body Ocarina.BE_AADL.Components.Arrays is
use Ocarina.Output;
use Ocarina.ME_AADL.AADL_Tree.Nodes;
use Ocarina.ME_AADL.AADL_Tree.Nutils;
use Ocarina.BE_AADL.Components;
use Ocarina.BE_AADL.Identifiers;
use Ocarina.BE_AADL.Properties.Values;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -42,7 +42,6 @@ package body Ocarina.BE_AADL.Components.Features is
use Ocarina.ME_AADL.AADL_Tree.Nodes;
use Ocarina.BE_AADL.Properties;
use Ocarina.BE_AADL.Identifiers;
use Ocarina.BE_AADL.Components;
use Ocarina.BE_AADL.Components.Arrays;
-------------------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -38,7 +38,6 @@ package body Ocarina.BE_AADL.Components.Prototypes is
use Ocarina.Output;
use Ocarina.ME_AADL.AADL_Tree.Nodes;
use Ocarina.BE_AADL.Components;
use Ocarina.BE_AADL.Identifiers;
---------------------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -46,7 +46,6 @@ package body Ocarina.BE_AADL.Components.Subcomponents is
use Ocarina.ME_AADL.AADL_Tree.Nutils;
use Ocarina.ME_AADL.AADL_Tree.Nodes;
use Ocarina.BE_AADL.Properties;
use Ocarina.BE_AADL.Components;
use Ocarina.BE_AADL.Components.Modes;
use Ocarina.BE_AADL.Components.Prototypes;
use Ocarina.BE_AADL.Components.Arrays;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -51,7 +51,6 @@ package body Ocarina.BE_AADL.Properties.Values is
use Ocarina.ME_AADL;
use Ocarina.ME_AADL.AADL_Tree.Nodes;
use Ocarina.ME_AADL.AADL_Tree.Nutils;
use Ocarina.AADL_Values;
use Ocarina.ME_AADL.AADL_Tree.Entities.Properties;
use Ocarina.ME_AADL.AADL_Tree.Entities;
use Ocarina.BE_AADL.Identifiers;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -43,7 +43,7 @@ with Ocarina.BE_AADL_BA.Actions;
package body Ocarina.BE_AADL_BA.Expressions is
use Ocarina.Output;
use Ocarina.AADL_Values;
use Ocarina.ME_AADL_BA;
use Ocarina.ME_AADL_BA.BA_Tree.Nutils;
use Ocarina.ME_AADL_BA.BA_Tree.Nodes;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2015 ESA & ISAE. --
-- Copyright (C) 2011-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -39,7 +39,6 @@ with Ocarina.Backends.XML_Tree.Nutils;
package body Ocarina.Backends.AADL_XML.Mapping is
use Ocarina.ME_AADL;
use Ocarina.ME_AADL.AADL_Instances.Nodes;
use Ocarina.Backends.XML_Tree.Nodes;
......
......@@ -29,15 +29,22 @@
-- --
------------------------------------------------------------------------------
with Utils; use Utils;
with Ocarina.Namet; use Ocarina.Namet;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.Backends.Properties;
with Ocarina.Backends.Properties.ARINC653;
with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.XML_Values;
package body Ocarina.Backends.AIR_Conf.AIR_Configuration is
......@@ -45,10 +52,16 @@ package body Ocarina.Backends.AIR_Conf.AIR_Configuration is
use Ocarina.ME_AADL.AADL_Instances.Nodes;
use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.Properties;
use Ocarina.Backends.Properties.ARINC653;
use Ocarina.Backends.Utils;
use Ocarina.Backends.XML_Tree.Nutils;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
package XTN renames Ocarina.Backends.XML_Tree.Nodes;
package XTU renames Ocarina.Backends.XML_Tree.Nutils;
package XV renames Ocarina.Backends.XML_Values;
procedure Visit_Architecture_Instance (E : Node_Id);
procedure Visit_Component_Instance (E : Node_Id);
......@@ -102,6 +115,189 @@ package body Ocarina.Backends.AIR_Conf.AIR_Configuration is
end case;
end Visit_Component_Instance;
--------------------------
-- Map_Connection_Table --
--------------------------
procedure Map_Connection_Table (E : Node_Id)
with Pre => (Get_Category_Of_Component (E) = CC_System);
procedure Map_Connection_Table (E : Node_Id) is
Channel_Identifier : Unsigned_Long_Long := 0;
C : Node_Id;
P : Node_Id;
Q : Node_Id;
Source_Port_Name : Name_Id;
Destination_Port_Name : Name_Id;
Destination_Partition : Node_Id;
Source_Partition : Node_Id;
Connection_Table_Node : Node_Id;
Channel_Node : Node_Id;
Source_Node : Node_Id;
Destination_Node : Node_Id;
Standard_Partition_Node : Node_Id;
begin
if not AINU.Is_Empty (Connections (E)) then
Append_Node_To_List
(Make_XML_Comment (Get_String_Name ("Connection Table")),
XTN.Subitems (Current_XML_Node));
Connection_Table_Node := Make_XML_Node ("Connection_Table");
C := First_Node (Connections (E));
while Present (C) loop
if Kind (C) = K_Connection_Instance then
Source_Port_Name :=
AIN.Name
(AIN.Identifier
(AIN.Item
(AIN.Next_Node
(AIN.First_Node (AIN.Path (AIN.Source (C)))))));
Destination_Port_Name :=
AIN.Name
(AIN.Identifier
(AIN.Item
(AIN.Next_Node
(AIN.First_Node
(AIN.Path (AIN.Destination (C)))))));
Source_Partition :=
AIN.Corresponding_Instance
(AIN.Item (AIN.First_Node (AIN.Path (AIN.Source (C)))));
Destination_Partition :=
AIN.Corresponding_Instance
(AIN.Item
(AIN.First_Node (AIN.Path (AIN.Destination (C)))));
-- Channel node
Channel_Node := Make_XML_Node ("Channel");
Append_Node_To_List
(Channel_Node,
XTN.Subitems (Connection_Table_Node));
-- Channel identifier
Set_Str_To_Name_Buffer ("ChannelIdentifier");
P := Make_Defining_Identifier (Name_Find);
Set_Str_To_Name_Buffer ("");
Add_ULL_To_Name_Buffer (Channel_Identifier, 10);
Q := Make_Defining_Identifier (Remove_Char (Name_Find, ' '));
Append_Node_To_List (Make_Assignement (P, Q),
XTN.Items (Channel_Node));
Channel_Identifier := Channel_Identifier + 1;
-- Channel name
XTU.Add_Attribute ("ChannelName",
Get_Name_String
(To_Lower
(Display_Name
(Identifier (C)))), Channel_Node);
-- Mapping of the source
Source_Node := Make_XML_Node ("Source");
Append_Node_To_List (Source_Node, XTN.Subitems (Channel_Node));
Standard_Partition_Node := Make_XML_Node ("Standard_Partition");
Append_Node_To_List (Standard_Partition_Node,
XTN.Subitems (Source_Node));
Set_Str_To_Name_Buffer ("PartitionIdentifier");
P := Make_Defining_Identifier (Name_Find);
Q :=
Make_Literal
(XV.New_Numeric_Value
(Get_Partition_Identifier
(Get_Bound_Processor (Source_Partition)),
0,
10));
Append_Node_To_List
(Make_Assignement (P, Q),
XTN.Items (Standard_Partition_Node));
Set_Str_To_Name_Buffer ("PartitionName");
P := Make_Defining_Identifier (Name_Find);
Get_Name_String
(To_Lower
(Display_Name
(Identifier
(Parent_Subcomponent (Source_Partition)))));
Q := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q),
XTN.Items (Standard_Partition_Node));
Set_Str_To_Name_Buffer ("PortName");
P := Make_Defining_Identifier (Name_Find);
Get_Name_String (Source_Port_Name);
Q := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q),
XTN.Items (Standard_Partition_Node));
-- Mapping of the destination
Destination_Node := Make_XML_Node ("Destination");
Append_Node_To_List
(Destination_Node,
XTN.Subitems (Channel_Node));
Standard_Partition_Node := Make_XML_Node ("Standard_Partition");
Append_Node_To_List (Standard_Partition_Node,
XTN.Subitems (Destination_Node));
Set_Str_To_Name_Buffer ("PartitionIdentifier");
P := Make_Defining_Identifier (Name_Find);
Q :=
Make_Literal
(XV.New_Numeric_Value
(Get_Partition_Identifier
(Get_Bound_Processor
(Destination_Partition)),
0,
10));
Append_Node_To_List
(Make_Assignement (P, Q),
XTN.Items (Standard_Partition_Node));
Set_Str_To_Name_Buffer ("PartitionName");
P := Make_Defining_Identifier (Name_Find);
Get_Name_String
(To_Lower
(Display_Name
(Identifier
(Parent_Subcomponent (Destination_Partition)))));
Q := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q),
XTN.Items (Standard_Partition_Node));
Set_Str_To_Name_Buffer ("PortName");
P := Make_Defining_Identifier (Name_Find);
Get_Name_String (Destination_Port_Name);
Q := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q),
XTN.Items (Standard_Partition_Node));
end if;
C := Next_Node (C);
end loop;
Append_Node_To_List (Connection_Table_Node,
XTN.Subitems (Current_XML_Node));
end if;
end Map_Connection_Table;
---------------------------
-- Visit_System_Instance --
---------------------------
......@@ -118,6 +314,7 @@ package body Ocarina.Backends.AIR_Conf.AIR_Configuration is
Push_Entity (U);
Push_Entity (R);
Map_Connection_Table (E);
Visit_Subcomponents_Of (E);
Pop_Entity;
......
......@@ -198,7 +198,8 @@ package body Ocarina.Backends.AIR_Conf.Partitions is
Q :=
Make_Literal
(XV.New_Numeric_Value
(Get_Partition_Identifier (E),
(Get_Partition_Identifier
(Associated_Processor),
0,
10));
Append_Node_To_List
......@@ -265,7 +266,7 @@ package body Ocarina.Backends.AIR_Conf.Partitions is
-- Port name
Set_Str_To_Name_Buffer ("name");
Set_Str_To_Name_Buffer ("Name");
P := Make_Defining_Identifier (Name_Find);
Get_Name_String (Display_Name (Identifier (F)));
......@@ -293,29 +294,56 @@ package body Ocarina.Backends.AIR_Conf.Partitions is
-- MaxMessageSize
if Get_Data_Size (Corresponding_Instance (F)) /= Null_Size then
Q := Make_Literal (XV.New_Numeric_Value (1024, 1, 10));
-- Q :=
-- Make_Literal
-- (XV.New_Numeric_Value
-- (To_Bytes
-- (Get_Data_Size (Corresponding_Instance (F))),
-- 1,
-- 10));
else
Q := Make_Literal (XV.New_Numeric_Value (1, 1, 10));
end if;
Set_Str_To_Name_Buffer ("MaxMessageSize");
P := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q), XTN.Items (Port_Node));
-- MaxNbMessages
if Is_Event (F) then
if Get_Queue_Size (F) /= -1 then
Q :=
Make_Literal
(XV.New_Numeric_Value
(To_Bytes
(Get_Data_Size (Corresponding_Instance (F))),
(Unsigned_Long_Long (Get_Queue_Size (F)),
1,
10));
else
Q := Make_Literal (XV.New_Numeric_Value (1, 1, 10));
end if;
Set_Str_To_Name_Buffer ("MaxMessageSize");
Set_Str_To_Name_Buffer ("MaxNbMessages");
P := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q), XTN.Items (Port_Node));
end if;
if Is_Data (F) then
-- RefreshRateSeconds
XTU.Add_Attribute ("RefreshRateSeconds", "1.0", Port_Node);
-- XXX hardcoded
Append_Node_To_List (Port_Node, XTN.Subitems (Partition_Node));
Append_Node_To_List
(Port_Node, XTN.Subitems (Partition_Node));
end if;
end if;
F := Next_Node (F);
end loop;
......@@ -340,7 +368,7 @@ package body Ocarina.Backends.AIR_Conf.Partitions is
Append_Node_To_List
(Make_Defining_Identifier
(Get_String_Name ("LIBAIR; LIBPRINTF")),
(Get_String_Name ("LIBAIR; IMASPEX; LIBPRINTF")),
XTN.Subitems (Libs_Node));
-- Devices node, child of PartitionConfiguration
......
......@@ -50,13 +50,8 @@ package body Ocarina.Backends.AIR_Conf is
use Ocarina.ME_AADL.AADL_Instances.Nodes;
use Ocarina.Backends.Expander;
use Ocarina.Backends.Messages;
use Ocarina.Backends.XML_Tree.Generator;
use Ocarina.Backends.Utils;
use Ocarina.Backends.AIR_Conf.Module;
use Ocarina.Backends.AIR_Conf.AIR_Configuration;
use Ocarina.Backends.AIR_Conf.Partitions;
package XTN renames Ocarina.Backends.XML_Tree.Nodes;
package XTU renames Ocarina.Backends.XML_Tree.Nutils;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -59,14 +59,8 @@ package body Ocarina.Backends.POK_C is
use Ocarina.Instances;
use Ocarina.Backends.Expander;
use Ocarina.Backends.Messages;
use Ocarina.Backends.C_Tree.Generator;
use Ocarina.Backends.Utils;
use Ocarina.Backends.Execution_Utils;
use Ocarina.Backends.Execution_Tests;
use Ocarina.Backends.POK_C.Deployment;
use Ocarina.Backends.POK_C.Naming;
use Ocarina.Backends.XML_Tree.Generator;
use Ocarina.Backends.ARINC653_Conf;
package CTN renames Ocarina.Backends.C_Tree.Nodes;
package CTU renames Ocarina.Backends.C_Tree.Nutils;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -50,7 +50,6 @@ package body Ocarina.Backends.ARINC653_Conf.Scheduling is
use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.Utils;
use Ocarina.Backends.Properties;
use Ocarina.Backends.XML_Values;
use Ocarina.Backends.XML_Tree.Nutils;
use Ocarina.Backends.ARINC653_Conf.Mapping;
......