------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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: 317 $ -- $Date: 2010-12-06 13:14:59 +0100 (lun., 06 déc. 2010) $ -- $Author: gaudel $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with Time_Unit_Events; use Time_Unit_Events; use Time_Unit_Events.Time_Unit_Lists_Package; use Time_Unit_Events.Time_Unit_Package; with Tasks.Extended; use Tasks.Extended; with Buffers; use Buffers; use Buffers.Buffer_Roles_package; with Event_Analyzer_Set; use Event_Analyzer_Set; use Event_Analyzer_Set.Generic_Event_Analyzer_Set; with Queueing_System; use Queueing_System; use Queueing_System.A_Resp_Time_Consumer; with Resource_Set; use Resource_Set; use Resource_Set.Generic_Resource_Set; with tables; with indexed_tables; with access_lists; with Unchecked_Deallocation; package Scheduling_Analysis.extended is -------------------------------------------------------- -------------------------------------------------------- -- Services to do analysis of scheduling sequences -------------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- -- Processor analysis -------------------------------------------------------- -- Compute number of task preemption -- function Number_Of_Preemption_From_Simulation (Sched : in Scheduling_Sequence_Ptr; My_Tasks : in Tasks_Set) return Natural; -- Compute number of switch context -- function Number_Of_Switch_Context_From_Simulation (Sched : in Scheduling_Sequence_Ptr) return Natural; -- Compute from a scheduling sequence buffer size for each -- time unit -- procedure Compute_Buffer_Size_From_Simulation (Sched : in Scheduling_Sequence_Ptr; My_Buff : in Buffer_Ptr; Buff : in out Buffer_Size_Table_Ptr); -- Compute, from a buffer_Size_Table, maximum and average -- performance criterion -- function Compute_Average_Buffer_Size_From_Simulation (Buff : in Buffer_Size_Table_Ptr) return Double; function Compute_Maximum_Buffer_Size_From_Simulation (Buff : in Buffer_Size_Table_Ptr) return Natural; function Compute_Maximum_Waiting_Time_From_Simulation (Buff : in Buffer_Size_Table_Ptr; Average_Consumer_Period : in Double) return Natural; function Compute_Average_Waiting_Time_From_Simulation (Buff : in Buffer_Size_Table_Ptr; Average_Consumer_Period : in Double) return Double; No_Performance_Criteria : exception; -- copy consumer response time from simulation of a scheduling -- in cheddar to a qs (example : MP1 criteria computation) -- procedure Consumer_Response_Time (Sched : in Scheduling_Sequence_Ptr; Consumer_Resp_Time : in out Resp_Time_Consumer_Table_Ptr; My_Consumer_Task : in Generic_Task_Ptr); package Generic_Index_Lst is new access_lists ( put => put, element => Double, element_ptr => double_ptr, free => double_util.free, copy => double_util.copy, xml_string => xml_string); use Generic_Index_Lst; -------------------------------------------------------- -- Task analysis (eg. response time from simulation) -------------------------------------------------------- -- Compute bound on response time from simulation -- procedure Response_Time_By_Simulation (My_Task : Generic_Task_Ptr; Sched : in Scheduling_Sequence_Ptr; Msg : in out Unbounded_String; Max : in out Natural; Min : in out Natural; Average : in out Double); -- Compute probability distribution of response time -- procedure Compute_Response_Time_Distribution (My_Tasks : in Tasks_Set; Sched : in Scheduling_Sequence_Ptr; Processor_Name : Unbounded_String; Result : in out Densities_Table); -- Compute the response time for each task activation -- package Task_Occurence_Table_Package is new tables ( Task_Occurence, Framework_Config.Max_Scheduling_Period, Put, XML_String, xml_ref_string); use Task_Occurence_Table_Package; subtype Task_Occurence_Table is Task_Occurence_Table_Package.table; subtype Task_Occurence_Range is Task_Occurence_Table_Package.table_range; type Task_Occurence_Table_Ptr is access Task_Occurence_Table; procedure Free is new Unchecked_Deallocation ( Task_Occurence_Table, Task_Occurence_Table_Ptr); procedure All_Response_Time_By_Simulation (My_Task : in Generic_Task_Ptr; Sched : in Scheduling_Sequence_Ptr; Result : in out Task_Occurence_Table_Ptr); ----------------------------------------------------------------------- -- Shared resource analysis (eg. blocking time from simulation) ----------------------------------------------------------------------- -- Compute blocking time from scheduling simulaion -- procedure Blocking_Time_From_Simulation (My_Task : in Generic_Task_Ptr; My_Resources : in Resources_Set; Sched : in Scheduling_Sequence_Ptr; Max : in out Natural; Min : in out Natural; Average : in out Double); -- Check if deadlocks on shared resources exist -- function Deadlock_From_Simulation (My_Tasks : in Tasks_Set; My_Resources : in Resources_Set; Processor_Name : in Unbounded_String; Sched : in Scheduling_Sequence_Ptr) return Deadlock_List; -- Check if priority inversions exist in a scheduling simulation -- function Priority_Inversion_From_Simulation (My_Tasks : in Tasks_Set; My_Resources : in Resources_Set; Processor_Name : in Unbounded_String; Sched : in Scheduling_Sequence_Ptr) return Priority_Inversion_List; end Scheduling_Analysis.extended;