software.aadl 2.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
--  This AADL model illustrates how to model a simple interaction
--  between tasks, in a local or distributed environment.
--
--  One task pings another, sending a data periodically.
--
--  $Id: software.aadl 6611 2009-06-02 10:41:33Z hugues $

package Software
public
  with Data_Model;

----------
-- Data --
----------

data Simple_Type
properties
  Data_Model::Data_Representation => integer;
end Simple_Type;

data Opaque_Type
properties
  Source_Language => Ada95;
  Type_Source_Name => "User_Types.The_Opaque_Type";
end Opaque_Type;

-----------------
-- Subprograms --
-----------------

subprogram Do_Ping_Spg
features
  Data_Source : out parameter Opaque_Type;
end Do_Ping_Spg;

subprogram Do_Convert_Spg
features
  Data_Sink : in parameter Opaque_Type;
  Data_Source : out parameter Simple_Type;
end Do_Convert_Spg;

subprogram implementation Do_Ping_Spg.Impl
properties
  source_language => Ada95;
  source_name     => "Ping.Do_Ping_Spg";
end Do_Ping_Spg.Impl;

subprogram implementation Do_Convert_Spg.Impl
properties
  source_language => Ada95;
  source_name     => "Ping.Do_Convert_Spg";
end Do_Convert_Spg.Impl;

subprogram Ping_Spg
features
  Data_Sink : in parameter Simple_Type;
properties
  source_language => Ada95;
  source_name     => "Pinged.Ping_Spg";
end Ping_Spg;

-------------
-- Threads --
-------------

subprogram P_Wrapper
features
  Data_Source : out parameter Simple_Type;
end P_Wrapper;

subprogram implementation P_Wrapper.Impl
calls 
Mycalls : {
  P_Spg : subprogram Do_Ping_Spg.Impl;
  C_Spg : subprogram Do_Convert_Spg.Impl;
};
connections
  parameter P_Spg.Data_Source -> C_Spg.Data_Sink;
  parameter C_Spg.Data_Source -> Data_Source;
end P_Wrapper.Impl;

thread P
features
  Data_Source : out event data port Simple_Type;
end P;

thread implementation P.Impl
calls 
Mycall : {
  P_Spg : subprogram P_Wrapper.Impl;
};
connections
  parameter P_Spg.Data_Source -> Data_Source;
properties
  Initialize_Entrypoint_Source_Text  => "Msgs.Welcome_Pinger";
96
  Activate_Entrypoint_Source_Text    => "Msgs.Welcome_Pinger";
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
  Recover_Entrypoint_Source_Text     => "Msgs.Recover";
  Dispatch_Protocol                  => Periodic;
  Period                             => 1000 Ms;
  Compute_Execution_time             => 0 ms .. 3 ms;
  Deadline                           => 1000 ms;
  Priority                           => 2;
end P.Impl;

thread Q
features
  Data_Sink : in event data port Simple_Type;
end Q;

thread implementation Q.Impl
calls 
Mycall : {
  Q_Spg : subprogram Ping_Spg;
};
connections
  parameter Data_Sink -> Q_Spg.Data_Sink;
properties
  Dispatch_Protocol                  => Sporadic;
  Period                             => 10 Ms;
  deadline                           => 10 Ms;
  Compute_Execution_time             => 0 ms .. 3 ms;
  Priority                           => 1;
end Q.Impl;

end Software;