------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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: 97 $ -- $Date: 2007-07-20 15:17:15 +0200 (Fri, 20 Jul 2007) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Text_IO; use Text_IO; with Processors; use Processors; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Unbounded_Strings; use Unbounded_Strings; use Unbounded_Strings.Strings_Table_Package; use Unbounded_Strings.Unbounded_String_List_Package; with Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with Systems; use Systems; with Framework; use Framework; with Call_Framework; use Call_Framework; with Call_Framework_interface; use Call_Framework_interface; use Call_Framework_interface.Framework_Response_Package; use Call_Framework_interface.Framework_Request_Package; with Call_Scheduling_Framework; use Call_Scheduling_Framework; with Multiprocessor_Services; use Multiprocessor_Services; with Multiprocessor_Services_interface; use Multiprocessor_Services_interface; use Multiprocessor_Services_interface.Scheduling_Result_Per_Processor_package; procedure Comprehensive_Call is procedure Call_Processor_Analysis (A_Sys : in out System; Name : in Unbounded_String) is Response_List : Framework_Response_Table; Request_List : Framework_Request_Table; A_Request : Framework_Request; A_Param : Parameter_ptr; begin Initialize (Response_List); Initialize (Request_List); Initialize (A_Request); A_Request.Target := Name; A_Request.Statement := Scheduling_Simulation_Preemption_Number; Add (Request_List, A_Request); Initialize (A_Request); A_Request.Target := Name; A_Request.Statement := Scheduling_Simulation_Context_Switch_Number; Add (Request_List, A_Request); Initialize (A_Request); A_Param := new Parameter (Boolean_Parameter); A_Param.Name := To_Unbounded_String ("worst_case"); A_Param.Boolean_value := True; Add (A_Request.Param, A_Param); A_Param := new Parameter (Boolean_Parameter); A_Param.Name := To_Unbounded_String ("best_case"); A_Param.Boolean_value := True; Add (A_Request.Param, A_Param); A_Param := new Parameter (Boolean_Parameter); A_Param.Name := To_Unbounded_String ("average_case"); A_Param.Boolean_value := True; Add (A_Request.Param, A_Param); A_Request.Target := Name; A_Request.Statement := Scheduling_Simulation_Response_Time; Add (Request_List, A_Request); Sequential_Framework_Request (A_Sys, Request_List, Response_List); Put_Line (To_String (Response_List.Entries (0).Title)); for J in 0 .. Response_List.Nb_Entries - 1 loop Put_Line (To_String (Response_List.Entries (J).Text)); end loop; end Call_Processor_Analysis; procedure Run_Event_Analyzer (A_Sys : in out System) is Response_List : Framework_Response_Table; Request_List : Framework_Request_Table; A_Request : Framework_Request; begin Initialize (Response_List); Initialize (Request_List); Initialize (A_Request); A_Request.Statement := Scheduling_Simulation_Run_Event_Handler; Add (Request_List, A_Request); Sequential_Framework_Request (A_Sys, Request_List, Response_List); Put_Line (To_String (Response_List.Entries (0).Title)); for J in 0 .. Response_List.Nb_Entries - 1 loop Put_Line (To_String (Response_List.Entries (J).Text)); end loop; end Run_Event_Analyzer; procedure Compute_Scheduling (A_Sys : in out System) is Response_List : Framework_Response_Table; Request_List : Framework_Request_Table; A_Request : Framework_Request; A_Param : Parameter_ptr; begin Initialize (Response_List); Initialize (Request_List); Initialize (A_Request); A_Request.Statement := Scheduling_Simulation_Time_Line; A_Param := new Parameter (Integer_Parameter); A_Param.Name := To_Unbounded_String ("period"); A_Param.Integer_value := 100; Add (A_Request.Param, A_Param); A_Param := new Parameter (Boolean_Parameter); A_Param.Name := To_Unbounded_String ("schedule_with_offsets"); A_Param.Boolean_value := True; Add (A_Request.Param, A_Param); A_Param := new Parameter (Boolean_Parameter); A_Param.Name := To_Unbounded_String ("schedule_with_precedencies"); A_Param.Boolean_value := True; Add (A_Request.Param, A_Param); A_Param := new Parameter (Boolean_Parameter); A_Param.Name := To_Unbounded_String ("schedule_with_resources"); A_Param.Boolean_value := True; Add (A_Request.Param, A_Param); A_Param := new Parameter (Integer_Parameter); A_Param.Name := To_Unbounded_String ("seed_value"); A_Param.Integer_value := 0; Add (A_Request.Param, A_Param); Add (Request_List, A_Request); Sequential_Framework_Request (A_Sys, Request_List, Response_List); Put_Line (To_String (Response_List.Entries (0).Title)); for J in 0 .. Response_List.Nb_Entries - 1 loop Put_Line (To_String (Response_List.Entries (J).Text)); end loop; end Compute_Scheduling; procedure Run_Basic_Feasibility_Tests (A_Sys : in out System) is Response_List : Framework_Response_Table; Request_List : Framework_Request_Table; A_Request : Framework_Request; begin Initialize (Response_List); Initialize (Request_List); Initialize (A_Request); A_Request.Statement := Scheduling_Feasibility_Basics; Add (Request_List, A_Request); Sequential_Framework_Request (A_Sys, Request_List, Response_List); Put_Line (To_String (Response_List.Entries (0).Title)); for J in 0 .. Response_List.Nb_Entries - 1 loop Put_Line (To_String (Response_List.Entries (J).Text)); end loop; end Run_Basic_Feasibility_Tests; Sys : System; Project_File_List : Unbounded_String_List; A_Processor : Generic_Processor_Ptr; My_Processor_Iterator : Processors_Iterator; Project_File_Dir_List : Unbounded_String_List; begin -- Initialize the Cheddar framework -- Call_Framework.initialize (False); -- Read project file -- Initialize (Project_File_List); Systems.Read_From_Xml_File (Sys, Project_File_Dir_List, To_Unbounded_String ("arinc653.xml")); -- Compute basic feasibility tests -- Run_Basic_Feasibility_Tests (Sys); -- Compute the scheduling -- Compute_Scheduling (Sys); -- Perform analysis on the computed scheduling for each processor -- Reset_Iterator (Sys.Processors, My_Processor_Iterator); loop Current_Element (Sys.Processors, A_Processor, My_Processor_Iterator); Call_Processor_Analysis (Sys, A_Processor.Name); exit when Is_Last_Element (Sys.Processors, My_Processor_Iterator); Next_Element (Sys.Processors, My_Processor_Iterator); end loop; -- Run event analyzer -- Run_Event_Analyzer (Sys); -- Export Event table into the event_table.xml file -- Write_To_Xml_File (Framework.Sched, Sys, To_Unbounded_String ("event_table.xml")); end Comprehensive_Call;