Commit 73f40f6b authored by yoogx's avatar yoogx

* Clean-up of the xtratum_conf backend

parent 6e5f95d1
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2015 ESA & ISAE. --
-- Copyright (C) 2011-2016 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- --
......@@ -36,12 +36,10 @@ 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.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.XML_Values;
package body Ocarina.Backends.Xtratum_Conf.Channels is
......@@ -63,10 +61,9 @@ package body Ocarina.Backends.Xtratum_Conf.Channels is
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_Memory_Instance (E : Node_Id);
procedure Visit_Processor_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id);
procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
-----------
-- Visit --
......@@ -106,15 +103,9 @@ package body Ocarina.Backends.Xtratum_Conf.Channels is
when CC_System =>
Visit_System_Instance (E);
when CC_Process =>
Visit_Process_Instance (E);
when CC_Processor =>
Visit_Processor_Instance (E);
when CC_Memory =>
Visit_Memory_Instance (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor_Instance (E);
......@@ -123,22 +114,11 @@ package body Ocarina.Backends.Xtratum_Conf.Channels is
end case;
end Visit_Component_Instance;
----------------------------
-- Visit_Process_Instance --
----------------------------
procedure Visit_Process_Instance (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Process_Instance;
---------------------------
-- Visit_System_Instance --
---------------------------
procedure Visit_System_Instance (E : Node_Id) is
S : Node_Id;
C : Node_Id;
U : Node_Id;
R : Node_Id;
......@@ -318,16 +298,7 @@ package body Ocarina.Backends.Xtratum_Conf.Channels is
Append_Node_To_List (Channels_Node, XTN.Subitems (Current_XML_Node));
end if;
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;
Visit_Subcomponents_Of (E);
Pop_Entity;
Pop_Entity;
......@@ -338,18 +309,8 @@ package body Ocarina.Backends.Xtratum_Conf.Channels is
------------------------------
procedure Visit_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;
Visit_Subcomponents_Of (E);
end Visit_Processor_Instance;
--------------------------------------
......@@ -357,28 +318,8 @@ package body Ocarina.Backends.Xtratum_Conf.Channels is
--------------------------------------
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;
Visit_Subcomponents_Of (E);
end Visit_Virtual_Processor_Instance;
---------------------------
-- Visit_Memory_Instance --
---------------------------
procedure Visit_Memory_Instance (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Memory_Instance;
end Ocarina.Backends.Xtratum_Conf.Channels;
......@@ -39,10 +39,10 @@ with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.Instances.Queries;
with Ocarina.Backends.Utils;
with Ocarina.Backends.Messages;
with Ocarina.Backends.Properties;
with Ocarina.Backends.Properties.ARINC653;
with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Values;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
......@@ -76,6 +76,8 @@ package body Ocarina.Backends.Xtratum_Conf.Hardware_Description is
Processor_Identifier : Unsigned_Long_Long := 0;
procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
-----------
-- Visit --
-----------
......@@ -395,18 +397,11 @@ package body Ocarina.Backends.Xtratum_Conf.Hardware_Description is
end loop;
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;
Visit_Subcomponents_Of (E);
if Module_Schedule'Length > 0 then
Processor_Identifier := Processor_Identifier + 1;
end if;
Append_Node_To_List (Processor_Node, XTN.Subitems (Current_XML_Node));
end Visit_Processor_Instance;
......@@ -416,18 +411,8 @@ package body Ocarina.Backends.Xtratum_Conf.Hardware_Description is
--------------------------------------
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;
Visit_Subcomponents_Of (E);
end Visit_Virtual_Processor_Instance;
---------------------------
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2015 ESA & ISAE. --
-- Copyright (C) 2011-2016 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- --
......@@ -56,6 +56,10 @@ package body Ocarina.Backends.Xtratum_Conf.Mapping is
package XV renames Ocarina.Backends.XML_Values;
package XTN renames Ocarina.Backends.XML_Tree.Nodes;
-------------------
-- Map_Scheduler --
-------------------
procedure Map_Scheduler (E : Node_Id; N : Node_Id) is
Scheduler : Supported_POK_Scheduler;
R : Node_Id;
......
......@@ -70,7 +70,6 @@ package body Ocarina.Backends.Xtratum_Conf.Partition_Table is
procedure Visit_Component_Instance (E : Node_Id);
procedure Visit_System_Instance (E : Node_Id);
procedure Visit_Process_Instance (E : Node_Id);
procedure Visit_Memory_Instance (E : Node_Id);
procedure Visit_Processor_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id);
......@@ -120,9 +119,6 @@ package body Ocarina.Backends.Xtratum_Conf.Partition_Table is
when CC_Processor =>
Visit_Processor_Instance (E);
when CC_Memory =>
Visit_Memory_Instance (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor_Instance (E);
......@@ -489,14 +485,4 @@ package body Ocarina.Backends.Xtratum_Conf.Partition_Table is
end if;
end Visit_Virtual_Processor_Instance;
---------------------------
-- Visit_Memory_Instance --
---------------------------
procedure Visit_Memory_Instance (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Memory_Instance;
end Ocarina.Backends.Xtratum_Conf.Partition_Table;
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2015 ESA & ISAE. --
-- Copyright (C) 2011-2016 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- --
......@@ -33,14 +33,9 @@ with Ocarina.Namet; use Ocarina.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.Instances.Queries;
-- with Ocarina.Backends.Messages;
-- with Ocarina.Backends.Properties;
-- with Ocarina.Backends.XML_Values;
with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
......@@ -49,25 +44,17 @@ package body Ocarina.Backends.Xtratum_Conf.Resident_Sw is
use Ocarina.ME_AADL;
use Ocarina.ME_AADL.AADL_Instances.Nodes;
use Ocarina.ME_AADL.AADL_Instances.Entities;
-- use Ocarina.Instances.Queries;
-- use Ocarina.Backends.Messages;
-- use Ocarina.Backends.Properties;
-- use Ocarina.Backends.XML_Values;
use Ocarina.Backends.Utils;
use Ocarina.Backends.XML_Tree.Nutils;
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_Memory_Instance (E : Node_Id);
procedure Visit_Processor_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id);
procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
-----------
-- Visit --
......@@ -107,15 +94,9 @@ package body Ocarina.Backends.Xtratum_Conf.Resident_Sw is
when CC_System =>
Visit_System_Instance (E);
when CC_Process =>
Visit_Process_Instance (E);
when CC_Processor =>
Visit_Processor_Instance (E);
when CC_Memory =>
Visit_Memory_Instance (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor_Instance (E);
......@@ -124,22 +105,11 @@ package body Ocarina.Backends.Xtratum_Conf.Resident_Sw is
end case;
end Visit_Component_Instance;
----------------------------
-- Visit_Process_Instance --
----------------------------
procedure Visit_Process_Instance (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Process_Instance;
---------------------------
-- Visit_System_Instance --
---------------------------
procedure Visit_System_Instance (E : Node_Id) is
S : Node_Id;
U : Node_Id;
R : Node_Id;
begin
......@@ -151,16 +121,7 @@ package body Ocarina.Backends.Xtratum_Conf.Resident_Sw is
Push_Entity (U);
Push_Entity (R);
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;
Visit_Subcomponents_Of (E);
Pop_Entity;
Pop_Entity;
......@@ -171,7 +132,6 @@ package body Ocarina.Backends.Xtratum_Conf.Resident_Sw is
------------------------------
procedure Visit_Processor_Instance (E : Node_Id) is
S : Node_Id;
Resident_Sw_Node : Node_Id;
Physical_Areas_Node : Node_Id;
Area_Node : Node_Id;
......@@ -220,16 +180,7 @@ package body Ocarina.Backends.Xtratum_Conf.Resident_Sw is
Append_Node_To_List (Resident_Sw_Node, XTN.Subitems (Current_XML_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;
Visit_Subcomponents_Of (E);
end Visit_Processor_Instance;
--------------------------------------
......@@ -237,28 +188,8 @@ package body Ocarina.Backends.Xtratum_Conf.Resident_Sw is
--------------------------------------
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;
Visit_Subcomponents_Of (E);
end Visit_Virtual_Processor_Instance;
---------------------------
-- Visit_Memory_Instance --
---------------------------
procedure Visit_Memory_Instance (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Memory_Instance;
end Ocarina.Backends.Xtratum_Conf.Resident_Sw;
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2015 ESA & ISAE. --
-- Copyright (C) 2011-2016 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- --
......@@ -35,6 +35,7 @@ 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.XML_Values;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
......@@ -46,7 +47,7 @@ package body Ocarina.Backends.Xtratum_Conf.System_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.XML_Tree.Nutils;
use Ocarina.Backends.Xtratum_Conf.Mapping;
......@@ -60,8 +61,8 @@ package body Ocarina.Backends.Xtratum_Conf.System_Description is
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);
procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
Partition_Identifier : Unsigned_Long_Long := 0;
......@@ -109,9 +110,6 @@ package body Ocarina.Backends.Xtratum_Conf.System_Description is
when CC_Processor =>
Visit_Processor_Instance (E);
when CC_Bus =>
Visit_Bus_Instance (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor_Instance (E);
......@@ -125,18 +123,8 @@ package body Ocarina.Backends.Xtratum_Conf.System_Description is
----------------------------
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;
Visit_Subcomponents_Of (E);
end Visit_Process_Instance;
---------------------------
......@@ -182,34 +170,14 @@ package body Ocarina.Backends.Xtratum_Conf.System_Description is
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;
Visit_Subcomponents_Of (E);
N := New_Node (XTN.K_HI_Tree_Bindings);
......@@ -225,7 +193,6 @@ package body Ocarina.Backends.Xtratum_Conf.System_Description is
--------------------------------------
procedure Visit_Virtual_Processor_Instance (E : Node_Id) is
S : Node_Id;
Partition_Identifier_Node : Node_Id;
begin
Partition_Identifier_Node :=
......@@ -233,19 +200,9 @@ package body Ocarina.Backends.Xtratum_Conf.System_Description is
AIN.Set_Backend_Node (Identifier (E), Partition_Identifier_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;
Visit_Subcomponents_Of (E);
Partition_Identifier := Partition_Identifier + 1;
end Visit_Virtual_Processor_Instance;
end Ocarina.Backends.Xtratum_Conf.System_Description;
......@@ -33,14 +33,9 @@ with Ocarina.Namet; use Ocarina.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.Instances.Queries;
-- with Ocarina.Backends.Messages;
-- with Ocarina.Backends.Properties;
-- with Ocarina.Backends.XML_Values;
with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
......@@ -50,24 +45,17 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is
use Ocarina.ME_AADL.AADL_Instances.Nodes;
use Ocarina.ME_AADL.AADL_Instances.Entities;
-- use Ocarina.Instances.Queries;
-- use Ocarina.Backends.Messages;
-- use Ocarina.Backends.Properties;
-- use Ocarina.Backends.XML_Values;
use Ocarina.Backends.Utils;
use Ocarina.Backends.XML_Tree.Nutils;
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_Memory_Instance (E : Node_Id);
procedure Visit_Processor_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id);
procedure Visit_Subcomponents_Of is new Visit_Subcomponents_Of_G (Visit);
-----------
-- Visit --
......@@ -107,15 +95,9 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is
when CC_System =>
Visit_System_Instance (E);
when CC_Process =>
Visit_Process_Instance (E);
when CC_Processor =>
Visit_Processor_Instance (E);
when CC_Memory =>
Visit_Memory_Instance (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor_Instance (E);
......@@ -124,22 +106,11 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is
end case;
end Visit_Component_Instance;
----------------------------
-- Visit_Process_Instance --
----------------------------
procedure Visit_Process_Instance (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Process_Instance;
---------------------------
-- Visit_System_Instance --
---------------------------
procedure Visit_System_Instance (E : Node_Id) is
S : Node_Id;
U : Node_Id;
R : Node_Id;
begin
......@@ -151,16 +122,7 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is
Push_Entity (U);
Push_Entity (R);
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;
Visit_Subcomponents_Of (E);
Pop_Entity;
Pop_Entity;
......@@ -171,22 +133,11 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is
------------------------------
procedure Visit_Processor_Instance (E : Node_Id) is
S : Node_Id;
Xm_Hypervisor_Node : Node_Id;
Memory_Area_Node : Node_Id;
P : Node_Id;
Q : Node_Id;
begin
-- Associated_Memory := Get_Bound_Memory (E);
-- if Associated_Memory = No_Node then
-- Display_Located_Error
-- (Loc (E),
-- "The processor has to be associated to a memory",
-- Fatal => True);
-- end if;
-- Create the main XMHypervisor node.
Xm_Hypervisor_Node := Make_XML_Node ("XMHypervisor");
......@@ -221,16 +172,7 @@ package body Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor is
(Xm_Hypervisor_Node,
XTN.Subitems (Current_XML_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));