Commit f0d16166 authored by julien.delange's avatar julien.delange

* ocarina/src/core/tree/ocarina-me_aadl-aadl_instances-nutils.ads

   ocarina/src/core/tree/ocarina-me_aadl-aadl_instances-nutils.adb
     - Add Is_Virtual_Processor function

 * ocarina/src/backends/ocarina-backends-xtratum_conf-mapping.adb
   ocarina/src/backends/ocarina-backends-xtratum_conf-mapping.ads
   ocarina/src/backends/ocarina-backends-xtratum_conf.adb
   ocarina/src/backends/ocarina-backends-xtratum_conf.ads
   ocarina/src/backends/ocarina-backends-xtratum_conf-hardware_description.adb
   ocarina/src/backends/ocarina-backends-xtratum_conf-hardware_description.ads
   ocarina/src/backends/ocarina-backends-xtratum_conf-system_description.adb
   ocarina/src/backends/ocarina-backends-xtratum_conf-system_description.ads
   ocarina/src/backends/ocarina-backends.adb
   ocarina/src/backends/ocarina-backends.ads
   - Begin to make the Xtratum XML configuration generator


 * ocarina/resources/deployment.aadl
   ocarina/resources/ocarina_config.aadl
   ocarina/resources/AADLv2/components/processors/leon.aadl
   - Update Ocarina properties to be able to generate xtratum code



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@2154 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 9f9b54a0
......@@ -3,6 +3,7 @@ package ocarina_processors_leon
public
with Deployment;
with ARINC653;
with Cheddar_Properties;
processor leon
......@@ -22,4 +23,28 @@ properties
Deployment::Execution_Platform => LEON_ORK;
end leon.ork;
processor leon3
end leon3;
virtual processor xtratum_partition
end xtratum_partition;
virtual processor implementation xtratum_partition.generic
end xtratum_partition.generic;
processor implementation leon3.xtratum
properties
Deployment::Execution_Platform => LEON3_XTRATUM;
end leon3.xtratum;
processor implementation leon3.xtratum_2partitions
subcomponents
part1 : virtual processor xtratum_partition.generic;
part2 : virtual processor xtratum_partition.generic;
properties
ARINC653::Partition_Slots => (500ms, 500ms);
ARINC653::Slots_Allocation => (reference (part1), reference (part2));
ARINC653::Module_Major_Frame => 1000ms;
end leon3.xtratum_2partitions;
end ocarina_processors_leon;
......@@ -28,6 +28,7 @@ property set Deployment is
(Native, -- Native platforms (GNU/Linux, Solaris, Windows...)
Native_Compcert, -- Native platforms using the Compcert compiler
LEON_RTEMS, -- LEON2 board or tsim-leon (RTEMS)
LEON3_XTRATUM, -- LEON3 with Xtratum
LEON_ORK, -- LEON2 board or tsim-leon (ORK)
LEON_GNAT, -- LEON2 board or qemu (GNATPRO/HI-E)
LINUX32, -- Linux 32 bits
......
......@@ -10,6 +10,7 @@ property set Ocarina_Config is
PolyORB_HI_C,
PolyORB_HI_RTSJ,
POK_C,
Xtratum_Configuration,
Petri_Nets);
Generator : Ocarina_Config::Generator_Type applies to (system);
......
......@@ -2552,7 +2552,8 @@ package body Ocarina.Backends.Properties is
is
P_Name : Name_Id;
begin
pragma Assert (AINU.Is_Processor (P));
pragma Assert (AINU.Is_Processor (P)
or else AINU.Is_Virtual_Processor (P));
if Is_Defined_Enumeration_Property (P, Execution_Platform) then
P_Name := Get_Enumeration_Property (P, Execution_Platform);
......
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.XTRATUM_CONF.HARDWARE_DESCRIPTION --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011, 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 --
-- Free Software Foundation; either version 2, or (at your option) any --
-- later version. Ocarina is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING. --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Ocarina is maintained by the Ocarina team --
-- (ocarina-users@listes.enst.fr) --
-- --
------------------------------------------------------------------------------
with Namet; use Namet;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.Utils;
with Ocarina.Backends.Properties;
with Ocarina.Backends.XML_Values;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.Xtratum_Conf.Mapping;
package body Ocarina.Backends.Xtratum_Conf.Hardware_Description is
use Ocarina.ME_AADL;
use Ocarina.ME_AADL.AADL_Instances.Nodes;
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.Xtratum_Conf.Mapping;
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
package XTN renames Ocarina.Backends.XML_Tree.Nodes;
package XV renames Ocarina.Backends.XML_Values;
procedure Visit_Architecture_Instance (E : Node_Id);
procedure Visit_Component_Instance (E : Node_Id);
procedure Visit_System_Instance (E : Node_Id);
procedure Visit_Process_Instance (E : Node_Id);
procedure Visit_Processor_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id);
Scheduling_Node : Node_Id;
Window_Number : Unsigned_Long_Long := 0;
-----------
-- Visit --
-----------
procedure Visit (E : Node_Id) is
begin
case Kind (E) is
when K_Architecture_Instance =>
Visit_Architecture_Instance (E);
when K_Component_Instance =>
Visit_Component_Instance (E);
when others =>
null;
end case;
end Visit;
---------------------------------
-- Visit_Architecture_Instance --
---------------------------------
procedure Visit_Architecture_Instance (E : Node_Id) is
begin
Visit (Root_System (E));
end Visit_Architecture_Instance;
------------------------------
-- Visit_Component_Instance --
------------------------------
procedure Visit_Component_Instance (E : Node_Id) is
Category : constant Component_Category
:= Get_Category_Of_Component (E);
begin
case Category is
when CC_System =>
Visit_System_Instance (E);
when CC_Process =>
Visit_Process_Instance (E);
when CC_Processor =>
Visit_Processor_Instance (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor_Instance (E);
when others =>
null;
end case;
end Visit_Component_Instance;
----------------------------
-- Visit_Process_Instance --
----------------------------
procedure Visit_Process_Instance (E : Node_Id) is
N : Node_Id;
begin
Map_Process_Scheduling (E, Window_Number, N);
Append_Node_To_List (N, XTN.Subitems (Scheduling_Node));
end Visit_Process_Instance;
---------------------------
-- Visit_System_Instance --
---------------------------
procedure Visit_System_Instance (E : Node_Id) is
S : Node_Id;
Hw_Desc_Node : Node_Id;
U : Node_Id;
R : Node_Id;
begin
U := XTN.Unit (Backend_Node (Identifier (E)));
R := XTN.Node (Backend_Node (Identifier (E)));
Current_XML_Node := XTN.Root_Node (XTN.XML_File (U));
Push_Entity (U);
Push_Entity (R);
Hw_Desc_Node := Make_XML_Node ("HwDescription");
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
if AINU.Is_Processor (Corresponding_Instance (S)) then
Visit (Corresponding_Instance (S));
end if;
S := Next_Node (S);
end loop;
end if;
Append_Node_To_List (Hw_Desc_Node,
XTN.Subitems (Current_XML_Node));
Pop_Entity;
Pop_Entity;
end Visit_System_Instance;
------------------------------
-- Visit_Processor_Instance --
------------------------------
procedure Visit_Processor_Instance (E : Node_Id) is
S : Node_Id;
P : Node_Id;
Q : Node_Id;
begin
Scheduling_Node := Make_XML_Node ("Module_Schedule");
Set_Str_To_Name_Buffer ("MajorFrameSeconds");
P := Make_Defining_Identifier (Name_Find);
Q := Make_Literal
(XV.New_Floating_Point_Value (To_Seconds (Get_POK_Major_Frame (E))));
Append_Node_To_List
(Make_Assignement (P, Q), XTN.Items (Scheduling_Node));
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
Append_Node_To_List (Scheduling_Node,
XTN.Subitems (Current_XML_Node));
end Visit_Processor_Instance;
--------------------------------------
-- Visit_Virtual_Processor_Instance --
--------------------------------------
procedure Visit_Virtual_Processor_Instance (E : Node_Id) is
S : Node_Id;
Processes : List_Id;
begin
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
if Present (Backend_Node (Identifier (E))) then
Processes := XTN.Processes (Backend_Node (Identifier (E)));
S := XTN.First_Node (Processes);
while Present (S) loop
Visit (XTN.Content (S));
S := XTN.Next_Node (S);
end loop;
end if;
end Visit_Virtual_Processor_Instance;
end Ocarina.Backends.Xtratum_Conf.Hardware_Description;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.XTRATUM_CONF.HARDWARE_DESCRIPTION --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011, 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 --
-- Free Software Foundation; either version 2, or (at your option) any --
-- later version. Ocarina is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING. --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Ocarina is maintained by the Ocarina team --
-- (ocarina-users@listes.enst.fr) --
-- --
------------------------------------------------------------------------------
package Ocarina.Backends.Xtratum_Conf.Hardware_Description is
procedure Visit (E : Node_Id);
end Ocarina.Backends.Xtratum_Conf.Hardware_Description;
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.XTRATUM_CONF.MAPPING --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011, 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 --
-- Free Software Foundation; either version 2, or (at your option) any --
-- later version. Ocarina is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING. --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Ocarina is maintained by the Ocarina team --
-- (ocarina-users@listes.enst.fr) --
-- --
------------------------------------------------------------------------------
with Ocarina.Backends.Properties; use Ocarina.Backends.Properties;
package Ocarina.Backends.Xtratum_Conf.Mapping is
function Map_Distributed_Application (E : Node_Id) return Node_Id;
function Map_HI_Node (E : Node_Id) return Node_Id;
function Map_HI_Unit (E : Node_Id) return Node_Id;
function Map_Port (F : Node_Id) return Node_Id;
function Map_Data (E : Node_Id) return Node_Id;
function Map_Data_Access (E : Node_Id) return Node_Id;
function Map_Bus_Access (E : Node_Id) return Node_Id;
function Map_System (E : Node_Id) return Node_Id;
function Map_Process (E : Node_Id;
Partition_Identifier : Unsigned_Long_Long)
return Node_Id;
function Map_Data_Size (T : Size_Type) return Unsigned_Long_Long;
function Map_Virtual_Processor (E : Node_Id) return Node_Id;
function Map_Processor (E : Node_Id) return Node_Id;
function Map_Bus (E : Node_Id) return Node_Id;
function Map_Port_Connection (E : Node_Id) return Node_Id;
function Map_Process_Memory (Process : Node_Id) return Node_Id;
function Map_System_Description (System : Node_Id) return Node_Id;
procedure Map_Process_Scheduling
(Process : Node_Id;
Window_Number : in out Unsigned_Long_Long;
N : out Node_Id);
function Map_Connection
(Connection : Node_Id; Channel_Identifier : Unsigned_Long_Long)
return Node_Id;
function Map_Process_HM_Table (Process : Node_Id) return Node_Id;
function Map_Processor_HM_Table (Processor : Node_Id) return Node_Id;
function Map_System_HM_Table (System : Node_Id) return Node_Id;
end Ocarina.Backends.Xtratum_Conf.Mapping;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.XTRATUM_CONF.SYSTEM_DESCRIPTION --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011, 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 --
-- Free Software Foundation; either version 2, or (at your option) any --
-- later version. Ocarina is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING. --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Ocarina is maintained by the Ocarina team --
-- (ocarina-users@listes.enst.fr) --
-- --
------------------------------------------------------------------------------
with Locations;
with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.Xtratum_Conf.Mapping;
package body Ocarina.Backends.Xtratum_Conf.System_Description is
use Locations;
use Ocarina.ME_AADL;
use Ocarina.ME_AADL.AADL_Instances.Nodes;
use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.Backends.XML_Tree.Nutils;
use Ocarina.Backends.Xtratum_Conf.Mapping;
package AINU renames Ocarina.ME_AADL.AADL_Instances.Nutils;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package XTN renames Ocarina.Backends.XML_Tree.Nodes;
procedure Visit_Architecture_Instance (E : Node_Id);
procedure Visit_Component_Instance (E : Node_Id);
procedure Visit_System_Instance (E : Node_Id);
procedure Visit_Process_Instance (E : Node_Id);
procedure Visit_Processor_Instance (E : Node_Id);
procedure Visit_Bus_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id);
-----------
-- Visit --
-----------
procedure Visit (E : Node_Id) is
begin
case Kind (E) is
when K_Architecture_Instance =>
Visit_Architecture_Instance (E);
when K_Component_Instance =>
Visit_Component_Instance (E);
when others =>
null;
end case;
end Visit;
---------------------------------
-- Visit_Architecture_Instance --
---------------------------------
procedure Visit_Architecture_Instance (E : Node_Id) is
begin
Visit (Root_System (E));
end Visit_Architecture_Instance;
------------------------------
-- Visit_Component_Instance --
------------------------------
procedure Visit_Component_Instance (E : Node_Id) is
Category : constant Component_Category
:= Get_Category_Of_Component (E);
begin
case Category is
when CC_System =>
Visit_System_Instance (E);
when CC_Process =>
Visit_Process_Instance (E);
when CC_Processor =>
Visit_Processor_Instance (E);
when CC_Bus =>
Visit_Bus_Instance (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor_Instance (E);
when others =>
null;
end case;
end Visit_Component_Instance;
----------------------------
-- Visit_Process_Instance --
----------------------------
procedure Visit_Process_Instance (E : Node_Id) is
S : Node_Id;
begin
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end Visit_Process_Instance;
---------------------------
-- Visit_System_Instance --
---------------------------
procedure Visit_System_Instance (E : Node_Id) is
S : Node_Id;
P : Node_Id;
U : Node_Id;
N : Node_Id;
Processes : List_Id;
begin
P := Map_HI_Node (E);
Push_Entity (P);
U := Map_HI_Unit (E);
Push_Entity (U);
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
if AINU.Is_Processor (Corresponding_Instance (S)) then
Visit (Corresponding_Instance (S));
end if;
S := Next_Node (S);
end loop;
end if;
N := New_Node (XTN.K_HI_Tree_Bindings);
Processes := AINU.New_List (K_Node_Id, No_Location);
XTN.Set_Processes (N, Processes);
XTN.Set_Unit (N, U);
XTN.Set_Node (N, P);
AIN.Set_Backend_Node (Identifier (E), N);
Pop_Entity;
Pop_Entity;
end Visit_System_Instance;
------------------------
-- Visit_Bus_Instance --
------------------------
procedure Visit_Bus_Instance (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Bus_Instance;
------------------------------
-- Visit_Processor_Instance --
------------------------------
procedure Visit_Processor_Instance (E : Node_Id) is
S : Node_Id;
N : Node_Id;
Processes : List_Id;
begin
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
N := New_Node (XTN.K_HI_Tree_Bindings);
Processes := AINU.New_List (K_Node_Id, No_Location);
XTN.Set_Processes (N, Processes);
AIN.Set_Backend_Node (Identifier (E), N);
end Visit_Processor_Instance;
--------------------------------------
-- Visit_Virtual_Processor_Instance --
--------------------------------------
procedure Visit_Virtual_Processor_Instance (E : Node_Id) is
S : Node_Id;
begin
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
while Present (S) loop
-- Visit the component instance corresponding to the
-- subcomponent S.
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end Visit_Virtual_Processor_Instance;
end Ocarina.Backends.Xtratum_Conf.System_Description;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.XTRATUM_CONF.SYSTEM_DESCRIPTION --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011, 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 --
-- Free Software Foundation; either version 2, or (at your option) any --
-- later version. Ocarina is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING. --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- Ocarina is maintained by the Ocarina team --
-- (ocarina-users@listes.enst.fr) --
-- --
------------------------------------------------------------------------------
package Ocarina.Backends.Xtratum_Conf.System_Description is