------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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: 260 $ -- $Date: 2009-11-16 22:43:09 +0100 (lun. 16 nov. 2009) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with applicability_constraint.all_tasks_are_periodic; use applicability_constraint.all_tasks_are_periodic; with applicability_constraint.all_tasks_are_periodic_or_sporadic; use applicability_constraint.all_tasks_are_periodic_or_sporadic; with applicability_constraint.no_shared_cpu; use applicability_constraint.no_shared_cpu; with applicability_constraint.allowed_protocol; use applicability_constraint.allowed_protocol; with applicability_constraint.Pip_No_Deadlock; use applicability_constraint.Pip_No_Deadlock; with applicability_constraint.No_Buffer; use applicability_constraint.No_Buffer; with applicability_constraint.No_Dependencies; use applicability_constraint.No_Dependencies; with applicability_constraint.Ceiling_priority_assignment; use applicability_constraint.Ceiling_priority_assignment; with applicability_constraint.at_least_one_data; use applicability_constraint.at_least_one_data; with applicability_constraint.no_shared_resources; use applicability_constraint.no_shared_resources; with applicability_constraint.data_sharing_protocol; use applicability_constraint.data_sharing_protocol; with applicability_constraint.data_connectivity; use applicability_constraint.data_connectivity; with applicability_constraint.Unsimultaneous_Release_Time_constraint; use applicability_constraint.Unsimultaneous_Release_Time_constraint; with applicability_constraint.Simultaneous_Release_Time_constraint; use applicability_constraint.Simultaneous_Release_Time_constraint; with applicability_constraint.Period_Equal_Deadline_Constraint; use applicability_constraint.Period_Equal_Deadline_Constraint; with applicability_constraint.Period_Smaller_Than_Deadline_Constraint; use applicability_constraint.Period_Smaller_Than_Deadline_Constraint; with applicability_constraint.Period_Larger_Than_Deadline_Constraint; use applicability_constraint.Period_Larger_Than_Deadline_Constraint; with feasibility_tests_for_time_triggered_communication; use feasibility_tests_for_time_triggered_communication; with applicability_constraints_main_structure; use applicability_constraints_main_structure; with feasibility_tests_main_structure_factory; use feasibility_tests_main_structure_factory; with generic_graph; use generic_graph; with dependencies; use dependencies; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with GNAT.Current_Exception; use GNAT.Current_Exception; with Unbounded_Strings; use Unbounded_Strings; with GNAT.Command_Line; use GNAT.Command_Line; with GNAT.OS_Lib; use GNAT.OS_Lib; with Text_IO; use Text_IO; with Version; use Version; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Systems; use Systems; with Task_Set; use Task_Set; with Task_Dependencies; use Task_Dependencies; use task_dependencies.Half_Dep_Set; with Processor_Set; use Processor_Set; with Address_Space_Set; use Address_Space_Set; with Resource_Set; use Resource_Set; with Buffer_Set; use Buffer_Set; with Network_Set; use Network_Set; with Event_Analyzer_Set; use Event_Analyzer_Set; with Message_Set; use Message_Set; with Call_Framework; use Call_Framework; with tasks; use tasks; use Task_set.generic_task_set; with debug; use debug; with generic_graph; use generic_graph; use generic_graph.edge_lists_package; use generic_graph.node_lists_package; with DP_Graph; use DP_Graph; with DP_Graph_View; use DP_Graph_View; use DP_Graph_View.Graph_List_Package; with architecture_factory; use architecture_factory; with architecture_analyzer; use architecture_analyzer; procedure Dp is dir : Unbounded_String_List; Sys : System; FT : unbounded_string; result : boolean := true; ACS : All_Cases_Structure; G : Graph; G2 : Graph; G3 : Graph; G_List : Graph_List; --temporary G_Iterator : Graph_List_Iterator; iter : integer; iter2: integer; manual : integer; filename : unbounded_string; begin Call_Framework.initialize (False); filename := to_unbounded_string("mars_pathfinder"); manual := 0; iter := 50 +50*manual; iter2 := 1+manual; --loop Initialize (Sys); --Create_ravenscar_System(Sys,iter,iter/2,0,0,1,1,0,1); --Add_Aperiodic_Task_To_System (Sys,suppress_space(to_unbounded_string("Task_Aperiodic")),get_random_element(Sys.Processors).Name,get_random_element(Sys.Address_spaces).Name); -- write_to_AADL_file(Sys, suppress_space(to_unbounded_string("../../../framework/dp/tests_generated/"&to_string(filename)&iter2'IMG&".aadl"))); Read_From_Xml_File (Sys, dir, "../../../framework/dp/tests_xml/mars_pathfinder.xml"); Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("distribution_donnees")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("tache_pilotage")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("tache_mesures")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("tache_meteo")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); FT := analyze(Sys); put_line(to_string(FT)); --write_result_to_file (FT,suppress_space(to_unbounded_string("../../../framework/dp/tests_generated/"&to_string(filename)&iter2'IMG&".txt"))); iter := iter + 50; iter2 := iter2+1; Initialize (Sys); put("Number of resources"); put_line(get_number_of_elements(Sys.resources)'IMG); put("Number of dependencies"); put_line(get_number_of_elements(Sys.dependencies.depends)'IMG); put("Number of tasks"); put_line(get_number_of_elements(Sys.tasks)'IMG); --exit when (iter >=1050); --end loop; -- --write_to_AADL_file(Sys, to_unbounded_string("../../../framework/dp/tests_xml/mars_pathfinder.aadl")); -- Adding Dependencies manually -- --SDF --Add_One_Task_Dependency(Sys.Dependencies,Search_Task(Sys.Tasks,to_Unbounded_String("T3")),Search_Task(Sys.Tasks,to_Unbounded_String("T2")),Sampled_Timing); --Add_One_Task_Dependency(Sys.Dependencies,Search_Task(Sys.Tasks,to_Unbounded_String("T2")),Search_Task(Sys.Tasks,to_Unbounded_String("T1")),Sampled_Timing); --Add_One_Task_Dependency(Sys.Dependencies,Search_Task(Sys.Tasks,to_Unbounded_String("T4")),Search_Task(Sys.Tasks,to_Unbounded_String("T5")),Sampled_Timing); --Add_One_Task_Dependency(Sys.Dependencies,Search_Task(Sys.Tasks,to_Unbounded_String("T4")),Search_Task(Sys.Tasks,to_Unbounded_String("T1")),Sampled_Timing); --Ravenscar --Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("distribution_donnees")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); --Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("tache_pilotage")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); --Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("tache_mesures")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); --Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("tache_meteo")), Search_Resource(Sys.Resources,to_Unbounded_String("tampon_donnees"))); -- Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("T5")), Search_Resource(Sys.Resources,to_Unbounded_String("R1"))); -- Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("T3")), Search_Resource(Sys.Resources,to_Unbounded_String("R2"))); -- Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("T2")), Search_Resource(Sys.Resources,to_Unbounded_String("R2"))); -- Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("T1")), Search_Resource(Sys.Resources,to_Unbounded_String("R2"))); -- Add_All_Task_Dependency (Sys.Dependencies, Search_Task(Sys.Tasks,to_Unbounded_String("T4")), Search_Resource(Sys.Resources,to_Unbounded_String("R2"))); --Add_One_Task_Dependency(Sys.Dependencies,Search_Task(Sys.Tasks,to_Unbounded_String("T3")),Search_Buffer(Sys.Buffers,to_Unbounded_String("B1")),From_Task_to_Object); --Add_One_Task_Dependency(Sys.Dependencies,Search_Task(Sys.Tasks,to_Unbounded_String("T4")),Search_Buffer(Sys.Buffers,to_Unbounded_String("B1")),From_Object_to_Task); --Add_One_Task_Dependency(Sys.Dependencies,Search_Task(Sys.Tasks,to_Unbounded_String("T1")),Search_Buffer(Sys.Buffers,to_Unbounded_String("B1")),From_Object_to_Task); -- Step 1 Graph building -- exception when GNAT.Command_Line.Invalid_Switch => begin Put_Line ("dp.adb : invalid Switch " & Full_Switch); end; when GNAT.Command_Line.Invalid_Parameter => Put_Line ("dp.adb : missing parameter for switch " & Full_Switch); when Task_Set.Invalid_Parameter => Put_Line ("dp.adb : invalid task argument ; " & Exception_Message); when Address_Space_Set.Invalid_Parameter => Put_Line ("dp.adb : invalid addresss space argument ; " & Exception_Message); when Processor_Set.Invalid_Parameter => Put_Line ("dp.adb : invalid processor argument ; " & Exception_Message); when Buffer_Set.Invalid_Parameter => Put_Line ("dp.adb : invalid buffer argument ; " & Exception_Message); when Resource_Set.Invalid_Parameter => Put_Line ("dp.adb : invalid resource argument ; " & Exception_Message); when Ada.IO_Exceptions.Name_Error => Put_Line ("dp.adb : Can not open project files, Name_Error"); when Ada.IO_Exceptions.Status_Error => Put_Line ("dp.adb : Can not open project files, Status_Error"); when Ada.IO_Exceptions.Mode_Error => Put_Line ("dp.adb : Can not open project files, Mode_Error"); when Ada.IO_Exceptions.Use_Error => Put_Line ("dp.adb : Can not open project files, Use_Error"); when Ada.IO_Exceptions.Device_Error => Put_Line ("dp.adb : Can not open project files, Device_Error"); when Ada.IO_Exceptions.End_Error => Put_Line ("dp.adb : Can not open project files, End_Error"); when Ada.IO_Exceptions.Data_Error => Put_Line ("dp.adb : Can not open project files, Data_Error"); when Ada.IO_Exceptions.Layout_Error => Put_Line ("dp.adb : Can not open project files, Layout_Error"); when others => Put_Line ("This is an internal dp bug ... sorry"); Put_Line ("Exception name : " & Exception_Name); Put_Line ("Exception message : " & Exception_Message); Put_Line ("Please, send a bug report to cheddar@listes.univ-brest.fr"); Put_Line( "Do not forget to join the XML Cheddar project files with your bug report"); end Dp;