------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 Framework_Config; use Framework_Config; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Buffers; use Buffers; with Queueing_Systems; use Queueing_Systems; use Buffers.Buffer_Roles_Package; with sets; package Buffer_Set is ---------------------------------------------------------- -- Definition of a set ---------------------------------------------------------- package Generic_Buffer_Set is new sets ( max_element => Framework_Config.Max_Buffers, element => Buffer_Ptr, free => Free, copy => Copy, put => Put, xml_string => XML_String, xml_ref_string => XML_Ref_String); use Generic_Buffer_Set; type Buffers_Set is new Generic_Buffer_Set.set with private; subtype Buffers_Range is Generic_Buffer_Set.element_range; subtype Buffers_Iterator is Generic_Buffer_Set.iterator; ---------------------------------------------------------- -- Exceptions defined in the set package ---------------------------------------------------------- -- Raised when a given buffer is not in a network set -- Buffer_Not_Found : exception; -- Raised when parameters provided to Add_buffer are wrong -- Invalid_Parameter : exception; ---------------------------------------------------------- -- I/O operations ---------------------------------------------------------- function Export_Aadl_Implementations (My_Buffers : in Buffers_Set) return Unbounded_String; ---------------------------------------------------------- -- Procedure to proceed modification on a set ---------------------------------------------------------- procedure Check_Buffer (My_Buffers : in Buffers_Set; Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String); procedure Add_Buffer (My_Buffers : in out Buffers_Set; A_Buffer : in out Buffer_Ptr; Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String; A_Qs : in Queueing_Systems_Type; Roles : in Buffer_Roles_Table; Initial_Data : in Integer := 0); procedure Add_Buffer (My_Buffers : in out Buffers_Set; Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String; A_Qs : in Queueing_Systems_Type; Roles : in Buffer_Roles_Table; Initial_Data : in Integer := 0); procedure Update_Buffer (My_Buffers : in out Buffers_Set; Name : in Unbounded_String; New_Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String; Roles : in Buffer_Roles_Table; Initial_Data : in Integer := 0); -- Search for buffers referencing an address space -- procedure Check_entity_referencing_Address_Space (My_buffers : in buffers_Set; A_Addr : in Unbounded_String); procedure Check_entity_referencing_processor (My_buffers : in buffers_Set; A_processor : in Unbounded_String); procedure Check_entity_referencing_task (My_buffers : in buffers_Set; A_task : in Unbounded_String); -- Delete all buffers located on the address space 'A_Addr' -- procedure Delete_Address_Space (My_Buffers : in out Buffers_Set; A_Addr : in Unbounded_String); -- Delete all buffers used by 'A_Task' -- procedure Delete_Task (My_Buffers : in out Buffers_Set; A_Task : in Unbounded_String); -- Delete all buffers located on the processor 'A_Processor' -- procedure Delete_Processor (My_Buffers : in out Buffers_Set; A_Processor : in Unbounded_String); ------------------------------------------------------ -- Read information from a set ------------------------------------------------------ function Search_Buffer (My_Buffers : in Buffers_Set; Name : in Unbounded_String) return Buffer_Ptr; function Search_Buffer_by_id (My_Buffers : in Buffers_Set; id : in Unbounded_String) return Buffer_Ptr; function Get_Number_Of_Buffer_From_Processor (My_Buffers : in Buffers_Set; Processor_Name : in Unbounded_String) return Buffers_Range; ---------------------------------------------------------- -- List of parameters the user can set of get directly -- throught the set ---------------------------------------------------------- type Buffer_Parameters is (Size, Cpu_Name, Address_Space_Name, Roles); function Get (My_Buffers : in Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters) return Unbounded_String; procedure Set (My_Buffers : in out Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters; Param_Value : in Unbounded_String); function Get (My_Buffers : in Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters) return Natural; procedure Set (My_Buffers : in out Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters; Param_Value : in Natural); private type Buffers_Set is new Generic_Buffer_Set.set with null record; end Buffer_Set;