with audsley_opa_test; use audsley_opa_test; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Calendar; use Ada.Calendar; with Ada.Calendar.Formatting; use Ada.Calendar.Formatting; with Ada.Directories; use Ada.Directories; with Ada.Text_IO; use Ada.Text_IO; with Systems; use Systems; with GNAT.Command_Line; with GNAT.OS_Lib; use GNAT.OS_Lib; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Ada.IO_Exceptions; with audsley_opa_crpd_test; use audsley_opa_crpd_test; with cache_analysis_test; use cache_analysis_test; with scheduling_simulation_test; use scheduling_simulation_test; with feasibility_interval_test; use feasibility_interval_test; with wcrt_crpd_test; use wcrt_crpd_test; with Framework_Config; use Framework_Config; procedure call_test_cache is --Configuration for the task generator-------- number_of_task : Integer := 5; processor_utilization : Float := 0.70; cache_utilization : Float := 2.0; reuse_factor : Float := 0.3; cache_size : Integer := 8; ---------------------------------------------- --Configuration for the scheduling simulator-- default_Period : Integer := 1000000; ---------------------------------------------- H : Integer := 0; Time_And_Date : TIME; filename : Unbounded_String; sys : System; ---------------------------------------------- PU_String : Unbounded_String; RF_String : Unbounded_String; SP_String : Unbounded_String; NT_String : Unbounded_String; exp_dir : STRING := "framework_examples/cache_analysis_examples/xml/"; ---------------------------------------------- test_mode : Character := 'A'; begin loop case GNAT.Command_Line.Getopt ("u: n: c: t: h: d:") is when ASCII.NUL => exit; when 'u' => Put_Line("Processor Utilization: " & GNAT.Command_Line.Parameter); PU_String := To_Unbounded_String (GNAT.Command_Line.Parameter); processor_utilization := (Float'Value(To_String(PU_String))/100.0); when 'n' => Put_Line("Number of tasks: " & GNAT.Command_Line.Parameter); NT_String := To_Unbounded_String (GNAT.Command_Line.Parameter); number_of_task := Integer'Value(GNAT.Command_Line.Parameter); when 'c' => Put_Line("Cache reuse factor: " & GNAT.Command_Line.Parameter); RF_String := To_Unbounded_String (GNAT.Command_Line.Parameter); reuse_factor := (Float'Value(To_String(RF_String))/100.0); when 'h' => Put_Line("Scheduling period: " & GNAT.Command_Line.Parameter); SP_String := To_Unbounded_String (GNAT.Command_Line.Parameter); default_Period := Integer'Value(To_String(SP_String)); when 't' => Put_Line("Test mode: " & GNAT.Command_Line.Parameter); test_mode := GNAT.Command_Line.Parameter(1); when 'd' => Put_Line("Debug Level: " & GNAT.Command_Line.Parameter); Cheddar_Debug := No_Debug; when others => OS_Exit(0); end case; end loop; if(test_mode = 'A') then Set_Directory(exp_dir); test_cache_aware_scheduling_simulator_with_case_study; elsif(test_mode = 'B') then begin Set_Directory(exp_dir & To_String(PU_String) & "/"); exception when Ada.IO_Exceptions.Name_Error => Set_Directory(exp_dir); Create_Directory(New_Directory => To_String(PU_String)); Set_Directory(exp_dir & To_String(PU_String) & "/"); end; Time_And_Date := Clock; filename := To_Unbounded_String(Image(Date => Time_And_Date)); test_feasibility_interval(file_name => filename, N => number_of_task, PU => processor_utilization, CU => cache_utilization, CS => cache_size, RF => reuse_factor); elsif(test_mode = 'C') then Test_WCRT_CRPD; elsif(test_mode = 'D') then Test_Multiset_Intersection; end if; end call_test_cache;