------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 Tasks; use Tasks; with Task_Groups; use Task_Groups; with Systems; use Systems; with Resource_Set; use Resource_Set; with Framework_Config; use Framework_Config; with Processor_Interface; use Processor_Interface; 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 sets; with Ada.Numerics.Aux; use Ada.Numerics.Aux; with unbounded_strings; use unbounded_strings; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; With Processors; use Processors; ------------------------------------------------------------------------ -- Purpose: -- This package computes feasibility intervals for simulation. -- It encapsulates multiples algorithms which are designed to -- calculate various feasibility intervals depending on the -- considered system characteristics as well as providing -- the validity of the calculation. -- Effects: -- - The expected usage is: -- 1. Call Calculate_Feasibility_Interval to obtain the feasibility -- interval of the considered system in multi_int type(Big Integers) type. -- 2. Call Calculate_Feasibility_Interval_Top to obtain the -- feasibility interval of the considered system in Double type. -- - The others functions are supposed to be called within 1. and 2. -- -- -- By the past, this package was implemented with a big number unit. -- This implementation was unstable ... and actually, a Double is -- enought to handle this into Cheddar -- ---------------------------------------------------------- package feasibility_test.feasibility_interval is --------------------------------------------------------------------- -- Is_Fixed_Task_Scheduler -- Purpose: -- This function determine if the scheduler use a fixed-task -- scheduling algorithm. --------------------------------------------------------------------- function Is_Fixed_Task_Scheduler ( Scheduler_Type : in Schedulers_type ) return Boolean; --------------------------------------------------------------------- -- Is_Fixed_Job_Scheduler -- Purpose: -- This function determine if the scheduler use a fixed-job -- scheduling algorithm. --------------------------------------------------------------------- function Is_Fixed_Job_Scheduler ( Scheduler_Type : in Schedulers_type ) return Boolean; --------------------------------------------------------------------- -- Is_Work_Conserving_Scheduler -- Purpose: -- This function determine if the scheduler use a work-conserving -- scheduling algorithm. --------------------------------------------------------------------- function Is_Work_Conserving_Scheduler ( Scheduler_Type : in Schedulers_type ) return Boolean; --------------------------------------------------------------------- -- Max_Start_Time_Of_TaskSet -- Purpose: -- This function determine the hightest starting time of a task in -- the provided tasks set. --------------------------------------------------------------------- function Max_Start_Time_Of_TaskSet ( My_Tasks : in Tasks_Set ; processor_name : in unbounded_string ) return Natural; --------------------------------------------------------------------- -- Calculate_Feasibility_Interval_Top -- Purpose: -- This procedure calculate the feasibility interval of the system -- in Double type and provide a boolean information -- stating true if the feasibility interval can be used as -- schedulability proof else false. --------------------------------------------------------------------- procedure Calculate_Feasibility_Interval ( Sys : in System; A_Processor : in Generic_Processor_Ptr; Validate : out Boolean; Interval : out Double; Msg : out unbounded_string ); --------------------------------------------------------------------- -- Scheduling_Period_1997 -- Purpose: Calculation of simulation interval based on Goossens and -- Devillers paper from 1997 as well as 2006, 2011 and 2007 papers. -- *Used for independents and constrained tasks systems with: -- Uniprocessor with fixed-job priority. (1997) -- Uniform and Unrelated processors resp.(2006) and (2011) -- with Global fixed-task priority. -- *Identical processors with arbitrary deadlines, independent tasks -- with global fixed-task priority algorithm. (2007) -- The simulation interval of (2007) paper beeing slightly different, -- a boolean AddPeriod provide information for the calculation: -- If true, 2007 paper interval used else others. --------------------------------------------------------------------- function Scheduling_Period_1997 ( My_Tasks : in Tasks_Set; Processor_Name : in Unbounded_String; AddPeriod : in Boolean ) return Double; --------------------------------------------------------------------- -- Scheduling_Period_2012_2013 -- Purpose: Calculation of simulation interval based on Baro et al. (2012) -- and Nélis et al. (2013) papers. -- Used for identical processor with constrained deadlines and -- independent or simple precedencies tasks systems with any scheduling -- algorithm. --------------------------------------------------------------------- function Scheduling_Period_2012_2013 ( My_Tasks : in Tasks_Set; Processor_Name : in Unbounded_String ) return Double; --------------------------------------------------------------------- -- Scheduling_Period_2016 -- Purpose: Calculation of simulation interval based on Goossens -- and Grolleau, Cucu-Grosjean (2016) paper. -- Used for identical processor with structural constraint and arbitrary -- deadlines with any scheduling algorithm. --------------------------------------------------------------------- function Scheduling_Period_2016 ( My_Tasks : in Tasks_Set; Processor_Name : in Unbounded_String ) return Double; --------------------------------------------------------------------- -- Scheduling_Period_With_Offset -- Purpose: Calculation of simulation interval based on Leung and Merill -- (1980) and Goossens and Devillers (1999) papers. -- Used for monoprocessor with constrained deadlines, independent tasks -- and fixed-task priority schheduling algorithm. (1980) -- Used for monoprocessor with arbitrary deadlines, independent tasks and -- fixed-job priority scheduling algorithm. (1999) -- Extra: Modification of the already implemented function but improved -- with handling of big integers calculation. --------------------------------------------------------------------- function Scheduling_Period_With_Offset ( My_Tasks : in Tasks_Set; Processor_Name : in Unbounded_String ) return Double; ----------------------------------------------------------------------------- function Scheduling_Period ( My_Tasks : in Tasks_Set; Processor_Name : in Unbounded_String ) return Natural; function Scheduling_Period ( My_Tasks : in Tasks_Set; Processor_Name : in Unbounded_String ) return Double; end feasibility_test.feasibility_interval;