------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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: 97 $ -- $Date: 2007-07-20 15:17:15 +0200 (Fri, 20 Jul 2007) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Numerics.Aux; use Ada.Numerics.Aux; with Text_IO; use Text_IO; with Framework_Config; use Framework_Config; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; 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 Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; with Scheduler_Interface; use Scheduler_Interface; with Processor_Set; use Processor_Set; use Processor_Set.Generic_Processor_Set; with Processors; use Processors; with processor_interface; use processor_interface; with Caches; use Caches; use Caches.Caches_Table_Package; use Processors.Core_Units_Table_Package; with Address_Space_Set; use Address_Space_Set; use Address_Space_Set.Generic_Address_Space_Set; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with Offsets; use Offsets; with Systems; use Systems; 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 framework; use framework; 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 Feasibility_Test.Wort_Case_Response_Time; use Feasibility_Test.Wort_Case_Response_Time; with Scheduling_Analysis; use Scheduling_Analysis; with GNAT.Command_Line; with GNAT.OS_Lib; use GNAT.OS_Lib; with Version; use Version; with Ada.Exceptions; use Ada.Exceptions; with Task_Groups; use Task_Groups; with Task_Group_Set; use Task_Group_Set; with Tasks; use Tasks; with Task_Dependencies; use Task_Dependencies; with Architecture_Factory; use Architecture_Factory; with Task_Group_Transformation; use Task_Group_Transformation; with Comprehensive_Call; with Initialize_Framework; use initialize_framework; procedure WCDOPSP_Test is --Sys_Multiframe : System; Sys_Transaction : System; A_core1 : Core_Unit_Ptr; Cores1 : Core_Units_Table; A_core2 : Core_Unit_Ptr; Cores2 : Core_Units_Table; Response_Times : Response_Time_Table; New_Offset : Offset_Type_Ptr; New_Offset_Table : Offsets_Table_Ptr; O_12 : Integer; O_13 : Integer; O_14 : Integer; O_15 : Integer; O_16 : Integer; O_17 : Integer; O_18 : Integer; O_19 : Integer; O_110 : Integer; C_11 : Integer; C_12 : Integer; C_13 : Integer; C_14 : Integer; C_15 : Integer; C_16 : Integer; C_17 : Integer; C_18 : Integer; C_19 : Integer; C_110 : Integer; T_1 : Integer; use Double_Tasks_Parameters_Package; begin Set_Initialize; -- Platform entities initialize(Sys_Transaction); Add_core_unit(Sys_Transaction.core_units, a_core1, to_unbounded_string("core1"), preemptive, 100, 1.0, 101, 102, 103, to_unbounded_string(""), Posix_1003_Highest_Priority_First_Protocol); add(Cores1, a_core1); Add_core_unit(Sys_Transaction.core_units, a_core2, to_unbounded_string("core2"), preemptive, 100, 1.0, 101, 102, 103, to_unbounded_string(""), Posix_1003_Highest_Priority_First_Protocol); add(Cores2, a_core2); add_processor(Sys_Transaction.processors, to_unbounded_string("cpu1"), to_unbounded_string("a_network"), Cores1); Add_Address_Space(Sys_Transaction.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("cpu1"), 0, 0, 0, 0); add_processor(Sys_Transaction.processors, to_unbounded_string("cpu2"), to_unbounded_string("a_network"), Cores2); Add_Address_Space(Sys_Transaction.address_spaces, to_unbounded_string("addr2"), to_unbounded_string("cpu2"), 0, 0, 0, 0); -- Task Groups Add_Task_Group (Sys_Transaction.Task_Groups, To_Unbounded_String("G1"), Transaction_Type); Add_Task_Group (Sys_Transaction.Task_Groups, To_Unbounded_String("G2"), Transaction_Type); Add_Task_Group (Sys_Transaction.Task_Groups, To_Unbounded_String("G3"), Transaction_Type); -- Tasks C_11 := 1; C_12 := 1; C_13 := 1; C_14 := 1; C_15 := 1; C_16 := 1; C_17 := 1; C_18 := 1; C_19 := 1; C_110 := 1; O_12 := C_11; O_13 := O_12 + C_12 +1; O_14 := C_11; O_15 := O_14 + C_14; O_16 := O_15 + C_15; O_17 := O_16 + C_16; O_18 := O_16 + C_16; O_19 := O_15 + C_15; O_110 := O_15 + C_15 + 1; T_1 := 6; Add_Task (Sys_Transaction.Tasks, Sys_Transaction.Task_Groups, To_Unbounded_String("G1"), To_Unbounded_String("tau_11"), to_unbounded_string("cpu2"), to_unbounded_string("addr2"), Periodic_Type, 0, -- start_time C_11, -- capacity T_1, -- period 99999, -- deadline 0, -- jitter 0, -- blocking 1, -- priority 0, -- criticality SCHED_FIFO); New_Offset := new Offset_Type; New_Offset.offset_value := O_12; New_Offset.activation := 0; New_Offset_Table := new Offsets_Table; Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); Task_Group_Set.Add_Task (Sys_Transaction.Tasks, Sys_Transaction.Task_Groups, To_Unbounded_String("G1"), To_Unbounded_String("tau_12"), to_unbounded_string("cpu1"), to_unbounded_string("addr1"), Periodic_Type, 0, -- start_time C_12, -- capacity T_1, -- period 99999, -- deadline 0, -- jitter 0, -- blocking 2, -- priority 0, -- criticality SCHED_FIFO, New_Offset_Table.all); New_Offset := new Offset_Type; New_Offset.offset_value := O_13; New_Offset.activation := 0; New_Offset_Table := new Offsets_Table; Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); Task_Group_Set.Add_Task (Sys_Transaction.Tasks, Sys_Transaction.Task_Groups, To_Unbounded_String("G1"), To_Unbounded_String("tau_13"), to_unbounded_string("cpu1"), to_unbounded_string("addr1"), Periodic_Type, 0, -- start_time C_13, -- capacity T_1, -- period 99999, -- deadline 0, -- jitter 0, -- blocking 4, -- priority 0, -- criticality SCHED_FIFO, New_Offset_Table.all); -- New_Offset := new Offset_Type; -- New_Offset.offset_value := O_14; -- New_Offset.activation := 0; -- New_Offset_Table := new Offsets_Table; -- Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); -- Task_Group_Set.Add_Task -- (Sys_Transaction.Tasks, -- Sys_Transaction.Task_Groups, -- To_Unbounded_String("G1"), -- To_Unbounded_String("tau_14"), -- to_unbounded_string("cpu1"), -- to_unbounded_string("addr1"), -- Periodic_Type, -- 0, -- start_time -- C_14, -- capacity -- T_1, -- period -- 99999, -- deadline -- 0, -- jitter -- 0, -- blocking -- 3, -- priority -- 0, -- criticality -- SCHED_FIFO, -- New_Offset_Table.all); -- -- New_Offset := new Offset_Type; -- New_Offset.offset_value := O_15; -- New_Offset.activation := 0; -- New_Offset_Table := new Offsets_Table; -- Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); -- Task_Group_Set.Add_Task -- (Sys_Transaction.Tasks, -- Sys_Transaction.Task_Groups, -- To_Unbounded_String("G1"), -- To_Unbounded_String("tau_15"), -- to_unbounded_string("cpu1"), -- to_unbounded_string("addr1"), -- Periodic_Type, -- 0, -- start_time -- C_15, -- capacity -- T_1, -- period -- 99999, -- deadline -- 0, -- jitter -- 0, -- blocking -- 3, -- priority -- 0, -- criticality -- SCHED_FIFO, -- New_Offset_Table.all); -- -- New_Offset := new Offset_Type; -- New_Offset.offset_value := O_16; -- New_Offset.activation := 0; -- New_Offset_Table := new Offsets_Table; -- Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); -- Task_Group_Set.Add_Task -- (Sys_Transaction.Tasks, -- Sys_Transaction.Task_Groups, -- To_Unbounded_String("G1"), -- To_Unbounded_String("tau_16"), -- to_unbounded_string("cpu1"), -- to_unbounded_string("addr1"), -- Periodic_Type, -- 0, -- start_time -- C_16, -- capacity -- T_1, -- period -- 99999, -- deadline -- 0, -- jitter -- 0, -- blocking -- 1, -- priority -- 0, -- criticality -- SCHED_FIFO, -- New_Offset_Table.all); -- -- New_Offset := new Offset_Type; -- New_Offset.offset_value := O_17; -- New_Offset.activation := 0; -- New_Offset_Table := new Offsets_Table; -- Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); -- Task_Group_Set.Add_Task -- (Sys_Transaction.Tasks, -- Sys_Transaction.Task_Groups, -- To_Unbounded_String("G1"), -- To_Unbounded_String("tau_17"), -- to_unbounded_string("cpu1"), -- to_unbounded_string("addr1"), -- Periodic_Type, -- 0, -- start_time -- C_17, -- capacity -- T_1, -- period -- 99999, -- deadline -- 0, -- jitter -- 0, -- blocking -- 3, -- priority -- 0, -- criticality -- SCHED_FIFO, -- New_Offset_Table.all); -- -- New_Offset := new Offset_Type; -- New_Offset.offset_value := O_18; -- New_Offset.activation := 0; -- New_Offset_Table := new Offsets_Table; -- Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); -- Task_Group_Set.Add_Task -- (Sys_Transaction.Tasks, -- Sys_Transaction.Task_Groups, -- To_Unbounded_String("G1"), -- To_Unbounded_String("tau_18"), -- to_unbounded_string("cpu1"), -- to_unbounded_string("addr1"), -- Periodic_Type, -- 0, -- start_time -- C_18, -- capacity -- T_1, -- period -- 99999, -- deadline -- 0, -- jitter -- 0, -- blocking -- 3, -- priority -- 0, -- criticality -- SCHED_FIFO, -- New_Offset_Table.all); -- -- -- New_Offset := new Offset_Type; -- -- New_Offset.offset_value := O_19; -- -- New_Offset.activation := 0; -- -- New_Offset_Table := new Offsets_Table; -- -- Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); -- -- Task_Group_Set.Add_Task -- -- (Sys_Transaction.Tasks, -- -- Sys_Transaction.Task_Groups, -- -- To_Unbounded_String("G1"), -- -- To_Unbounded_String("tau_19"), -- -- to_unbounded_string("cpu2"), -- -- to_unbounded_string("addr2"), -- -- Periodic_Type, -- -- 0, -- start_time -- -- C_19, -- capacity -- -- T_1, -- period -- -- 99999, -- deadline -- -- 0, -- jitter -- -- 0, -- blocking -- -- 3, -- priority -- -- 0, -- criticality -- -- SCHED_FIFO, -- -- New_Offset_Table.all); -- -- New_Offset := new Offset_Type; -- New_Offset.offset_value := O_110; -- New_Offset.activation := 0; -- New_Offset_Table := new Offsets_Table; -- Offsets_Table_Package.Add (New_Offset_Table.all, New_Offset.all); -- Task_Group_Set.Add_Task -- (Sys_Transaction.Tasks, -- Sys_Transaction.Task_Groups, -- To_Unbounded_String("G1"), -- To_Unbounded_String("tau_110"), -- to_unbounded_string("cpu1"), -- to_unbounded_string("addr1"), -- Periodic_Type, -- 0, -- start_time -- C_110, -- capacity -- T_1, -- period -- 99999, -- deadline -- 0, -- jitter -- 0, -- blocking -- 3, -- priority -- 0, -- criticality -- SCHED_FIFO, -- New_Offset_Table.all); Add_Task (Sys_Transaction.Tasks, Sys_Transaction.Task_Groups, To_Unbounded_String("G2"), To_Unbounded_String("tau_analyzed"), to_unbounded_string("cpu1"), to_unbounded_string("addr1"), Periodic_Type, 0, -- start_time 1, -- capacity 5000, -- period 5000, -- deadline 0, -- jitter 0, -- blocking 1, -- priority 0, -- criticality SCHED_FIFO); Add_Task (Sys_Transaction.Tasks, Sys_Transaction.Task_Groups, To_Unbounded_String("G3"), To_Unbounded_String("tau_interfere"), to_unbounded_string("cpu1"), to_unbounded_string("addr1"), Periodic_Type, 0, -- start_time 5, -- capacity 5000, -- period 5000, -- deadline 0, -- jitter 0, -- blocking 3, -- priority 0, -- criticality SCHED_FIFO); -- Dependencies Add_One_Task_Dependency (Sys_Transaction.Dependencies, Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_11")), Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_12"))); -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_11")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_14"))); Add_One_Task_Dependency (Sys_Transaction.Dependencies, Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_12")), Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_13"))); -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_14")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_15"))); -- -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_15")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_16"))); -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_15")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_19"))); -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_15")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_110"))); -- -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_16")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_17"))); -- -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_16")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_18"))); -- Add_One_Task_Dependency -- (Sys_Transaction.Dependencies, -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_19")), -- Search_Task(Sys_Transaction.Tasks, To_Unbounded_String("tau_110"))); Write_To_Xml_File(Sys_Transaction, To_Unbounded_String ("pred_ac_not_hpi_example.xml")); WCDOPS_Plus_NIMP(Sys_Transaction, Response_Times, True); for i in 0 .. Response_Times.nb_entries - 1 loop put_line(to_string(Response_Times.entries(i).item.name) & " " & to_string(suppress_space("(" & Periodic_Task_Ptr(Response_Times.entries(i).item).jitter'Img)) & ") = " & Integer(Response_Times.entries(i).data)'Img); put_line("============="); end loop; put_line("All done"); end WCDOPSP_Test;