------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2016, Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR 6285 laboratory, Université de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in AUTHORS.txt and SPONSORS.txt -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program 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 -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ------------------------------------------------------------------------------ -- Last update : -- $Rev: 1249 $ -- $Date: 2014-08-28 07:02:15 +0200 (Fri, 28 Aug 2014) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Messages; use Messages; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Framework_Config; use Framework_Config; with Parameters; use Parameters; use Parameters.User_Defined_Parameters_Table_Package; with Parameters.extended; use Parameters.extended; with Offsets; use Offsets; use Offsets.Offsets_Table_Package; with sets; package Message_Set is ---------------------------------------------------------- -- Definition of a set ---------------------------------------------------------- package Generic_Message_Set is new Sets ( Max_Element => Framework_Config.Max_Messages, Element => Generic_Message_Ptr, Free => Free, Copy => Copy, Put => Put, xml_string => XML_String, xml_ref_string => XML_ref_String); use Generic_Message_Set; type Messages_Set is new Generic_Message_Set.set with private; subtype Messages_Range is Generic_Message_Set.element_range; subtype Messages_Iterator is Generic_Message_Set.iterator; ---------------------------------------------------------- -- Exceptions defined in the set package ---------------------------------------------------------- -- Raised when a given message is not in a message set -- Message_Not_Found : exception; -- Raised when parameters provided to Add_message are wrong -- Invalid_Parameter : exception; -- Raised if a message has a wrong type -- Message_Model_Error : exception; ---------------------------------------------------------- -- I/O operations ---------------------------------------------------------- function Export_Aadl_User_Defined_Properties (My_Messages : in Messages_Set) return Unbounded_String; function Export_Aadl_Implementations (My_Messages : in Messages_Set) return Unbounded_String; ---------------------------------------------------------- -- Procedure to proceed modification on a set ---------------------------------------------------------- procedure Check_Message (My_Messages : in Messages_Set; Name : in Unbounded_String; Size : in Natural; Period : in Natural; Deadline : in Natural; Jitter : in Natural; Param : in User_Defined_Parameters_Table := No_User_Defined_Parameter; Response_Time : in Natural; Communication_Time : in Natural); procedure Add_Message (My_Messages : in out Messages_Set; Name : in Unbounded_String; Size : in Natural; Period : in Natural; Deadline : in Natural; Jitter : in Natural; Param : in User_Defined_Parameters_Table := No_User_Defined_Parameter; Response_Time : in Natural; Communication_Time : in Natural); procedure Add_Message (My_Messages : in out Messages_Set; A_Message : in out Generic_Message_Ptr; Name : in Unbounded_String; Size : in Natural; Period : in Natural; Deadline : in Natural; Jitter : in Natural; Param : in User_Defined_Parameters_Table := No_User_Defined_Parameter; Response_Time : in Natural; Communication_Time : in Natural); procedure Update_Message (My_Messages : in out Messages_Set; Name : in Unbounded_String; New_Name : in Unbounded_String; Size : in Natural; Period : in Natural; Deadline : in Natural; Jitter : in Natural; Param : in User_Defined_Parameters_Table := No_User_Defined_Parameter; Response_Time : in Natural; Communication_Time : in Natural); ------------------------------------------------------ -- Read information from a set ------------------------------------------------------ procedure Get_Global_Message_Type (My_Messages : in Messages_Set; Has_Global_Type : out Boolean; Global_Type : out Messages_Type); function Search_Message (My_Messages : in Messages_Set; Name : in Unbounded_String) return Generic_Message_Ptr; function Search_Message_by_id (My_Messages : in Messages_Set; id : in Unbounded_String) return Generic_Message_Ptr; ---------------------------------------------------------- -- List of parameters the user can set of get directly -- throught the set ---------------------------------------------------------- type Message_Parameters is ( Size, Period, Deadline, Jitter, Response_Time, Communication_Time, Send_Time); function Get (My_Messages : in Messages_Set; Message_Name : in Unbounded_String; Param_Name : in Message_Parameters) return Natural; procedure Set (My_Messages : in out Messages_Set; Message_Name : in Unbounded_String; Param_Name : in Message_Parameters; Param_Value : in Natural); -------------------------------------------------------- -- Functions to proceed sort on a set -------------------------------------------------------- function Increasing_Deadline (Op1 : in Generic_Message_Ptr; Op2 : in Generic_Message_Ptr) return Boolean; function Decreasing_Deadline (Op1 : in Generic_Message_Ptr; Op2 : in Generic_Message_Ptr) return Boolean; function Increasing_Period (Op1 : in Generic_Message_Ptr; Op2 : in Generic_Message_Ptr) return Boolean; function Decreasing_Period (Op1 : in Generic_Message_Ptr; Op2 : in Generic_Message_Ptr) return Boolean; ---------------------------------------------------- -- Control sub-programs ---------------------------------------------------- function Have_Deadlines_Equal_Than_Periods (My_Messages : in Messages_Set) return Boolean; private type Messages_Set is new Generic_Message_Set.set with null record; end Message_Set;