Commit 6f1e23f2 authored by julien.delange's avatar julien.delange

* begin to implementation traceability matrix for functional part

   of the system



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@2321 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 04192a21
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.FUNCTIONS_MATRIX.MAIN --
-- --
-- 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.Functions_Matrix.Main is
Functions_Matrix_Root_Node : Node_Id;
procedure Visit (E : Node_Id);
end Ocarina.Backends.Functions_Matrix.Main;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . F U N C T I O N S _ M A T R I X --
-- --
-- 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 Ocarina.Instances;
with Ocarina.Backends.Messages;
with Ocarina.Backends.Expander;
with Ocarina.Backends.XML_Tree.Generator;
with Ocarina.Backends.Utils;
with Ocarina.Backends.Functions_Matrix.Main;
with GNAT.Command_Line; use GNAT.Command_Line;
with Namet; use Namet;
package body Ocarina.Backends.Functions_Matrix is
use Ocarina.Instances;
use Ocarina.Backends.Expander;
use Ocarina.Backends.Messages;
use Ocarina.Backends.XML_Tree.Generator;
use Ocarina.Backends.Utils;
Remove_Generated_Sources : Boolean := False;
Generated_Sources_Directory : Name_Id := No_Name;
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 (Instance_Root);
Visit_Architecture_Instance (Instance_Root);
-- Abort if the construction of the tree failed
if No (XML_Root) then
Display_Error
("Functional traceability matrix " &
"generation failed", Fatal => True);
end if;
-- At this point, we have a valid tree, we can begin the XML
-- file generation.
-- Enter the output directory
Enter_Directory (Generated_Sources_Directory);
if not Remove_Generated_Sources then
-- Create the source files
XML_Tree.Generator.Generate (XML_Root);
end if;
-- Leave the output directory
Leave_Directory;
end Generate;
----------
-- Init --
----------
procedure Init is
begin
Generated_Sources_Directory := Get_String_Name (".");
Initialize_Option_Scan;
loop
case Getopt ("* b z o:") is
when ASCII.NUL =>
exit;
when 'z' =>
Remove_Generated_Sources := True;
when 'o' =>
declare
D : constant String := Parameter;
begin
if D'Length /= 0 then
Generated_Sources_Directory := Get_String_Name (D);
end if;
end;
when others =>
null;
end case;
end loop;
Register_Backend
("Function_Matrix",
Generate'Access,
Functions_Matrix_Analysis);
end Init;
-----------
-- Reset --
-----------
procedure Reset is
begin
null;
end Reset;
---------------------------------
-- Visit_Architecture_Instance --
---------------------------------
procedure Visit_Architecture_Instance (E : Node_Id) is
begin
Main.Visit (E);
end Visit_Architecture_Instance;
end Ocarina.Backends.Functions_Matrix;
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- O C A R I N A . B A C K E N D S . F U N C T I O N S _ M A T R I X --
-- --
-- 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.Functions_Matrix is
procedure Generate (AADL_Root : Node_Id);
-- The main entry point of the 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;
private
XML_Root : Node_Id;
-- The root of the XML trees to generate HTML file.
end Ocarina.Backends.Functions_Matrix;
......@@ -1772,7 +1772,8 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Append_Node_To_List
(RE (RE_Littleendian), CTN.Values (Endiannesses));
when Platform_LEON_RTEMS =>
when Platform_LEON_RTEMS |
Platform_LEON3_XM3 =>
Append_Node_To_List
(RE (RE_Bigendian), CTN.Values (Endiannesses));
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2008-2010, European Space Agency (ESA). --
-- Copyright (C) 2008-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 --
......@@ -173,6 +173,9 @@ package body Ocarina.Backends.PO_HI_C is
when Platform_LINUX32 =>
Write_Str ("linux32");
when Platform_LEON3_XM3 =>
Write_Str ("leon3-xm3");
when Platform_LINUX32_XENOMAI_NATIVE =>
Write_Str ("linux32-xenomai-native");
......
......@@ -152,6 +152,7 @@ package body Ocarina.Backends.Properties is
Port_Number : Name_Id;
Process_Id : Name_Id;
Processor_Binding : Name_Id;
Function_Binding : Name_Id;
Memory_Binding : Name_Id;
Process_Channel_Address : Name_Id;
......@@ -310,6 +311,7 @@ package body Ocarina.Backends.Properties is
Platform_X86_RTEMS_Name : Name_Id;
Platform_LEON_GNAT_Name : Name_Id;
Platform_LEON_ORK_Name : Name_Id;
Platform_LEON3_XM3_Name : Name_Id;
Platform_ERC32_ORK_Name : Name_Id;
Platform_ARM_DSLINUX_Name : Name_Id;
Platform_ARM_N770_Name : Name_Id;
......@@ -2487,6 +2489,19 @@ package body Ocarina.Backends.Properties is
end if;
end Get_Bound_Memory;
-------------------------
-- Get_Bound_Processor --
-------------------------
function Get_Bound_Function (P : Node_Id) return Node_Id is
begin
if not Is_Defined_Reference_Property (P, Function_Binding) then
return No_Node;
end if;
return Get_Reference_Property (P, Function_Binding);
end Get_Bound_Function;
-------------------
-- Get_Bound_Bus --
-------------------
......@@ -2580,6 +2595,8 @@ package body Ocarina.Backends.Properties is
return Platform_LEON_GNAT;
elsif P_Name = Platform_LEON_ORK_Name then
return Platform_LEON_ORK;
elsif P_Name = Platform_LEON3_XM3_Name then
return Platform_LEON3_XM3;
elsif P_Name = Platform_ERC32_ORK_Name then
return Platform_ERC32_ORK;
elsif P_Name = Platform_ARM_DSLINUX_Name then
......@@ -3006,6 +3023,7 @@ package body Ocarina.Backends.Properties is
Port_Number := Get_String_Name ("deployment::port_number");
Process_Id := Get_String_Name ("deployment::process_id");
Processor_Binding := Get_String_Name ("actual_processor_binding");
Function_Binding := Get_String_Name ("actual_function_binding");
Memory_Binding := Get_String_Name ("actual_memory_binding");
Word_Count := Get_String_Name ("word_count");
Word_Size := Get_String_Name ("word_size");
......@@ -3112,6 +3130,7 @@ package body Ocarina.Backends.Properties is
Platform_LEON_RTEMS_Name := Get_String_Name ("leon_rtems");
Platform_LEON_GNAT_Name := Get_String_Name ("leon_gnat");
Platform_LEON_ORK_Name := Get_String_Name ("leon_ork");
Platform_LEON3_XM3_Name := Get_String_Name ("leon3_xm3");
Platform_ERC32_ORK_Name := Get_String_Name ("erc32_ork");
Platform_ARM_DSLINUX_Name := Get_String_Name ("arm_dslinux");
Platform_ARM_N770_Name := Get_String_Name ("arm_n770");
......
......@@ -531,6 +531,9 @@ package Ocarina.Backends.Properties is
-- Return the processor component to which the process P is
-- bound. Raises an error if P is not bound to any processor.
function Get_Bound_Function (P : Node_Id) return Node_Id;
-- Return the function bound to this component.
function Get_Bound_Memory (P : Node_Id) return Node_Id;
-- Return the memory component to which the process P is
-- bound. Returns No_Node is no memory component is bounded.
......@@ -571,6 +574,7 @@ package Ocarina.Backends.Properties is
Platform_X86_RTEMS,
Platform_X86_LINUXTASTE,
Platform_LEON_GNAT,
Platform_LEON3_XM3,
Platform_LEON_ORK,
Platform_LINUX32,
Platform_LINUX32_XENOMAI_NATIVE,
......
......@@ -51,6 +51,7 @@ with Ocarina.Backends.Subprograms;
with Ocarina.Backends.Carts;
with Ocarina.Backends.Cheddar;
with Ocarina.Backends.Connection_Matrix;
with Ocarina.Backends.Functions_Matrix;
with Ocarina.Backends.MAST;
with Ocarina.Backends.MAST_Values;
with Ocarina.Backends.MAST_Tree.Nodes;
......@@ -192,6 +193,7 @@ package body Ocarina.Backends is
ASN1.Init;
Cheddar.Init;
Connection_Matrix.Init;
Functions_Matrix.Init;
end Init;
----------------------
......@@ -254,6 +256,7 @@ package body Ocarina.Backends is
Carts.Reset;
PO_QoS_Ada.Reset;
Connection_Matrix.Reset;
Functions_Matrix.Reset;
Ada_Tree.Nutils.Reset;
C_Tree.Nutils.Reset;
......
......@@ -58,6 +58,7 @@ package Ocarina.Backends is
Carts_XML,
Cheddar_XML,
Connection_Matrix_Analysis,
Functions_Matrix_Analysis,
MAST_Scheduling,
Petri_Nets,
PolyORB_HI_Ada,
......
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