with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; with GNAT.Os_Lib; with Objects; use Objects; with Memories; use Memories; use Memories.Memories_Table_Package; with Memory_set; use Memory_set; with Tasks; use Tasks; with Task_Set; use Task_Set; with Systems; use Systems; with Processors; use Processors; with Processor_Set; use Processor_Set; with Address_Spaces; use Address_Spaces; with Address_Space_Set; use Address_Space_Set; with Core_Units; use Core_Units; use Core_Units.Core_Units_Table_Package; with batteries; use batteries; with battery_set; use battery_set; with Processor_Interface; use Processor_Interface; with Scheduler_Interface; use Scheduler_Interface; with Random_Tools; use Random_Tools; with architecture_factory; use architecture_factory; with unbounded_strings; use unbounded_strings; with call_framework; use call_framework; with feasibility_test.feasibility_interval; use feasibility_test.feasibility_interval; with doubles; use doubles; with priority_assignment.rm; use priority_assignment.rm; procedure Generate_amc_multicore is sys : System; a_core : Core_Unit_Ptr; a_processor : Generic_Processor_Ptr; a_core_unit_table : Core_Units_Table; msg : Unbounded_String; Feasibility_Interval : Double; validate : Boolean; Actual_CPU_Usage : Float :=0.0; N_Tasks : Integer :=0; N_Different_Periods : Integer :=0; Target_Cpu_Usage : Float :=0.0; Threshold_Quality : Natural :=0; N_High_Tasks : Natural := 0; N_Medium_Tasks : Natural := 0; coef : coefficient; begin -- Initialize the System and the Cheddar framework -- Call_Framework.initialize (False); Initialize (sys); -- Parse command line if Argument_Count /= 8 then Put ("Usage: " & Command_Name & " "); Put_Line ("N_Tasks N_Different_Periods Target_CPU_Usage threshold N_High_Tasks N_Medium_Tasks Coefficient Filename"); GNAT.OS_Lib.OS_Exit (1); else N_Tasks := Natural'Value (Argument (1)); N_Different_Periods := Natural'Value (Argument (2)); Target_Cpu_Usage := Float'Value (Argument (3))/100.0; Threshold_Quality := Natural'Value (Argument (4)); N_High_Tasks := Natural'Value(Argument(5)); N_Medium_Tasks := Natural'Value(Argument(6)); coef := Natural'Value(Argument(7)); end if; -- Adding Cores, Processor and address_space -- Add_core_unit (sys.Core_units, a_core, to_unbounded_string("c1"), preemptive, 0, 1, 0, 0, 0, To_Unbounded_String (""), To_Unbounded_String (""), MIXED_CRITICALITY_AMC_PROTOCOL, no_memories, empty_string, empty_string, 0, Threshold_Quality); Add (a_core_unit_table, a_core); Add_core_unit (sys.Core_units, a_core, to_unbounded_string("c2"), preemptive, 0, 1, 0, 0, 0, To_Unbounded_String (""), To_Unbounded_String (""), MIXED_CRITICALITY_AMC_PROTOCOL, no_memories, empty_string, empty_string, 0, Threshold_Quality); Add (a_core_unit_table, a_core); Add_Processor (sys.Processors, To_Unbounded_String ("processor1"), A_Core_Unit_Table, No_Migration_Type); Add_Address_Space (sys.Address_Spaces, To_Unbounded_String ("addr1"), To_Unbounded_String ("processor1"), 0, 0, 0, 0); Create_Mixedcriticality_Independant_Periodic_Taskset_System (Sys, Actual_CPU_Usage, N_Tasks, Target_Cpu_Usage, 1.0,1.0, true, N_Different_Periods, N_High_Tasks, N_Medium_Tasks, coef, Sched_Fifo); set_priority_mixedcriticality_rm(sys.tasks, to_unbounded_string("processor1")); -- declare File_Name : String := Argument(8); begin write_to_xml_file (sys, File_Name); end; end Generate_amc_multicore;