------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real time scheduling analysis tool. -- This program provides services to automatically check performances -- of real time architectures. -- -- Copyright (C) 2002-2010, by Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- the LISyC Team, University of Western Britanny. -- -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- 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: 534 $ -- $Date: 2012-10-05 19:46:28 +0200 (Fri, 05 Oct 2012) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with unbounded_strings; use unbounded_strings; with Framework_Config; use Framework_Config; with Resource_Set; use Resource_Set; with Tasks; use Tasks; with Task_Groups; use Task_Groups; with Task_Set; use Task_Set; with Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.User_Defined_Parameters_Table_Package; with Offsets; use Offsets; with Offsets.extended; use Offsets.extended; use Offsets.Offsets_Table_Package; with Ada.Numerics.Aux; use Ada.Numerics.Aux; with Task_Dependencies; use Task_Dependencies; with sets; package Task_Group_Set is ---------------------------------------------------------- -- Definition of a task group set ---------------------------------------------------------- package Generic_Task_Group_Set is new Sets ( Max_Element => Framework_Config.Max_Tasks, -- TODO: Max_Task_Groups Element => Generic_Task_Group_Ptr, Copy => Copy, Free => Free, Put => Put, xml_string => XML_String, xml_ref_string => XML_ref_String); use Generic_Task_Group_Set; type Task_Groups_Set is new Generic_Task_Group_Set.set with private; subtype Task_Groups_Range is Generic_Task_Group_Set.element_range; subtype Task_Groups_Iterator is Generic_Task_Group_Set.iterator; ---------------------------------------------------------- -- Exceptions defined in the set package ---------------------------------------------------------- -- Raised when a given task group is not in the task group set Task_Group_Not_Found : exception; -- Raised when a task is not found in a group Task_Not_Present_In_Group : exception; ---------------------------------------------------------- -- Procedure to proceed modification on a set ---------------------------------------------------------- -- TODO: For Add_Task_Group, add all possible parameters and make some optional procedure Add_Task_Group (My_Task_Groups : in out Task_Groups_Set; Name : in Unbounded_String; Task_Group_Type : in Task_Groups_Type); procedure Add_Task_Group (My_Task_Groups : in out Task_Groups_Set; A_Task_Group : in out Generic_Task_Group_Ptr; Name : in Unbounded_String; Task_Group_Type : in Task_Groups_Type); procedure Add_Task_Group (My_Task_Groups : in out Task_Groups_Set; A_Task_Group : in Generic_Task_Group_Ptr); procedure Add_Task (My_Tasks : in out Tasks_Set; My_Task_Groups : in out Task_Groups_Set; Task_Group_Name : in Unbounded_String; Name : in Unbounded_String; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String; Task_Type : in Tasks_Type; Start_Time : in Integer; Capacity : in Integer; Period : in Integer; Deadline : in Integer; Jitter : in Integer; Blocking_Time : in Integer; Priority : in Integer; Criticality : in Integer; Policy : in Policies; Offset : in Offsets_Table := No_Offset; Stack_Memory_Size : in Integer := 0; Text_Memory_Size : in Integer := 0; Param : in User_Defined_Parameters_Table := No_User_Defined_Parameter; Parametric_Rule_Name : in Unbounded_String := empty_string; Seed_Value : in Integer := 0; Predictable : in Boolean := True; context_switch_overhead : in Integer := 0); procedure Add_Task_To_Group (My_Tasks : in out Tasks_Set; My_Task_Group : in out Generic_Task_Group_Ptr; Name : in Unbounded_String); procedure Add_Task_To_Group (My_Task_Group : in out Generic_Task_Group_Ptr; A_Task : in out Generic_Task_Ptr); procedure Check_Task (A_Task_Group : in Generic_Task_Group_Ptr; A_Task : in Generic_Task_Ptr); ------------------------------------------------------ -- Read information from a set ------------------------------------------------------ function Task_Group_Is_Present (My_Task_Groups : in Task_Groups_Set; Name : in Unbounded_String) return Boolean; function Task_Is_Present_In_Group (My_Task_Group : in Generic_Task_Group_Ptr; Name : in Unbounded_String) return Boolean; function Search_Task_Group_By_Task (My_Task_Groups : in Task_Groups_Set; Name : in Unbounded_String) return Generic_Task_Group_Ptr; function Search_Task_Group_By_Task (My_Task_Groups : in Task_Groups_Set; My_Task : in Generic_Task_Ptr) return Generic_Task_Group_Ptr; function Search_Task_Group (My_Task_Groups : in Task_Groups_Set; Name : in Unbounded_String) return Generic_Task_Group_Ptr; function Search_Task_Group_By_Id (My_Task_Groups : in Task_Groups_Set; id : in Unbounded_String) return Generic_Task_Group_Ptr; function Get_Multiframe_Period (A_Multiframe : in Multiframe_Task_Group_Ptr) return Integer; function Get_No_Deadlocks_Precedences_Number (My_Task_Groups : in Task_Groups_Set) return Integer; function Get_No_Deadlocks_Precedences_Number (My_Task_Groups : in Task_Groups_Set; Number_Groups : in Integer) return Integer; ------------------------------------------------------ -- Write information in a set ------------------------------------------------------ procedure Set_Multiframe_Period (A_Multiframe : in out Multiframe_Task_Group_Ptr); procedure Set_Multiframe_Precedences (My_Task_Groups : in Task_Groups_Set; My_Precedences : in out Tasks_Dependencies_Ptr); procedure Set_Multiframe_Precedences (A_Multiframe : in Multiframe_Task_Group_Ptr; My_Precedences : in out Tasks_Dependencies_Ptr); procedure Set_Interarrival (A_Frame_Task : in out Frame_Task_Ptr; A_Multiframe : in out Multiframe_Task_Group_Ptr; Interarrival : in Integer); procedure Set_Multiframe_Start_Times (A_Multiframe : in Multiframe_Task_Group_Ptr); private type Task_Groups_Set is new Generic_Task_Group_Set.set with null record; end Task_Group_Set;