with Systems; use Systems; with tasks; use tasks; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with dependencies; use dependencies; with task_dependencies; use task_dependencies; use task_dependencies.Half_Dep_Set; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; with Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; 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; with GNAT.Command_Line; with GNAT.OS_Lib; use GNAT.OS_Lib; with debug; use debug; with io_tools; use io_tools; with Text_IO; use Text_IO; with Version; use Version; with Ada.Exceptions; use Ada.Exceptions; with Ada.Numerics.Aux; use Ada.Numerics.Aux; 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 multi_int_util; use multi_int_util; with Multi_precision_integers; use Multi_precision_integers; with Multi_precision_integers_IO; use Multi_precision_integers_IO; with feasibility_test.feasibility_interval; use feasibility_test.feasibility_interval; procedure feasibility_interval is Sys : System; Tasks : Tasks_Set; Project_File_List : unbounded_string_list; Project_File_Dir_List : unbounded_string_list; Feasibility_Interval_Double : Double; Feasibility_Interval_Multi : multi_int_ptr; Validate : Boolean := False; -- Response_Table : Framework_Response_Table; -- Request_Table : Framework_Request_Table; -- -- A_Param : Parameter_Ptr; -- A_Reques : Framework_Request; Simulation_Interval_TXT : Unbounded_String; Verbose : Boolean := False; Input_File : Boolean := False; Input_File_Name : Unbounded_String; procedure Usage is begin Put_Line ("read_sys reads and displays to the screen a Cheddar architecture model ."); New_Line; Put_Line ("Check Cheddar home page for details : http://beru.univ-brest.fr/~singhoff/cheddar "); New_Line; New_Line; Put_Line ("Usage : feasibility_interval [switch] "); Put_Line (" switch can be :"); Put_Line (" -u get this help"); Put_Line (" -v verbose mode "); Put_Line (" -i file-name, read and print the architecture model from the XML file file-name "); New_Line; end Usage; procedure Print_Task_Set( my_tasks : Tasks_Set ) is a_task : Generic_Task_Ptr; my_iterator : Tasks_Iterator; begin Put_Line("Name" & ASCII.HT & "Pi" & ASCII.HT & "Ci" & ASCII.HT & "Ti" & ASCII.HT & "Di" & ASCII.HT & "Oi" & ASCII.HT & "STi"); reset_iterator(my_tasks, my_iterator); loop current_element (my_tasks, a_task, my_iterator); Put_Line(To_String(a_task.name) & ASCII.HT & a_task.priority'Img & ASCII.HT & a_task.capacity'Img & ASCII.HT & Periodic_Task_Ptr(a_task).period'Img & ASCII.HT & a_task.deadline'Img & ASCII.HT & a_task.offsets.Entries(0).offset_value'Img & ASCII.HT & a_task.start_time'Img); exit when is_last_element (my_tasks, my_iterator); next_element (my_tasks, my_iterator); end loop; Put_Line(""); end Print_Task_Set; begin Copyright ("feasibility_interval"); loop case GNAT.Command_Line.Getopt ("u v i:") is when ASCII.NUL => exit; when 'i' => Input_File := True; Input_File_Name := To_Unbounded_String (GNAT.Command_Line.Parameter); when 'v' => Verbose := True; when 'u' => Usage; OS_Exit (0); when others => Usage; OS_Exit (0); end case; end loop; if (not Input_File) then Usage; OS_Exit (0); end if; Call_Framework.initialize(False); Initialize (Sys); Systems.Read_From_Xml_File (Sys, Project_File_Dir_List, Input_File_Name); Tasks := Sys.Tasks; Print_Task_Set (Tasks); Calculate_Feasibility_Interval(Sys, Validate, Feasibility_Interval_Multi); Calculate_Feasibility_Interval_Top(Sys, Validate, Feasibility_Interval_Double); --Put_Line(Feasibility_Interval'Image); -- Initialize (Response_Table); -- Initialize (Request_Table); -- Initialize (A_Request); -- -- A_Request.statement := Scheduling_Feasibility_Basics; -- add (Request_Table, A_Request); -- Sequential_Framework_Request(Sys, Request_Table, Response_Table); -- -- Simulation_Interval_TXT := Response_Table.entries(0).text; -- Put_line(To_String (Simulation_Interval_TXT)); -- Compute_Feasibility_Period(Sys, -- (Sys : in System; -- Result : in out Unbounded_String; -- A_Processor : in Generic_Processor_Ptr; -- Output : in Output_Format := String_Output) Put_Line(Validate'Img & "::Interval in [0," & Str(Feasibility_Interval_Multi.all) & ")"); Put_Line(Validate'Img & "::Interval in [0," & Feasibility_Interval_Double'Img & ")"); end feasibility_interval;