with Text_IO; use Text_IO; with Ada.Text_IO, Ada.Integer_Text_IO; use Ada.Text_IO, Ada.Integer_Text_IO; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Ada.Text_IO.Unbounded_IO; use Ada.Text_IO.Unbounded_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Systems; use Systems; with Caches; use Caches; with Cache_Set; use Cache_Set; with CFG_Nodes; use CFG_Nodes.CFG_Nodes_Table_Package; with CFG_Nodes; use CFG_Nodes; with CFG_Nodes_Builder; use CFG_Nodes_Builder; with initialize_framework; use initialize_framework; with CFG_Set; use CFG_Set; with CFG_Edges; use CFG_Edges; with CFG_Node_Set; use CFG_Node_Set; with CFG_Edge_Set; use CFG_Edge_Set; with unbounded_strings; use unbounded_strings; with unbounded_strings; use unbounded_strings.strings_table_package; with unbounded_strings; use unbounded_strings.unbounded_string_list_package; with Call_Framework; use Call_Framework; with Integer_Arrays; use Integer_Arrays; with Basic_Block_Analysis; use Basic_Block_Analysis; with CFGs; use CFGs; with CFG_Node_Set.Basic_Block_Set; use CFG_Node_Set.Basic_Block_Set; with Basic_Blocks; use Basic_Blocks; with CFG_Nodes.Extended; use CFG_Nodes.Extended; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Call_Cache_Framework; use Call_Cache_Framework; with Processor_Set; use Processor_Set; with Scheduler_Interface; use Scheduler_Interface; with Core_Units; use Core_Units; with Address_Space_Set; use Address_Space_Set; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with GNAT.Current_Exception; use GNAT.Current_Exception; with Text_IO; use Text_IO; 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 unbounded_strings; use unbounded_strings; with Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; 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; with 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 Version; use Version; with Ada.Exceptions; use Ada.Exceptions; with Time_Unit_Events; use Time_Unit_Events; with Ada.Text_IO.Unbounded_IO; use Ada.Text_IO.Unbounded_IO; with architecture_models; use architecture_models; with Ada.Directories; use Ada.Directories; with Scheduler; use Scheduler; with architecture_factory; use architecture_factory; with Debug; use Debug; with Scheduler.Fixed_Priority.Rm; use Scheduler.Fixed_Priority.Rm; with Scheduler.Dynamic_Priority.Edf; use Scheduler.Dynamic_Priority.Edf; with Scheduler.Fixed_Priority.Hpf; use Scheduler.Fixed_Priority.Hpf; with Framework_Config; use Framework_Config; with Ada.Calendar; use Ada.Calendar; with Ada.Calendar.Formatting; use Ada.Calendar.Formatting; with Cache_Utility; use Cache_Utility; with Ada.Numerics; with Ada.Numerics.Elementary_Functions; with Ada.Numerics.Float_Random; with Caches; use Caches.Cache_Blocks_Table_Package; with Cache_Block_Set; use Cache_Block_Set; with Scheduling_Analysis; use Scheduling_Analysis; with Cache_Access_Profile_Set; use Cache_Access_Profile_Set; with Time_Unit_Events; use Time_Unit_Events.Time_Unit_Package; with test_case_generator; use test_case_generator; with scheduling_simulation_test; use scheduling_simulation_test; with Message_Set; use Message_Set; with Feasibility_Test; use Feasibility_Test; with feasibility_test.periodic_task_worst_case_response_time_fixed_priority; use feasibility_test.periodic_task_worst_case_response_time_fixed_priority; with Scheduling_Analysis; use Scheduling_Analysis.Double_Tasks_Parameters_Package; package body wcrt_crpd_test is procedure Test_WCRT_CRPD is my_scheduler : Hpf_Scheduler; my_tasks : Tasks_Set; processor_name : Unbounded_String; msg : Unbounded_String; --response_time : Response_Time_Table; CRPD_Computation_Approach : CRPD_Computation_Approach_Type := UCB_ECB_Union_Multiset; Block_Reload_Time : Natural := 1; My_CAPs : Cache_Access_Profiles_Set; cap_1 : Cache_Access_Profile_Ptr; cap_2 : Cache_Access_Profile_Ptr; cap_3 : Cache_Access_Profile_Ptr; a_cache_block : Cache_Block_Ptr; a_cache_block_tbl : Cache_Blocks_Table; response_time : Response_Time_Table; begin Set_Initialize; for i in 0..3 loop a_cache_block := new Cache_Block; a_cache_block.cache_block_number := i+1; Add(a_cache_block_tbl,a_cache_block); end loop; cap_1 := new Cache_Access_Profile; cap_1.name := To_Unbounded_String("CAP_1"); Add(cap_1.ECBs, a_cache_block_tbl.Entries(0)); Add(cap_1.ECBs, a_cache_block_tbl.Entries(1)); Add(cap_1.ECBs, a_cache_block_tbl.Entries(2)); cap_2 := new Cache_Access_Profile; cap_2.name := To_Unbounded_String("CAP_2"); Add(cap_2.UCBs, a_cache_block_tbl.Entries(2)); -- Add(cap_2.ECBs, a_cache_block_tbl.Entries(2)); Add(cap_2.ECBs, a_cache_block_tbl.Entries(3)); cap_3 := new Cache_Access_Profile; cap_3.name := To_Unbounded_String("CAP_3"); Add(cap_3.UCBs, a_cache_block_tbl.Entries(0)); Add(cap_3.UCBs, a_cache_block_tbl.Entries(1)); Add(cap_3.UCBs, a_cache_block_tbl.Entries(2)); Add(cap_3.UCBs, a_cache_block_tbl.Entries(3)); -- Add(cap_3.ECBs, a_cache_block_tbl.Entries(0)); Add(cap_3.ECBs, a_cache_block_tbl.Entries(1)); Add(cap_3.ECBs, a_cache_block_tbl.Entries(2)); Add(cap_3.ECBs, a_cache_block_tbl.Entries(3)); Add(My_CAPs,cap_1); Add(My_CAPs,cap_2); Add(My_CAPs,cap_3); Add_Task(My_Tasks => my_tasks, Name => To_Unbounded_String("Task_1"), Cpu_Name => To_Unbounded_String("CPU_A"), Address_Space_Name => To_Unbounded_String("ADDR_A"), Task_Type => Periodic_Type, Start_Time => 0, Capacity => 1, Period => 40, Deadline => 40, Jitter => 0, Blocking_Time => 0, Priority => 3, Criticality => 0, Policy => Sched_Fifo, Cache_Access_Profile_Name => To_Unbounded_String("CAP_1")); Add_Task(My_Tasks => my_tasks, Name => To_Unbounded_String("Task_2"), Cpu_Name => To_Unbounded_String("CPU_A"), Address_Space_Name => To_Unbounded_String("ADDR_A"), Task_Type => Periodic_Type, Start_Time => 0, Capacity => 2, Period => 40, Deadline => 40, Jitter => 0, Blocking_Time => 0, Priority => 2, Criticality => 0, Policy => Sched_Fifo, Cache_Access_Profile_Name => To_Unbounded_String("CAP_2")); Add_Task(My_Tasks => my_tasks, Name => To_Unbounded_String("Task_3"), Cpu_Name => To_Unbounded_String("CPU_A"), Address_Space_Name => To_Unbounded_String("ADDR_A"), Task_Type => Periodic_Type, Start_Time => 0, Capacity => 2, Period => 40, Deadline => 40, Jitter => 0, Blocking_Time => 0, Priority => 1, Criticality => 0, Policy => Sched_Fifo, Cache_Access_Profile_Name => To_Unbounded_String("CAP_3")); periodic_task_worst_case_response_time_fixed_priority.Compute_Response_Time (My_Scheduler => my_scheduler, My_Tasks => my_tasks, Processor_Name => To_Unbounded_String("CPU_A"), Msg => msg, Response_Time => response_time, With_CRPD => True, CRPD_Computation_Approach => CRPD_Computation_Approach, Block_Reload_Time => Block_Reload_Time, My_Cache_Access_Profiles => My_CAPs); for i in 0..Response_Time.nb_entries-1 loop Put_Line(Integer(Response_Time.entries(i).data)'Img); end loop; end Test_WCRT_CRPD; procedure Test_Multiset_Intersection is arr_a : Integer_Array; arr_b : Integer_Array; arr_c : Integer_Array; begin Initialize(arr_a,"1,2,1,2,1,2,2,3,4",","); Initialize(arr_b,"1,2,3,4,1,2,3,4,1,2,3,4",","); Print(arr_a); Print(arr_b); arr_c := Multiset_Intersection(arr_a,arr_b); Print(arr_c); end Test_Multiset_Intersection; end wcrt_crpd_test;