------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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; use Tasks.Generic_Task_List_Package; with Task_Groups; use Task_Groups; with Task_Set; use Task_Set; use Task_Set.Generic_Task_Set; with Task_Group_Set; use Task_Group_Set; use Task_Group_Set.Generic_Task_Group_Set; with Resources; use Resources; use Resources.Resource_Accesses; 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 offsets.extended; use offsets.extended; 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 parameters; use parameters; use parameters.User_Defined_Parameters_Table_Package; package body architecture_models is procedure model0(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), RATE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 29, 29, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 10, 10, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 5, 5, 0, 0, 3, 0, SCHED_FIFO); end model0; procedure model1(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), RATE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), RATE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); add_processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 29, 29, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 10, 10, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 5, 5, 0, 0, 3, 0, SCHED_FIFO); put_line(to_string(xml_string(sys,0))); end model1; procedure model2(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), RATE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), RATE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); add_processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 10, 10, 0, 10, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 5, 5, 0, 10, 3, 0, SCHED_FIFO); put_line(to_string(xml_string(sys,0))); end model2; procedure model3(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), not_preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 29, 29, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 10, 10, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 5, 5, 0, 0, 3, 0, SCHED_FIFO); put_line(to_string(xml_string(sys,0))); end model3; procedure polling1(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 4, 10, 255, to_unbounded_string(""), hierarchical_polling_aperiodic_server_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 4, 20, 20, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 12, 30, 30, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("A"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 4, 3, 0, 20, 0, 0, 3, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("B"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 9, 4, 0, 20, 0, 0, 3, 0, SCHED_FIFO); end polling1; procedure polling2(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 1, 5, 255, to_unbounded_string(""), hierarchical_polling_aperiodic_server_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("TA"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 4, 10, 10, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("TB"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 20, 20, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("AperiodicRequest1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 5, 1, 0, 20, 0, 0, 3, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("AperiodicRequest2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 12, 1, 0, 20, 0, 0, 3, 0, SCHED_FIFO); put_line(to_string(xml_string(sys,0))); end polling2; procedure deferrable1(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 4, 10, 255, to_unbounded_string(""), hierarchical_deferrable_aperiodic_server_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 4, 20, 20, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 12, 30, 30, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("A"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 4, 3, 0, 20, 0, 0, 3, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("B"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 9, 4, 0, 20, 0, 0, 3, 0, SCHED_FIFO); end deferrable1; procedure deferrable2(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 1, 5, 255, to_unbounded_string(""), hierarchical_deferrable_aperiodic_server_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("TA"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 4, 10, 10, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("TB"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 20, 20, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("AperiodicRequest1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 5, 1, 0, 20, 0, 0, 3, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("AperiodicRequest2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), aPeriodic_type, 12, 1, 0, 20, 0, 0, 3, 0, SCHED_FIFO); put_line(to_string(xml_string(sys,0))); end deferrable2; procedure PF1(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), Proportionate_Fair_PF_Protocol); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), Proportionate_Fair_PF_Protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 2, 2, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 3, 3, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 9, 9, 0, 0, 1, 0, SCHED_FIFO); put_line(to_string(xml_string(sys,0))); end PF1; procedure global_DM_with_job_level_migration_scheduling(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), DEADLINE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), DEADLINE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); add_processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table, job_level_migration_type); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 4, 4, 0, 10, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 5, 5, 0, 10, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 3, 0, SCHED_FIFO); end global_DM_with_job_level_migration_scheduling; procedure global_DM_with_time_unit_level_migration_scheduling(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), DEADLINE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), DEADLINE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); add_processor(sys.processors, 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 4, 4, 0, 10, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 5, 5, 0, 10, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 3, 0, SCHED_FIFO); end global_DM_with_time_unit_level_migration_scheduling; procedure cache1(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; rt : Resource_Accesses_Table; r : critical_section; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 2, 2, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 3, 3, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 9, 9, 0, 0, 1, 0, SCHED_FIFO); r.task_begin:=1; r.task_end:=1; add(rt,to_unbounded_string("T1"),r); add(rt,to_unbounded_string("T2"),r); Add_Resource (Sys.Resources, to_unbounded_string("R1"), 1, 0, 0, to_unbounded_string("processor1"), to_unbounded_string("addr1"), No_Protocol, rt); put_line(to_string(xml_string(sys,0))); end cache1; procedure test1_xml(sys : out system) is begin initialize(sys); end test1_xml; procedure test2_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; 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_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 100, 1.0, 101, 102, 103, to_unbounded_string(""), Posix_1003_Highest_Priority_First_Protocol); add(a_core_unit_table, a_core); end test2_xml; procedure test3_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; 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, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 4, 4, 0, 10, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 5, 5, 0, 10, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 3, 0, SCHED_FIFO); end test3_xml; procedure test4_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; 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_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), 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, 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 4, 4, 0, 10, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 5, 5, 0, 10, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 3, 0, SCHED_FIFO); end test4_xml; procedure test5_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; Offs : Offsets_Table; Off : Offset_type; 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, 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); off.offset_value:=10; off.activation:=11; add(offs, off); off.offset_value:=12; off.activation:=13; add(offs, off); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 4, 4, 0, 10, 1, 0, SCHED_FIFO,offs); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 5, 5, 0, 10, 2, 0, SCHED_FIFO,offs); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 3, 0, SCHED_FIFO,offs); end test5_xml; procedure test6_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; rt : Resource_Accesses_Table; r : critical_section; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 2, 2, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 3, 3, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 9, 9, 0, 0, 1, 0, SCHED_FIFO); r.task_begin:=1; r.task_end:=1; add(rt,to_unbounded_string("T1"),r); add(rt,to_unbounded_string("T2"),r); Add_Resource (Sys.Resources, to_unbounded_string("R1"), 1, 0, 0, to_unbounded_string("processor1"), to_unbounded_string("addr1"), No_Protocol, rt); end test6_xml; procedure test7_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; bt : buffer_roles_table; b : buffer_role; T1_ref, T2_ref, T3_ref : generic_task_ptr; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 2, 2, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 3, 3, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, T3_ref, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 9, 9, 0, 0, 1, 0, SCHED_FIFO); b.the_role:=queuing_producer; b.size:=1; b.time:=1; b.timeout:=1; add(bt,to_unbounded_string("T1"),b); b.the_role:=queuing_consumer; b.size:=2; b.time:=2; b.timeout:=2; add(bt,to_unbounded_string("T2"),b); Add_buffer (Sys.buffers, to_unbounded_string("B1"), 1, to_unbounded_string("processor1"), to_unbounded_string("addr1"), qs_mm1, bt); end test7_xml; procedure csg_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; P1_ref : generic_processor_ptr; T1_ref, T2_ref, T3_ref : generic_task_ptr; M1_ref, M2_ref : Generic_Message_ptr; pt : User_Defined_Parameters_Table; begin initialize(sys); Add_core_unit(sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), Posix_1003_Highest_Priority_First_Protocol); add(a_core_unit_table, a_core); Add_core_unit(sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, 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("cpu0"), to_unbounded_string("a_network"), a_core_unit_table, time_unit_migration_type); Add_Address_Space(sys.address_spaces, to_unbounded_string("as"), to_unbounded_string("cpu0"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("io"), to_unbounded_string("cpu0"), to_unbounded_string("as"), Periodic_type, 0, 4, 20, 20, 0, 0, 10, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("sharp"), to_unbounded_string("cpu0"), to_unbounded_string("as"), Periodic_type, 0, 12, 20, 20, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, T3_ref, to_unbounded_string("edge"), to_unbounded_string("cpu0"), to_unbounded_string("as"), Periodic_type, 20, 12, 20, 20, 0, 0, 2, 0, SCHED_FIFO); Add_Message(sys.Messages, M1_ref, to_unbounded_string("camera_frame"), 1, 1, 1, 0, pt, 1, 1); Add_Message(sys.Messages, M2_ref, to_unbounded_string("sharp_frame"), 1, 1, 1, 0, pt, 1, 1); add_one_task_dependency(sys.dependencies,T1_ref, M1_ref, from_task_to_object); add_one_task_dependency(sys.dependencies,T2_ref, M1_ref, from_object_to_task); add_one_task_dependency(sys.dependencies,T2_ref, M2_ref, from_task_to_object); add_one_task_dependency(sys.dependencies,T3_ref, M2_ref, from_object_to_task); end csg_xml; procedure csp_xml(sys : out system) is a_core1, a_core2 : core_unit_ptr; a_core_unit_table1, a_core_unit_table2 : core_units_table; --P1_ref, P2_ref : generic_processor_ptr; T1_ref, T2_ref, T3_ref : generic_task_ptr; --M1_ref, M2_ref : Generic_Message_ptr; --pt : User_Defined_Parameters_Table; bt : buffer_roles_table; b : buffer_role; B1_ref, B2_ref : Buffer_ptr; begin initialize(sys); Add_core_unit(sys.core_units, a_core1, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), Posix_1003_Highest_Priority_First_Protocol); add(a_core_unit_table1, a_core1); Add_core_unit(sys.core_units, a_core2, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), Posix_1003_Highest_Priority_First_Protocol); add(a_core_unit_table2, a_core2); add_processor(sys.processors, to_unbounded_string("cpu0"), to_unbounded_string("a_network"), a_core_unit_table1); add_processor(sys.processors, to_unbounded_string("cpu1"), to_unbounded_string("a_network"), a_core_unit_table2); Add_Address_Space(sys.address_spaces, to_unbounded_string("as"), to_unbounded_string("cpu0"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("io"), to_unbounded_string("cpu0"), to_unbounded_string("as"), Periodic_type, 0, 4, 50, 10, 0, 0, 10, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("sharp"), to_unbounded_string("cpu1"), to_unbounded_string("as"), Periodic_type, 1, 12, 50, 50, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, T3_ref, to_unbounded_string("edge"), to_unbounded_string("cpu1"), to_unbounded_string("as"), Periodic_type, 1, 12, 50, 50, 0, 0, 1, 0, SCHED_FIFO); --Add_Message(sys.Messages, M1_ref, to_unbounded_string("camera_frame"), 1, 1, 1, 0, pt, 1, 1); --Add_Message(sys.Messages, M2_ref, to_unbounded_string("sharp_frame"), 1, 1, 1, 0, pt, 1, 1); b.the_role:=queuing_producer; b.size:=1; b.time:=4; b.timeout:=1000; add(bt,to_unbounded_string("io"),b); b.the_role:=queuing_consumer; b.size:=1; b.time:=1; b.timeout:=1000; add(bt,to_unbounded_string("sharp"),b); Add_buffer(Sys.buffers, B1_ref, to_unbounded_string("camera_frame"), 5, to_unbounded_string("cpu0"), to_unbounded_string("as"), qs_mm1, bt); b.the_role:=queuing_producer; b.size:=1; b.time:=12; b.timeout:=1000; add(bt,to_unbounded_string("sharp"),b); b.the_role:=queuing_consumer; b.size:=1; b.time:=1; b.timeout:=1000; add(bt,to_unbounded_string("edge"),b); Add_buffer(Sys.buffers, B2_ref, to_unbounded_string("sharp_frame"), 5, to_unbounded_string("cpu1"), to_unbounded_string("as"), qs_mm1, bt); add_one_task_dependency(sys.dependencies,T1_ref, B1_ref, from_task_to_object); add_one_task_dependency(sys.dependencies,T2_ref, B1_ref, from_object_to_task); add_one_task_dependency(sys.dependencies,T2_ref, B2_ref, from_task_to_object); add_one_task_dependency(sys.dependencies,T3_ref, B2_ref, from_object_to_task); end csp_xml; procedure test8_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; T1_ref, T2_ref : generic_task_ptr; bt : buffer_roles_table; pt : User_Defined_Parameters_Table; b : buffer_role; B1_ref : Buffer_ptr; R1_ref : Generic_Resource_ptr; rt : Resource_Accesses_Table; r : critical_section; M1_ref : Generic_Message_ptr; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 2, 2, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 3, 3, 0, 0, 2, 0, SCHED_FIFO); r.task_begin:=1; r.task_end:=1; add(rt,to_unbounded_string("T1"),r); add(rt,to_unbounded_string("T2"),r); Add_Resource (Sys.Resources, R1_ref, to_unbounded_string("R1"), 1, 0, 0, to_unbounded_string("processor1"), to_unbounded_string("addr1"), No_Protocol, rt); Add_Message (sys.Messages, M1_ref, to_unbounded_string("M1"), 1, 1, 1, 1, pt, 1, 1); b.the_role:=queuing_producer; b.size:=1; b.time:=1; b.timeout:=1; add(bt,to_unbounded_string("T1"),b); b.the_role:=queuing_consumer; b.size:=2; b.time:=2; b.timeout:=2; add(bt,to_unbounded_string("T2"),b); Add_buffer (Sys.buffers, B1_ref, to_unbounded_string("B1"), 1, to_unbounded_string("processor1"), to_unbounded_string("addr1"), qs_mm1, bt); add_all_task_dependencies(sys.dependencies,sys.tasks,B1_ref); add_all_task_dependencies(sys.dependencies,sys.tasks,R1_ref); add_one_task_dependency(sys.dependencies,T1_ref, M1_ref, from_object_to_task); add_one_task_dependency(sys.dependencies,T2_ref, M1_ref, from_task_to_object); add_one_task_dependency(sys.dependencies,T2_ref, T1_ref); add_one_task_dependency(sys.dependencies,T2_ref, T1_ref, sampled_timing); add_one_task_dependency(sys.dependencies,T2_ref, T1_ref, delayed_timing); add_one_task_dependency(sys.dependencies,T2_ref, T1_ref, immediate_timing); end test8_xml; -- Add_Task(Sys.tasks, ^M -- Name, Cpu_Name, Address_Space_Name,^M -- Task_Type,^M -- Start_Time, Capacity, Period, Deadline, Jitter, Blocking_Time,^M -- Priority,^M -- Criticality,^M -- Policy,^M -- argument of Add_Task with a default value :^M -- Offset:=No_offset,^M -- Stack_Memory_Size:=0,^M -- Text_Memory_Size:=0,^M -- Param:=No_User_Defined_Parameter,^M -- Parametric_Rule_Name:=Empty_String,^M -- Seed_Value:=0,^M -- Predictable:=True,^M -- context_switch_overhead:=0);^M -- -- To add a core unit, the following subprogram can be used :^M --^M -- Add_Core_Unit(My_core_units,^M -- A_Core_Unit, Name,^M -- Is_Preemptive,^M -- Quantum, Speed, Capacity, Period, Priority, File_Name, A_Scheduler,^M -- argument of Add_Core_Unit with a default value :^M -- Automaton_Name:= Empty_String);^M -- 1 core with tasks and users defined schedulers/user defined tasks -- and user defined parameters procedure test9_xml(sys : out system) is a_core : core_unit_ptr; a_param : parameter_ptr; Params : User_Defined_Parameters_Table; begin initialize(sys); Add_core_unit (Sys.core_units, a_core, To_Unbounded_String ("core1"), Preemptive, 0, 0.0, 1, 1, 0, to_unbounded_string("edf.sc"), pipeline_User_Defined_Protocol, to_unbounded_string("my automaton") ); Add_Processor (Sys.Processors, To_Unbounded_String ("processor1"), empty_string, a_core); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); -- procedure Add_Task -- (My_Tasks : in out Tasks_Set; -- Name : in Unbounded_String; -- Cpu_Name : in Unbounded_String; -- Address_Space_Name : in Unbounded_String; -- Task_Type : in Tasks_Type; -- Start_Time : in Integer; -- Capacity : in Integer; -- Period : in Integer; -- Deadline : in Integer; -- Jitter : in Integer; -- Blocking_Time : in Integer; -- Priority : in Integer; -- Criticality : in Integer; -- Policy : in Policies; -- Offset : in Offsets_Table := No_Offset; -- Stack_Memory_Size : in Integer := 0; -- Text_Memory_Size : in Integer := 0; -- Param : in User_Defined_Parameters_Table := No_User_Defined_Parameter; -- Parametric_Rule_Name : in Unbounded_String := empty_string; -- Seed_Value : in Integer := 0; -- Predictable : in Boolean := True; -- context_switch_overhead : in Integer := 0); initialize(params); a_param:= new parameter(boolean_parameter); a_param.boolean_value:=False; add(params, a_param); a_param:= new parameter(integer_parameter); a_param.integer_value:=100; add(params, a_param); a_param:= new parameter(double_parameter); a_param.double_value:=100.5; add(params, a_param); a_param:= new parameter(string_parameter); a_param.string_value:=to_unbounded_string("a_parameter_value"); add(params, a_param); Add_Task(sys.tasks, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), parametric_type, 0, 1, 2, 2, 0, 0, 1, 0, SCHED_FIFO, No_Offset, 0, 0, Params, to_unbounded_string("activation_rule"), 10, False, 10); end test9_xml; procedure test10_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; pt : User_Defined_Parameters_Table; T1_ref, T2_ref, T3_ref : generic_task_ptr; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), rate_monotonic_protocol); add(a_core_unit_table, a_core); Add_Processor(sys.processors, to_unbounded_string("processor1"), to_unbounded_string("a_network"), a_core_unit_table); Add_Address_Space(sys.address_spaces, to_unbounded_string("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 2, 2, 0, 0, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 3, 3, 0, 0, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, T3_ref, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 9, 9, 0, 0, 1, 0, SCHED_FIFO); Add_Message (sys.Messages, to_unbounded_string("M1"), 1, 1, 1, 1, pt, 1, 1); end test10_xml; procedure test11_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; T1_ref, T2_ref, T3_ref : generic_task_ptr; P1_ref : generic_processor_ptr; sink, source : 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_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 4, 4, 0, 10, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 5, 5, 0, 10, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, T3_ref, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 3, 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); initialize(sink); add(source,generic_object_ptr(T1_ref)); add(source,generic_object_ptr(T2_ref)); add(source,generic_object_ptr(T3_ref)); add(sink,generic_object_ptr(P1_ref)); Add_deployment(sys.deployments, to_unbounded_string("static_example"), source, sink, to_unbounded_string("scheduling_sequence.xml")); end test11_xml; procedure test12_xml(sys : out system) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; T1_ref, T2_ref, T3_ref : generic_task_ptr; P1_ref : generic_processor_ptr; consumer_entities, resource_entities : 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_core_unit (sys.core_units, a_core, to_unbounded_string("core2"), 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); Add_Task(sys.tasks, T1_ref, to_unbounded_string("T1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 2, 4, 4, 0, 10, 1, 0, SCHED_FIFO); Add_Task(sys.tasks, T2_ref, to_unbounded_string("T2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 3, 5, 5, 0, 10, 2, 0, SCHED_FIFO); Add_Task(sys.tasks, T3_ref, to_unbounded_string("T3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 7, 20, 20, 0, 10, 3, 0, SCHED_FIFO); initialize(resource_entities); initialize(consumer_entities); add(consumer_entities,generic_object_ptr(T1_ref)); add(consumer_entities,generic_object_ptr(T2_ref)); add(consumer_entities,generic_object_ptr(T3_ref)); add(resource_entities,generic_object_ptr(P1_ref)); Add_deployment(sys.deployments, to_unbounded_string("dynamic_example"), resource_entities, consumer_entities, empty_string, 0, 0, 0, preemptive, 0, empty_string, Rate_Monotonic_Protocol, empty_string ); end test12_xml; ---------------------------------------------------- -- Set of architecture to test scheduling with offset ---------------------------------------------------- -- Audsley procedure offset_test1(sys: out System) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; A, B, C, D, E : generic_task_ptr; ofa, ofb, ofc, ofd, ofe: Offsets_Table; off : Offset_Type; TransP : Transaction_Task_Group_Ptr; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), DEADLINE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); add_processor(sys.processors, 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); off.offset_value:=51; off.activation:=0; add(ofa, off); off.offset_value:=11; off.activation:=0; add(ofb, off); off.offset_value:=60; off.activation:=0; add(ofc, off); off.offset_value:=41; off.activation:=0; add(ofd, off); off.offset_value:=90; off.activation:=0; add(ofe, off); Add_Task(sys.tasks, Generic_Task_Ptr (A), to_unbounded_string("A"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 30, 161, 110, 0, 0, 5, 0, SCHED_FIFO, ofa); Add_Task(sys.tasks, Generic_Task_Ptr (B), to_unbounded_string("B"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 30, 161, 40, 0, 0, 1, 0, SCHED_FIFO, ofb); Add_Task(sys.tasks, Generic_Task_Ptr (C), to_unbounded_string("C"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 30, 161, 30, 0, 0, 3, 0, SCHED_FIFO, ofc); Add_Task(sys.tasks, Generic_Task_Ptr (D), to_unbounded_string("D"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 10, 161, 59, 0, 0, 2, 0, SCHED_FIFO, ofd); Add_Task(sys.tasks, Generic_Task_Ptr (E), to_unbounded_string("E"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 50, 161, 50, 0, 0, 4, 0, SCHED_FIFO, ofe); Add_Task_Group(sys.task_groups, Generic_Task_Group_Ptr (TransP) , to_unbounded_string("TransP") , Transaction_Type); TransP.period := 161; Add(TransP.task_list, Generic_Task_Ptr (A)); Add(TransP.task_list, Generic_Task_Ptr (B)); Add(TransP.task_list, Generic_Task_Ptr (C)); Add(TransP.task_list, Generic_Task_Ptr (D)); Add(TransP.task_list, Generic_Task_Ptr (E)); end offset_test1; -- Audsley, with 3 transactions procedure offset_test2(sys: out System) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; A, B, C, D, E, F : generic_task_ptr; ofa, ofb, ofc, ofd, ofe, off: Offsets_Table; offt : Offset_Type; Trans10, Trans20, Trans40 : Transaction_Task_Group_Ptr; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), DEADLINE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); add_processor(sys.processors, 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); offt.offset_value:=51; offt.activation:=0; add(ofa, offt); offt.offset_value:=11; offt.activation:=0; add(ofb, offt); offt.offset_value:=60; offt.activation:=0; add(ofc, offt); offt.offset_value:=41; offt.activation:=0; add(ofd, offt); offt.offset_value:=90; offt.activation:=0; add(ofe, offt); offt.offset_value:=90; offt.activation:=0; add(off, offt); Add_Task(sys.tasks, Generic_Task_Ptr (A), to_unbounded_string("A"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 1, 0, 0, 1, 0, SCHED_FIFO, ofa); Add_Task(sys.tasks, Generic_Task_Ptr (B), to_unbounded_string("B"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 2, 0, 0, 4, 0, SCHED_FIFO, ofb); Add_Task(sys.tasks, Generic_Task_Ptr (C), to_unbounded_string("C"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 5, 20, 6, 0, 0, 2, 0, SCHED_FIFO, ofc); Add_Task(sys.tasks, Generic_Task_Ptr (D), to_unbounded_string("D"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 40, 9, 0, 0, 3, 0, SCHED_FIFO, ofd); Add_Task(sys.tasks, Generic_Task_Ptr (E), to_unbounded_string("E"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 40, 14, 0, 0, 6, 0, SCHED_FIFO, ofe); Add_Task(sys.tasks, Generic_Task_Ptr (F), to_unbounded_string("F"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 6, 40, 30, 0, 0, 5, 0, SCHED_FIFO, off); Add_Task_Group(sys.task_groups, Generic_Task_Group_Ptr (Trans10) , to_unbounded_string("Trans10") , Transaction_Type); Add_Task_Group(sys.task_groups, Generic_Task_Group_Ptr (Trans20) , to_unbounded_string("Trans20") , Transaction_Type); Add_Task_Group(sys.task_groups, Generic_Task_Group_Ptr (Trans40) , to_unbounded_string("Trans40") , Transaction_Type); Trans10.period := 10; Trans20.period := 20; Trans40.period := 40; Add(Trans10.task_list, Generic_Task_Ptr (A)); Add(Trans10.task_list, Generic_Task_Ptr (B)); Add(Trans20.task_list, Generic_Task_Ptr (C)); Add(Trans40.task_list, Generic_Task_Ptr (D)); Add(Trans40.task_list, Generic_Task_Ptr (E)); Add(Trans40.task_list, Generic_Task_Ptr (F)); end offset_test2; -- Audsley, same set as test2 but with 1 transaction after task transformation procedure offset_test3(sys: out System) is a_core : core_unit_ptr; a_core_unit_table : core_units_table; A, B, C, D, E, F : generic_task_ptr; ofa, ofb, ofc, ofd, ofe, off: Offsets_Table; offt : Offset_Type; TransP : Transaction_Task_Group_Ptr; begin initialize(sys); Add_core_unit (sys.core_units, a_core, to_unbounded_string("core1"), preemptive, 0, 1.0, 0, 0, 0, to_unbounded_string(""), DEADLINE_MONOTONIC_PROTOCOL); add(a_core_unit_table, a_core); add_processor(sys.processors, 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("addr1"), to_unbounded_string("processor1"), 0, 0, 0, 0); offt.offset_value:=51; offt.activation:=0; add(ofa, offt); offt.offset_value:=11; offt.activation:=0; add(ofb, offt); offt.offset_value:=60; offt.activation:=0; add(ofc, offt); offt.offset_value:=41; offt.activation:=0; add(ofd, offt); offt.offset_value:=90; offt.activation:=0; add(ofe, offt); offt.offset_value:=90; offt.activation:=0; add(off, offt); Add_Task_Group(sys.task_groups, Generic_Task_Group_Ptr (TransP) , to_unbounded_string("TransP") , Transaction_Type); Add_Task(sys.tasks, Generic_Task_Ptr (A), to_unbounded_string("A1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 1, 0, 0, 1, 0, SCHED_FIFO, ofa); Add(TransP.task_list, Generic_Task_Ptr (A)); Add_Task(sys.tasks, Generic_Task_Ptr (A), to_unbounded_string("A2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 1, 0, 0, 1, 0, SCHED_FIFO, ofa); Add(TransP.task_list, Generic_Task_Ptr (A)); Add_Task(sys.tasks, Generic_Task_Ptr (A), to_unbounded_string("A3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 1, 0, 0, 1, 0, SCHED_FIFO, ofa); Add(TransP.task_list, Generic_Task_Ptr (A)); Add_Task(sys.tasks, Generic_Task_Ptr (A), to_unbounded_string("A4"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 1, 0, 0, 1, 0, SCHED_FIFO, ofa); Add(TransP.task_list, Generic_Task_Ptr (A)); Add_Task(sys.tasks, Generic_Task_Ptr (B), to_unbounded_string("B1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 2, 0, 0, 4, 0, SCHED_FIFO, ofb); Add(TransP.task_list, Generic_Task_Ptr (B)); Add_Task(sys.tasks, Generic_Task_Ptr (B), to_unbounded_string("B2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 2, 0, 0, 4, 0, SCHED_FIFO, ofb); Add(TransP.task_list, Generic_Task_Ptr (B)); Add_Task(sys.tasks, Generic_Task_Ptr (B), to_unbounded_string("B3"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 2, 0, 0, 4, 0, SCHED_FIFO, ofb); Add(TransP.task_list, Generic_Task_Ptr (B)); Add_Task(sys.tasks, Generic_Task_Ptr (B), to_unbounded_string("B4"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 1, 10, 2, 0, 0, 4, 0, SCHED_FIFO, ofb); Add(TransP.task_list, Generic_Task_Ptr (B)); Add_Task(sys.tasks, Generic_Task_Ptr (C), to_unbounded_string("C1"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 5, 20, 6, 0, 0, 2, 0, SCHED_FIFO, ofc); Add(TransP.task_list, Generic_Task_Ptr (C)); Add_Task(sys.tasks, Generic_Task_Ptr (C), to_unbounded_string("C2"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 5, 20, 6, 0, 0, 2, 0, SCHED_FIFO, ofc); Add(TransP.task_list, Generic_Task_Ptr (C)); Add_Task(sys.tasks, Generic_Task_Ptr (D), to_unbounded_string("D"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 40, 9, 0, 0, 3, 0, SCHED_FIFO, ofd); Add_Task(sys.tasks, Generic_Task_Ptr (E), to_unbounded_string("E"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 8, 40, 14, 0, 0, 6, 0, SCHED_FIFO, ofe); Add_Task(sys.tasks, Generic_Task_Ptr (F), to_unbounded_string("F"), to_unbounded_string("processor1"), to_unbounded_string("addr1"), Periodic_type, 0, 6, 40, 30, 0, 0, 5, 0, SCHED_FIFO, off); Add(TransP.task_list, Generic_Task_Ptr (D)); Add(TransP.task_list, Generic_Task_Ptr (E)); Add(TransP.task_list, Generic_Task_Ptr (F)); end offset_test3; end architecture_models;