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

* Map partitions channels and ports



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@2175 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 33765d3e
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.XTRATUM_CONF.CHANNELS --
-- --
-- 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.Channels is
procedure Visit (E : Node_Id);
end Ocarina.Backends.Xtratum_Conf.Channels;
......@@ -145,10 +145,13 @@ package body Ocarina.Backends.Xtratum_Conf.Partition_Table is
Associated_Memory : Node_Id;
Physical_Areas_Node : Node_Id;
Temporal_Req_Node : Node_Id;
Port_Table_Node : Node_Id;
Port_Node : Node_Id;
Area_Node : Node_Id;
P : Node_Id;
Q : Node_Id;
S : Node_Id;
F : Node_Id;
begin
Associated_Processor := Get_Bound_Processor (E);
Associated_Memory := Get_Bound_Memory (E);
......@@ -290,6 +293,73 @@ package body Ocarina.Backends.Xtratum_Conf.Partition_Table is
Append_Node_To_List
(Temporal_Req_Node, XTN.Subitems (Partition_Node));
-- Now, handle the ports of the partition.
if Has_Ports (E) then
Port_Table_Node := Make_XML_Node ("PortTable");
F := First_Node (Features (E));
while Present (F) loop
if Kind (F) = K_Port_Spec_Instance then
if not Is_Data (F) then
Display_Located_Error
(AIN.Loc (F),
"Pure events ports are not allowed.",
Fatal => True);
end if;
if Is_In (F) and then Is_Out (F) then
Display_Located_Error
(AIN.Loc (F),
"in/out ports are not allowed.",
Fatal => True);
end if;
Port_Node := Make_XML_Node ("Port");
Set_Str_To_Name_Buffer ("name");
P := Make_Defining_Identifier (Name_Find);
Get_Name_String (Display_Name (Identifier (F)));
Q := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q), XTN.Items (Port_Node));
Set_Str_To_Name_Buffer ("type");
P := Make_Defining_Identifier (Name_Find);
if Is_Data (F) and then not Is_Event (F) then
Set_Str_To_Name_Buffer ("sampling");
else
Set_Str_To_Name_Buffer ("queueing");
end if;
Q := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q), XTN.Items (Port_Node));
Set_Str_To_Name_Buffer ("direction");
P := Make_Defining_Identifier (Name_Find);
if Is_In (F) then
Set_Str_To_Name_Buffer ("destination");
else
Set_Str_To_Name_Buffer ("source");
end if;
Q := Make_Defining_Identifier (Name_Find);
Append_Node_To_List
(Make_Assignement (P, Q), XTN.Items (Port_Node));
Append_Node_To_List
(Port_Node, XTN.Subitems (Port_Table_Node));
end if;
F := Next_Node (F);
end loop;
Append_Node_To_List (Port_Table_Node, XTN.Subitems (Partition_Node));
end if;
Append_Node_To_List
(Partition_Node, XTN.Subitems (Current_XML_Node));
end Visit_Process_Instance;
......
......@@ -44,6 +44,7 @@ with Ocarina.Backends.Xtratum_Conf.Hardware_Description;
with Ocarina.Backends.Xtratum_Conf.Xm_Hypervisor;
with Ocarina.Backends.Xtratum_Conf.Resident_Sw;
with Ocarina.Backends.Xtratum_Conf.Partition_Table;
with Ocarina.Backends.Xtratum_Conf.Channels;
with GNAT.Command_Line; use GNAT.Command_Line;
......@@ -168,6 +169,7 @@ package body Ocarina.Backends.Xtratum_Conf is
Xm_Hypervisor.Visit (E);
Resident_Sw.Visit (E);
Partition_Table.Visit (E);
Channels.Visit (E);
XTU.Pop_Entity;
end Visit_Architecture_Instance;
......
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