Model (
   Model_Name          => template,
   Model_Date          => 2004-01-23,
   System_Pip_Behaviour=> POSIX);

Processing_Resource (
   Type                   => Regular_Processor,
   Name                   => cpu_1,
   Max_Interrupt_Priority => 300,
   Min_Interrupt_Priority => 100,
   Worst_ISR_Switch       => 50.00,
   Avg_ISR_Switch         => 30.00,
   Best_ISR_Switch        => 20.00,
   System_Timer           => 
      ( Type           => Ticker,
        Worst_Overhead => 500.00,
        Avg_Overhead   => 30.00,
        Best_Overhead  => 20.00,
        Period         => 2000.00),
   Speed_Factor           => 2.00);

Processing_Resource (
   Type                   => Regular_Processor,
   Name                   => cpu_2,
   Max_Interrupt_Priority => 32767,
   Min_Interrupt_Priority => 1,
   Worst_ISR_Switch       => 50.00,
   Avg_ISR_Switch         => 30.00,
   Best_ISR_Switch        => 20.00,
   System_Timer           => 
      ( Type           => Alarm_Clock,
        Worst_Overhead => 50.00,
        Avg_Overhead   => 30.00,
        Best_Overhead  => 20.00),
   Speed_Factor           => 2.00);

Processing_Resource (
   Type                          => Packet_Based_Network,
   Name                          => red.1,
   Transmission                  => FULL_DUPLEX,
   Throughput                    => 0.00,
   Max_Blocking                  => 199.00,
   Max_Packet_Transmission_Time  => 200.00,
   Min_Packet_Transmission_Time  => 200.00,
   List_of_Drivers               => 
      (( Type                        => Character_Packet_Driver,
         Message_Partitioning        => YES,
         RTA_Overhead_Model          => DECOUPLED,
         Packet_Server               => rs232_p_server1,
         Packet_Send_Operation       => rs232_p_send,
         Packet_Receive_Operation    => rs232_p_receive,
         Character_Server            => rs232_c_server1,
         Character_Send_Operation    => rs232_c_send,
         Character_Receive_Operation => rs232_c_receive,
         Character_Transmission_Time => 1.000E+100),
       ( Type                            => RTEP_Packet_Driver,
         Message_Partitioning            => NO,
         RTA_Overhead_Model              => COUPLED,
         Packet_Server                   => rtep_internal_thread2,
         Packet_Send_Operation           => rtep_send,
         Packet_Receive_Operation        => rtep_receive,
         Number_Of_Stations              => 10,
         Token_Delay                     => 10.200,
         Failure_Timeout                 => 100.000,
         Token_Transmission_Retries      => 3,
         Packet_Transmission_Retries     => 3,
         Packet_Interrupt_Server         => rtep_isr2,
         Packet_ISR_Operation            => rtep_isr_op,
         Token_Check_Operation           => tco,
         Token_Manage_Operation          => tmo,
         Packet_Discard_Operation        => pdo,
         Token_Retransmission_Operation  => tro,
         Packet_Retransmission_Operation => pro)),
   Speed_Factor                  => 1.10);

Processing_Resource (
   Type                          => Packet_Based_Network,
   Name                          => red.2,
   Transmission                  => HALF_DUPLEX,
   Throughput                    => 1000000.0,
   Max_Blocking                  => 0.00,
   Max_Packet_Transmission_Time  => 200.00,
   Min_Packet_Transmission_Time  => 200.00,
   List_of_Drivers               => 
      (( Type                     => Packet_Driver,
         Message_Partitioning     => YES,
         RTA_Overhead_Model       => DECOUPLED,
         Packet_Server            => ethernet_server1,
         Packet_Send_Operation    => ethernet_send,
         Packet_Receive_Operation => ethernet_receive),
       ( Type                     => Packet_Driver,
         Message_Partitioning     => YES,
         RTA_Overhead_Model       => DECOUPLED,
         Packet_Server            => ethernet_server2,
         Packet_Send_Operation    => ethernet_send1,
         Packet_Receive_Operation => ethernet_receive1)),
   Speed_Factor                  => 1.10);

Processing_Resource (
   Type                          => Packet_Based_Network,
   Name                          => red.3,
   Transmission                  => HALF_DUPLEX,
   Throughput                    => 1000000.0,
   Max_Blocking                  => 0.00,
   Max_Packet_Size               => 200.00,
   Min_Packet_Size               => 200.00,
   Speed_Factor                  => 1.10);

Processing_Resource (
   Type                          => Packet_Based_Network,
   Name                          => red.22,
   Transmission                  => HALF_DUPLEX,
   Throughput                    => 1000000.0,
   Max_Blocking                  => 0.00,
   Max_Packet_Size               => 200.00,
   Min_Packet_Size               => 200.00,
   Speed_Factor                  => 1.10);

Scheduler (
   Type            => Primary_Scheduler,
   Name            => cpu_1,
   Host            => cpu_1,
   Policy          => 
      ( Type                 => Fixed_Priority,
        Worst_Context_Switch => 150.00,
        Avg_Context_Switch   => 100.00,
        Best_Context_Switch  => 50.00,
        Max_Priority         => 200,
        Min_Priority         => 1));

Scheduler (
   Type            => Primary_Scheduler,
   Name            => cpu_2,
   Host            => cpu_2,
   Policy          => 
      ( Type                 => Fixed_Priority,
        Worst_Context_Switch => 150.00,
        Avg_Context_Switch   => 100.00,
        Best_Context_Switch  => 50.00,
        Max_Priority         => 32767,
        Min_Priority         => 1));

Scheduler (
   Type            => Primary_Scheduler,
   Name            => red.1,
   Host            => red.1,
   Policy          => 
      ( Type                     => FP_Packet_Based,
        Packet_Worst_Overhead    => 20.00,
        Packet_Avg_Overhead      => 15.00,
        Packet_Best_Overhead     => 10.00,
        Max_Priority             => 200,
        Min_Priority             => 1));

Scheduler (
   Type            => Primary_Scheduler,
   Name            => red.2,
   Host            => red.2,
   Policy          => 
      ( Type                     => FP_Packet_Based,
        Packet_Worst_Overhead    => 20.00,
        Packet_Avg_Overhead      => 15.00,
        Packet_Best_Overhead     => 10.00,
        Max_Priority             => 32767,
        Min_Priority             => 1));

Scheduler (
   Type            => Primary_Scheduler,
   Name            => red.22,
   Host            => red.22,
   Policy          => 
      ( Type                     => FP_Packet_Based,
        Packet_Overhead_Max_Size => 2000.0,
        Packet_Overhead_Avg_Size => 1500.0,
        Packet_Overhead_Min_Size => 1000.0,
        Max_Priority             => 32767,
        Min_Priority             => 1));

Scheduler (
   Type            => Secondary_Scheduler,
   Name            => edf_scheduler_1,
   Server          => edf_scheduler_1,
   Policy          => 
      ( Type                 => EDF,
        Worst_Context_Switch => 150.00,
        Avg_Context_Switch   => 100.00,
        Best_Context_Switch  => 50.00));

Scheduler (
   Type            => Secondary_Scheduler,
   Name            => net_scheduler,
   Server          => net_scheduler,
   Policy          => 
      ( Type                 => EDF,
        Worst_Context_Switch => 150.00,
        Avg_Context_Switch   => 100.00,
        Best_Context_Switch  => 50.00));

Scheduler (
   Type            => Secondary_Scheduler,
   Name            => edf_scheduler_2,
   Server          => edf_scheduler_2,
   Policy          => 
      ( Type                 => EDF,
        Worst_Context_Switch => 150.00,
        Avg_Context_Switch   => 100.00,
        Best_Context_Switch  => 50.00));

Scheduling_Server (
   Type                       => Regular,
   Name                       => rs232_c_server1,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 21,
        Preassigned  => YES),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => rs232_p_server1,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 21,
        Preassigned  => YES),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => rtep_internal_thread2,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 21,
        Preassigned  => YES),
   Scheduler                  => cpu_2);

Scheduling_Server (
   Type                       => Regular,
   Name                       => rtep_isr2,
   Server_Sched_Parameters    => 
      ( Type         => Interrupt_FP_Policy,
        The_Priority => 100),
   Scheduler                  => cpu_2);

Scheduling_Server (
   Type                       => Regular,
   Name                       => ethernet_server1,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 18,
        Preassigned  => YES),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => ethernet_server2,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 18,
        Preassigned  => YES),
   Scheduler                  => cpu_2);

Scheduling_Server (
   Type                       => Regular,
   Name                       => edf_scheduler_1,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 13,
        Preassigned  => YES),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => net_scheduler,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 13,
        Preassigned  => YES),
   Scheduler                  => red.2);

Scheduling_Server (
   Type                       => Regular,
   Name                       => edf_scheduler_2,
   Server_Sched_Parameters    => 
      ( Type         => EDF_Policy,
        Deadline     => 130.400,
        Preassigned  => YES),
   Scheduler                  => edf_scheduler_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => edf_task,
   Server_Sched_Parameters    => 
      ( Type         => EDF_Policy,
        Deadline     => 1.304,
        Preassigned  => YES),
   Synchronization_Parameters => 
      ( Type             => SRP_Parameters,
        Preemption_Level => 12002,
        Preassigned      => NO),
   Scheduler                  => edf_scheduler_2);

Scheduling_Server (
   Type                       => Regular,
   Name                       => tarea_1,
   Server_Sched_Parameters    => 
      ( Type         => Interrupt_FP_Policy,
        The_Priority => 100),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => tarea_11,
   Server_Sched_Parameters    => 
      ( Type         => Non_Preemptible_FP_Policy,
        The_Priority => 12,
        Preassigned  => YES),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => tarea_x,
   Server_Sched_Parameters    => 
      ( Type         => Fixed_Priority_Policy,
        The_Priority => 1,
        Preassigned  => NO),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => tarea_2,
   Server_Sched_Parameters    => 
      ( Type                   => Polling_Policy,
        The_Priority           => 1,
        Preassigned            => NO,
        Polling_Period         => 100.000,
        Polling_Worst_Overhead => 12.00,
        Polling_Best_Overhead  => 14.00,
        Polling_Avg_Overhead   => 13.00),
   Scheduler                  => cpu_1);

Scheduling_Server (
   Type                       => Regular,
   Name                       => tarea_3,
   Server_Sched_Parameters    => 
      ( Type                       => Sporadic_Server_Policy,
        Normal_Priority            => 3,
        Preassigned                => YES,
        Background_Priority        => 5,
        Initial_Capacity           => 5.000,
        Replenishment_Period       => 8.000,
        Max_Pending_Replenishments => 1),
   Scheduler                  => cpu_1);

Shared_Resource (
   Type        => Immediate_Ceiling_Resource,
   Name        => dato_pcp_1,
   Ceiling     => 5,
   Preassigned => YES);

Shared_Resource (
   Type        => Immediate_Ceiling_Resource,
   Name        => dato_pcp_2,
   Ceiling     => 32767,
   Preassigned => NO);

Shared_Resource (
   Type     => Priority_Inheritance_Resource,
   Name     => dato_pi_1);

Shared_Resource (
   Type     => Priority_Inheritance_Resource,
   Name     => dato_pi_2);

Shared_Resource (
   Type             => SRP_Resource,
   Name             => dato_srp_1,
   Preemption_Level => 1300,
   Preassigned      => YES);

Operation (
   Type                       => Simple,
   Name                       => rs232_p_send,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => rs232_p_receive,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => rs232_c_send,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => rs232_c_receive,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => rtep_send,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => rtep_receive,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => rtep_isr_op,
   Worst_Case_Execution_Time  => 25.00,
   Avg_Case_Execution_Time    => 10.00,
   Best_Case_Execution_Time   => 1.00);

Operation (
   Type                       => Simple,
   Name                       => tco,
   Worst_Case_Execution_Time  => 25.00,
   Avg_Case_Execution_Time    => 12.00,
   Best_Case_Execution_Time   => 2.00);

Operation (
   Type                       => Simple,
   Name                       => tmo,
   Worst_Case_Execution_Time  => 25.00,
   Avg_Case_Execution_Time    => 12.00,
   Best_Case_Execution_Time   => 2.00);

Operation (
   Type                       => Simple,
   Name                       => pdo,
   Worst_Case_Execution_Time  => 25.00,
   Avg_Case_Execution_Time    => 12.00,
   Best_Case_Execution_Time   => 2.00);

Operation (
   Type                       => Simple,
   Name                       => tro,
   Worst_Case_Execution_Time  => 25.00,
   Avg_Case_Execution_Time    => 12.00,
   Best_Case_Execution_Time   => 2.00);

Operation (
   Type                       => Simple,
   Name                       => pro,
   Worst_Case_Execution_Time  => 25.00,
   Avg_Case_Execution_Time    => 12.00,
   Best_Case_Execution_Time   => 2.00);

Operation (
   Type                       => Simple,
   Name                       => ethernet_send,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => ethernet_receive,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => ethernet_send1,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => ethernet_receive1,
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00);

Operation (
   Type                       => Simple,
   Name                       => proc_1,
   New_Sched_Parameters       => 
      ( Type         => Overridden_Fixed_Priority,
        The_Priority => 5),
   Worst_Case_Execution_Time  => 250.00,
   Avg_Case_Execution_Time    => 100.00,
   Best_Case_Execution_Time   => 10.00,
   Shared_Resources_To_Lock   => 
      ( dato_pcp_1,
        dato_pcp_2),
   Shared_Resources_To_Unlock => 
      ( dato_pcp_2,
        dato_pcp_1));

Operation (
   Type                       => Simple,
   Name                       => proc_2,
   Worst_Case_Execution_Time  => 500.00,
   Avg_Case_Execution_Time    => 300.00,
   Best_Case_Execution_Time   => 100.00,
   Shared_Resources_To_Lock   => 
      ( dato_pcp_1),
   Shared_Resources_To_Unlock => 
      ( dato_pcp_1));

Operation (
   Type                       => Simple,
   Name                       => proc_3,
   Worst_Case_Execution_Time  => 5000.0,
   Avg_Case_Execution_Time    => 3000.0,
   Best_Case_Execution_Time   => 1000.0,
   Shared_Resources_To_Lock   => 
      ( dato_pcp_1,
        dato_pcp_2),
   Shared_Resources_To_Unlock => 
      ( dato_pcp_1,
        dato_pcp_2));

Operation (
   Type                     => Composite,
   Name                     => proc_4,
   New_Sched_Parameters     => 
      ( Type         => Overridden_Permanent_FP,
        The_Priority => 7),
   Composite_Operation_List => 
      ( proc_1,
        proc_2));

Operation (
   Type                       => Simple,
   Name                       => mensaje_1,
   Worst_Case_Execution_Time  => 5000.0,
   Avg_Case_Execution_Time    => 3000.0,
   Best_Case_Execution_Time   => 1000.0,
   Shared_Resources_To_Lock   => 
      ( dato_pi_1,
        dato_pi_2),
   Shared_Resources_To_Unlock => 
      ( dato_pi_2,
        dato_pi_1));

Transaction (
   Type            => regular,
   Name            => trans_1,
   External_Events => 
      ( ( Type       => Periodic,
          Name       => ep1,
          Period     => 1000.00,
          Max_Jitter => 50.000,
          Phase      => 150.000),
        ( Type             => Sporadic,
          Name             => es1,
          Avg_Interarrival => 2000.00,
          Distribution     => UNIFORM,
          Min_Interarrival => 1000.00),
        ( Type             => Unbounded,
          Name             => eu1,
          Avg_Interarrival => 5000.00,
          Distribution     => POISSON),
        ( Type             => Bursty,
          Name             => eb1,
          Avg_Interarrival => 500.000,
          Distribution     => UNIFORM,
          Bound_Interval   => 1000.00,
          Max_Arrivals     => 10)),
   Internal_Events => 
      ( ( Type => Regular,
          Name => an1,
          Timing_Requirements => 
            ( Type             => Hard_Global_Deadline,
              Deadline         => 10000.00,
              Referenced_Event => ep1)),
        ( Type => Regular,
          Name => an2,
          Timing_Requirements => 
            ( Type              => Composite,
              Requirements_List => 
                 ( ( Type     => Soft_Local_Deadline,
                     Deadline => 10000.00),
                   ( Type             => Hard_Global_Deadline,
                     Deadline         => 10000.00,
                     Referenced_Event => ep1),
                   ( Type             => Soft_Global_Deadline,
                     Deadline         => 10000.00,
                     Referenced_Event => ep1),
                   ( Type     => Hard_Local_Deadline,
                     Deadline => 10000.00),
                   ( Type             => Global_Max_Miss_Ratio,
                     Deadline         => 10000.00,
                     Referenced_Event => ep1,
                     Ratio            => 2.30),
                   ( Type     => Local_Max_Miss_Ratio,
                     Deadline => 10000.00,
                     Ratio    => 2.30),
                   ( Type             => Global_Max_Miss_Ratio,
                     Deadline         => 10000.00,
                     Referenced_Event => ep1,
                     Ratio            => 23.00),
                   ( Type     => Local_Max_Miss_Ratio,
                     Deadline => 10000.00,
                     Ratio    => 23.00),
                   ( Type              => Max_Output_Jitter_Req,
                     Referenced_Event  => es1,
                     Max_Output_Jitter => 4000.00)))),
        ( Type => Regular,
          Name => an3),
        ( Type => Regular,
          Name => an4,
          Timing_Requirements => 
            ( Type             => Soft_Global_Deadline,
              Deadline         => 10000.00,
              Referenced_Event => ep1)),
        ( Type => Regular,
          Name => an5),
        ( Type => Regular,
          Name => an6),
        ( Type => Regular,
          Name => an7),
        ( Type => Regular,
          Name => an8),
        ( Type => Regular,
          Name => an9),
        ( Type => Regular,
          Name => an10),
        ( Type => Regular,
          Name => i1),
        ( Type => Regular,
          Name => i2),
        ( Type => Regular,
          Name => i3),
        ( Type => Regular,
          Name => ai1),
        ( Type => Regular,
          Name => ai2),
        ( Type => Regular,
          Name => ao1,
          Timing_Requirements => 
            ( Type     => Hard_Local_Deadline,
              Deadline => 10000.00)),
        ( Type => Regular,
          Name => ao2,
          Timing_Requirements => 
            ( Type              => Max_Output_Jitter_Req,
              Referenced_Event  => ep1,
              Max_Output_Jitter => 4000.00))),
   Event_Handlers  => 
      ( (Type               => Activity,
         Input_Event        => an8,
         Output_Event       => an1,
         Activity_Operation => proc_1,
         Activity_Server    => tarea_x),
        (Type               => Activity,
         Input_Event        => an10,
         Output_Event       => an2,
         Activity_Operation => proc_2,
         Activity_Server    => tarea_2),
        (Type               => System_Timed_Activity,
         Input_Event        => an5,
         Output_Event       => ao1,
         Activity_Operation => proc_3,
         Activity_Server    => tarea_3),
        (Type               => Activity,
         Input_Event        => an4,
         Output_Event       => ao2,
         Activity_Operation => proc_4,
         Activity_Server    => tarea_1),
        (Type               => Rate_Divisor,
         Input_Event        => an6,
         Output_Event       => an4,
         Rate_Factor        => 10),
        (Type               => Delay,
         Input_Event        => ai1,
         Output_Event       => an8,
         Delay_Max_Interval => 1000.00,
         Delay_Min_Interval => 1000.00),
        (Type               => Offset,
         Input_Event        => ai2,
         Output_Event       => an10,
         Delay_Max_Interval => 1000.00,
         Delay_Min_Interval => 1000.00,
         Referenced_Event   => ep1),
        (Type             => Concentrator,
         Output_Event     => i1,
         Input_Events_List=> 
            ( ep1,
              es1)),
        (Type             => Barrier,
         Output_Event     => i2,
         Input_Events_List=> 
            ( eu1,
              eb1)),
        (Type              => Delivery_Server,
         Delivery_Policy   => RANDOM,
         Input_Event       => i1,
         Output_Events_List=> 
            ( an3,
              an5,
              i3)),
        (Type              => Query_Server,
         Request_Policy    => FIFO,
         Input_Event       => i2,
         Output_Events_List=> 
            ( an6,
              ai1,
              ai2)),
        (Type              => Multicast,
         Input_Event       => i3,
         Output_Events_List=> 
            ( an7,
              an9))));

Transaction (
   Type            => regular,
   Name            => trans_2,
   External_Events => 
      ( ( Type  => Singular,
          Name  => entrada,
          Phase => 10.000)),
   Internal_Events => 
      ( ( Type => Regular,
          Name => salida,
          Timing_Requirements => 
            ( Type             => Soft_Global_Deadline,
              Deadline         => 3.000,
              Referenced_Event => entrada))),
   Event_Handlers  => 
      ( (Type               => Activity,
         Input_Event        => entrada,
         Output_Event       => salida,
         Activity_Operation => proc_4,
         Activity_Server    => tarea_2)));

