Commit d88b4d43 authored by yoogx's avatar yoogx

* Remove the CARTS backend

parent 028f8d70
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . C A R T S . M A I N --
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. 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. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
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.Carts.Mapping;
with Ocarina.Backends.Properties;
package body Ocarina.Backends.Carts.Main is
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.Carts.Mapping;
use Ocarina.Backends.Properties;
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;
procedure Visit_Component (E : Node_Id);
procedure Visit_System (E : Node_Id);
procedure Visit_Processor (E : Node_Id);
procedure Visit_Bus (E : Node_Id);
procedure Look_For_Threads (E : Node_Id);
procedure Visit_Virtual_Processor (E : Node_Id);
Root_System_Node : Node_Id := No_Node;
Current_Processor_Node : Node_Id;
Current_System_Node : Node_Id;
Current_Virtual_Processor_Node : Node_Id;
Current_AADL_Virtual_Processor : Node_Id;
----------------------
-- Look_For_Threads --
----------------------
procedure Look_For_Threads (E : Node_Id) is
S : Node_Id;
Bound_Processor : Node_Id;
begin
if AINU.Is_Thread (E) then
Bound_Processor :=
Get_Bound_Processor (Parent_Component (Parent_Subcomponent (E)));
if Bound_Processor /= No_Node
and then Bound_Processor = Current_AADL_Virtual_Processor
then
Append_Node_To_List
(Map_Thread (E),
XTN.Subitems (Current_Virtual_Processor_Node));
end if;
else
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.
Look_For_Threads (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end if;
end Look_For_Threads;
-----------
-- Visit --
-----------
procedure Visit (E : Node_Id) is
begin
case Kind (E) is
when K_Architecture_Instance =>
Root_System_Node := Root_System (E);
Visit (Root_System_Node);
when K_Component_Instance =>
Visit_Component (E);
when others =>
null;
end case;
end Visit;
---------------------
-- Visit_Component --
---------------------
procedure Visit_Component (E : Node_Id) is
Category : constant Component_Category := Get_Category_Of_Component (E);
begin
case Category is
when CC_System =>
Visit_System (E);
when CC_Processor =>
Visit_Processor (E);
when CC_Bus =>
Visit_Bus (E);
when CC_Virtual_Processor =>
Visit_Virtual_Processor (E);
when others =>
null;
end case;
end Visit_Component;
---------------
-- Visit_Bus --
---------------
procedure Visit_Bus (E : Node_Id) is
pragma Unreferenced (E);
begin
null;
end Visit_Bus;
--------------------------------------
-- Visit_Virtual_Processor_Instance --
--------------------------------------
procedure Visit_Virtual_Processor (E : Node_Id) is
begin
Current_AADL_Virtual_Processor := E;
Current_Virtual_Processor_Node := Map_Virtual_Processor (E);
XTU.Append_Node_To_List
(Current_Virtual_Processor_Node,
XTN.Subitems (Current_Processor_Node));
Look_For_Threads (Root_System_Node);
end Visit_Virtual_Processor;
---------------------
-- Visit_Processor --
---------------------
procedure Visit_Processor (E : Node_Id) is
S : Node_Id;
begin
Current_Processor_Node := Map_Processor (E);
Append_Node_To_List
(Current_Processor_Node,
XTN.Subitems (Current_System_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;
end Visit_Processor;
------------------
-- Visit_System --
------------------
procedure Visit_System (E : Node_Id) is
S : Node_Id;
P : Node_Id;
U : Node_Id;
begin
P := Map_HI_Node (E);
Push_Entity (P);
U := Map_HI_Unit (E);
Push_Entity (U);
Current_System_Node := XTN.Root_Node (XTN.XML_File (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.
Visit (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
Pop_Entity;
Pop_Entity; -- A
end Visit_System;
end Ocarina.Backends.Carts.Main;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . C A R T S . M A I N --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. 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. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
package Ocarina.Backends.Carts.Main is
procedure Visit (E : Node_Id);
end Ocarina.Backends.Carts.Main;
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . C A R T S . M A P P I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. 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. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
package Ocarina.Backends.Carts.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_Thread (Thread : Node_Id) return Node_Id;
function Map_Virtual_Processor (E : Node_Id) return Node_Id;
function Map_Processor (E : Node_Id) return Node_Id;
end Ocarina.Backends.Carts.Mapping;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . C A R T S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. 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. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
with Ocarina.Instances;
with Ocarina.Backends.Expander;
with Ocarina.Backends.Messages;
with Ocarina.Backends.Carts.Main;
with Ocarina.Backends.Utils;
with Ocarina.Backends.XML_Tree.Nodes;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.XML_Tree.Generator;
with Ocarina.Namet; use Ocarina.Namet;
package body Ocarina.Backends.Carts is
use Ocarina.Instances;
use Ocarina.Backends.Messages;
use Ocarina.Backends.Utils;
use Ocarina.Backends.Expander;
package XTN renames Ocarina.Backends.XML_Tree.Nodes;
package XTU renames Ocarina.Backends.XML_Tree.Nutils;
procedure Visit_Architecture_Instance (E : Node_Id);
-- Most top level visitor routine. E is the root of the AADL
-- instance tree. The procedure does a traversal for each
-- compilation unit to be generated.
--------------
-- Generate --
--------------
procedure Generate (AADL_Root : Node_Id) is
Instance_Root : Node_Id;
begin
Instance_Root := Instantiate_Model (AADL_Root);
-- Expand the AADL instance
Expand (Instance_Root);
Visit_Architecture_Instance (Instance_Root);
-- Abort if the construction of the XML tree failed
if No (XML_Root) then
Display_Error ("XML generation failed", Fatal => True);
end if;
Enter_Directory (Generated_Sources_Directory);
if not Remove_Generated_Sources then
-- Create the source files
XML_Tree.Generator.Generate (XML_Root);
end if;
Leave_Directory;
end Generate;
----------
-- Init --
----------
procedure Init is
begin
Register_Backend ("carts", Generate'Access, Carts_XML);
end Init;
-----------
-- Reset --
-----------
procedure Reset is
begin
null;
end Reset;
---------------------------------
-- Visit_Architecture_Instance --
---------------------------------
procedure Visit_Architecture_Instance (E : Node_Id) is
begin
XML_Root := XTU.New_Node (XTN.K_HI_Distributed_Application);
Set_Str_To_Name_Buffer ("generated-code");
XTN.Set_Name (XML_Root, Name_Find);
XTN.Set_Units (XML_Root, XTU.New_List (XTN.K_List_Id));
XTN.Set_HI_Nodes (XML_Root, XTU.New_List (XTN.K_List_Id));
XTU.Push_Entity (XML_Root);
Carts.Main.Visit (E);
XTU.Pop_Entity;
end Visit_Architecture_Instance;
------------------
-- Get_XML_Root --
------------------
function Get_XML_Root return Node_Id is
begin
return XML_Root;
end Get_XML_Root;
end Ocarina.Backends.Carts;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . C A R T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009 Telecom ParisTech, 2010-2015 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. 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. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- Ocarina is maintained by the TASTE project --
-- (taste-users@lists.tuxfamily.org) --
-- --
------------------------------------------------------------------------------
package Ocarina.Backends.Carts is
-- This backend generates an XML file compatible with the CARTS
-- tool, provided by U. Penn. (XXX URL ?)
procedure Generate (AADL_Root : Node_Id);
-- The main entry point of the CARTS configuration generator
procedure Init;
-- Fills the corresponding location in the generator table by the
-- information on this generator and execute some initialization
-- routines necessary for its work.
procedure Reset;
function Get_XML_Root return Node_Id;
private
XML_Root : Node_Id;
Current_XML_Node : Node_Id;
Distributed_Application : Node_Id;
HI_Node : Node_Id;
HI_Unit : Node_Id;
-- The root of the XML trees
end Ocarina.Backends.Carts;
......@@ -49,7 +49,6 @@ with Ocarina.Backends.ASN1;
with Ocarina.Backends.PO_HI_C;
with Ocarina.Backends.Stats;
with Ocarina.Backends.Subprograms;
with Ocarina.Backends.Carts;
with Ocarina.Backends.Cheddar;
with Ocarina.Backends.Connection_Matrix;
with Ocarina.Backends.Functions_Matrix;
......@@ -195,7 +194,6 @@ package body Ocarina.Backends is
Stats.Init;
Subprograms.Init;
REAL.Init;
Carts.Init;
ASN1.Init;
Cheddar.Init;
Connection_Matrix.Init;
......@@ -261,7 +259,6 @@ package body Ocarina.Backends is
POK_C.Reset;
Xtratum_Conf.Reset;
Stats.Reset;
Carts.Reset;
Connection_Matrix.Reset;
Functions_Matrix.Reset;
......
......@@ -54,7 +54,6 @@ package Ocarina.Backends is
ASN1_Deployment,
Behavior_PP,
Bound_T,
Carts_XML,
Cheddar_XML,
Deos_XML,
Vxworks653_XML,
......
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