Commit b719f735 authored by Bechir Zalila's avatar Bechir Zalila

* New Backend to support fault tolerence in Ocarina. Using the EMv2

	annex and a new property set, this backend expands AADL models having
	replication properties into classic AADL models that can be handled
	with code generators.

	(Phd thesis work of Wafa Gabsi)
parent c935cfe6
property set Replication_Properties is
-- description of the context, requirements and goal of the replication
Description : aadlstring applies to (system, process, thread, processor, device);
-- Specification of the replica number
Replica_Number : aadlinteger applies to ( system, process, thread, processor, device);
-- Min_Nbr_Replica: A constant that represents the minimal number of replica.
Min_Nbr_Replica : constant aadlinteger => 3 ;
-- Max_Nbr_Replica: A constant that represents the maximal number of replica.
Max_Nbr_Replica : constant aadlinteger => 7 ;
-- Identifiers of the different generated replica
Replica_Identifiers : list of aadlstring applies to (system, process, thread, processor, device);
--Replication type
-- Passive Replication: one replica has two behaviors (primary and backup behaviors)
-- Active Replication: all replica have the same behavior and there is a consensus algorithm to vote between them
Replication_Types: type enumeration (ACTIVE , PASSIVE);
Replica_Type : Replication_Properties::Replication_Types applies to (system, process, thread, processor, device);
-- the consensus algorithm source text
Consensus_Algorithm_Source_Text: aadlString applies to (port, data access, system, processor, device);
-- to refer to a subprogram or thread classifier
Consensus_Algorithm_Class : classifier (subprogram) applies to (port, data access, system, processor, device);
-- to refera subprogram or a thread instance
Consensus_Algorithm_Ref : reference (subprogram) applies to (port, data access, system, processor, device);
end Replication_Properties;
......@@ -28,6 +28,7 @@ AADL_V2_PROPERTIES = $(srcdir)/AADLv2/aadl_project.aadl \
$(srcdir)/AADLv2/pok_properties.aadl \
$(srcdir)/AADLv2/programming_properties.aadl \
$(srcdir)/AADLv2/base_types.aadl \
$(srcdir)/AADLv2/replication_properties.aadl \
$(srcdir)/AADLv2/errorlibrary.aadl \
$(srcdir)/AADLv2/taste_properties.aadl \
$(srcdir)/AADLv2/transformations.aadl
......
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.REPLICATION_EXPANDER --
-- --
-- S p e c --
-- --
-- Copyright (C) 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- --
-- 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) --
-- --
------------------------------------------------------------------------------
-- This package holds the replication tree expander which converts the
-- AADL replication property set into an expanded model with different
-- replicas.
with Ocarina.Backends.Replication_Properties;
use Ocarina.Backends.Replication_Properties;
package Ocarina.Backends.Replication_Expander is
type Replication_Info is record
Replicated_Component : Node_Id := No_Node;
Description : Name_Id := No_Name;
Number : Unsigned_Long_Long := 0;
Replication_Type : Replication_Types := Replication_None;
Identifiers : List_Id := No_List;
Consensus_Algo : Node_List;
end record;
procedure Expand_With_Replicas (Root : Node_Id);
-- Expands the AADL node E into another instance enriched with
-- replication Concepts. Its is based on model transformation
-- and analysis of the replication property set.
procedure Generate (AADL_Root : Types.Node_Id);
procedure Init;
end Ocarina.Backends.Replication_Expander;
This diff is collapsed.
------------------------------------------------------------------------------
-- --
-- OCARINA COMPONENTS --
-- --
-- OCARINA.BACKENDS.REPLICATION_PROPERTIES --
-- --
-- S p e c --
-- --
-- Copyright (C) 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- --
-- 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.Replication_Properties is
procedure Init;
-- Initialize some internal parts of the package
----------------------------
-- Replication_Properties --
----------------------------
type Replication_Types is
(Replication_Active,
Replication_Passive,
Replication_None); -- Unspecified
function Get_Replication_Description (C : Node_Id) return Name_Id;
-- Returns the value of the Description property.
function Get_Replication_Description
(Property_Node : Node_Id;
Applies_To_Node : Node_Id)
return String;
-- returns the value of the description property when its is
-- applied to the Applies_To_Node node.
function Get_Replication_Replica_Number
(Property_Node : Node_Id;
Applies_To_Node : Node_Id)
return Unsigned_Long_Long;
-- Returns the value of the Replica_Number property when its is
-- applied to the Applies_To_Node node.
function Get_Replication_Replica_Number (C : Node_Id)
return Unsigned_Long_Long;
-- Returns the value of the Replica_Number property.
function Get_Replication_Min_Nbr_Replica (C : Node_Id)
return Unsigned_Long_Long;
-- Returns the value of the Min_Nbr_Replica property.
function Get_Replication_Max_Nbr_Replica (C : Node_Id)
return Unsigned_Long_Long;
-- Returns the value of the Max_Nbr_Replica property.
function Get_Replication_Replica_Identifiers (C : Node_Id)
return List_Id;
-- Returns the value of the Replica_Identifiers property.
function Get_Replication_Replica_Identifiers
(Property_Node : Node_Id;
Applies_To_Node : Node_Id)
return List_Id;
-- Returns the value of the Replica_Identifiers property
-- when its is applied to the Applies_To_Node node.
function Get_Replication_Replica_Type (C : Node_Id)
return Replication_Types;
-- Returns the value of the Replica_Type property.
function Get_Replication_Replica_Type
(Property_Node : Node_Id;
Applies_To_Node : Node_Id)
return Replication_Types;
-- Returns the value of the Replica_Type property
-- when its is applied to the Applies_To_Node node
function Get_Replication_Consensus_Algorithm
(C : Node_Id;
In_Mode : Name_Id := No_Name)
return Name_Id;
-- Return the consensus algorithm of the given replicated component.
-- Return No_Name in case the property is not defined for the replicated
-- component.
-- If In_Mode is a valid mode name for the replicated component, return the
-- property association declared in the context of this mode.
procedure Get_Replication_Consensus_Algorithm
(Property_Node : Node_Id;
Consensus_Node_List : in out Node_List);
-- updates the consensus algorithm list of the given replicated component.
-- the list contains the diffrent types of the consensus algorithm
-- (source_Text, reference or classifier), the feature to each is applied
-- and the subprogram description.
function Get_Replication_Consensus_Algorithm
(C : Node_Id;
In_Mode : Name_Id := No_Name)
return Node_Id;
-- Same as above, but returns the whole property association
function Is_Defined_Consensus_Algorithm_Property
(C : Node_Id;
In_Mode : Name_Id := No_Name)
return Boolean;
-- Returns True IF the property describing the consensus algorithm
-- is defined for the replicated component.
end Ocarina.Backends.Replication_Properties;
......@@ -68,6 +68,7 @@ with Ocarina.Backends.XML_Values;
with Ocarina.Backends.XML_Tree.Nutils;
with Ocarina.Backends.BoundT;
with Ocarina.Backends.REAL;
with Ocarina.Backends.Replication_Expander;
with Ocarina.Backends.Xtratum_Conf;
with Ocarina.Backends.ASN1_Tree.Nodes;
with Ocarina.Backends.ASN1_Tree.Nutils;
......@@ -198,6 +199,7 @@ package body Ocarina.Backends is
REAL.Init;
ASN1.Init;
Cheddar.Init;
Replication_Expander.Init;
Connection_Matrix.Init;
Functions_Matrix.Init;
AADL_XML.Init;
......
......@@ -70,6 +70,7 @@ package Ocarina.Backends is
Xtratum_Configuration,
REAL_PP,
REAL_Theorem,
FT_Replication,
Alloy_Backend);
-- Supported code generators. For each kind, at most one generator
-- must be implemented.
......
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