------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 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 Systems; use Systems; 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 Ada.Exceptions; use Ada.Exceptions; 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 Parameters; use Parameters; with Parameters.extended; use Parameters.extended; use Parameters.Framework_Parameters_Table_Package; with tasks; use tasks; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with Resources; use Resources; with resource_Set; use resource_Set; use resource_Set.Generic_resource_Set; with address_space_Set; use address_space_Set; use address_space_Set.Generic_address_space_Set; with offsets; use offsets; use offsets.offsets_table_package; with buffer_set;use buffer_set; with buffers; use buffers; use buffers.buffer_roles_package; with queueing_systems; use queueing_systems; with message_set; use message_set; with messages; use messages; with task_dependencies; use task_dependencies; with dependencies; use dependencies; with objects;use objects; use objects.Generic_Object_Set_Package; with deployment_set; use deployment_set; with deployments; use deployments; procedure arinc653_deployment_example is sys : system; a_core : core_unit_ptr; a_core_unit_table : core_units_table; T1_ref, T2_ref, T3_ref, T4_ref, P1_Serv_ref, P2_Serv_ref : generic_task_ptr; P1_ref : generic_processor_ptr; sink, source, sink_L, source_L: Generic_Objects_Set; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 100, 1.0, 101, 102, 103, to_unbounded_string(""), Posix_1003_Highest_Priority_First_Protocol); add(a_core_unit_table, a_core); add_processor(sys.processors, P1_ref, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table, time_unit_migration_type); Add_Address_Space(sys.address_spaces, to_unbounded_string("part1_memory"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Address_Space(sys.address_spaces, to_unbounded_string("part2_memory"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("Order"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 10, 50, 50, 0, 0, 3, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("Temperature"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 100, 100, 0, 0, 4, 0, SCHED_FIFO); Add_Task(sys.tasks, T3_ref, to_unbounded_string("Printer"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 10, 50, 50, 0, 0, 3, 0, SCHED_FIFO); Add_Task(sys.tasks, T4_ref, to_unbounded_string("Receiver"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 100, 100, 0, 0, 4, 0, SCHED_FIFO); Add_Task(sys.tasks, P1_Serv_ref, to_unbounded_string("Partition_1_server"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 5, 5, 3, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, P2_Serv_ref, to_unbounded_string("Partition_2_server"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 20, 20, 12, 0, 2, 0, SCHED_FIFO); -- procedure Add_deployment -- (My_deployments : in out deployments_set; -- A_deployment : in out generic_deployment_Ptr; -- Name : in Unbounded_String; -- sink_entities : in Generic_Objects_Set; -- source_entities : in Generic_Objects_Set; -- allocation_file : in Unbounded_String; -- capacity : in Integer :=0; -- period : in Integer :=0; -- priority : in Integer :=0; -- Is_Preemptive : in Preemptives_Type := preemptive; -- Quantum : in Integer := 0; -- File_Name : in Unbounded_String := empty_string; -- A_Scheduler : in Schedulers_Type := No_Scheduling_Protocol; -- automaton_name : in Unbounded_String := empty_string); initialize(source_L); initialize(sink_L); add(sink,generic_object_ptr(T1_ref)); add(sink,generic_object_ptr(T2_ref)); add(source,generic_object_ptr(P1_Serv_ref)); Add_deployment(sys.deployments, to_unbounded_string("Partition_1_server"), source, sink, empty_string,0,0,0,preemptive,0,empty_string,Earliest_Deadline_First_Protocol); initialize(source_L); initialize(sink_L); add(sink,generic_object_ptr(T3_ref)); add(sink,generic_object_ptr(T4_ref)); add(source,generic_object_ptr(P2_Serv_ref)); Add_deployment(sys.deployments, to_unbounded_string("Partition_2_server"), source, sink, empty_string,0,0,0,preemptive,0,empty_string,Rate_Monotonic_Protocol); initialize(source); initialize(sink); add(sink,generic_object_ptr(P1_Serv_ref)); add(sink,generic_object_ptr(P2_Serv_ref)); add(source,generic_object_ptr(P1_ref)); Add_deployment(sys.deployments, to_unbounded_string("static_example"), source, sink, to_unbounded_string("scheduling_sequence.xml")); Write_To_Xml_File(sys,"arinc655_deployment_example.xml"); end arinc653_deployment_example;