lua-ping.aadl 2.54 KB
Newer Older
jdelange's avatar
jdelange committed
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 96 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 126 127 128 129 130 131 132 133 134
package Software
public
  with Data_Model;

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

data Simple_Type
properties
  Type_Source_Name => "custom_int"; 
  Data_Model::Data_Representation => Integer;
  Source_Text => ("ping");
  Source_Data_Size => 8 Bytes;
end Simple_Type;

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

subprogram Do_Ping_Spg
features
  Data_Source : out parameter Simple_Type;
properties
  source_language => lua;
  source_name     => "do_ping";
  source_text     => ("ping.lua");
end Do_Ping_Spg;

subprogram Ping_Spg
features
  Data_Sink : in parameter Simple_Type;
properties
  source_language => LUA;
  source_name     => "receive_ping";
  source_text     => ("ping.lua");
end Ping_Spg;


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

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

thread implementation P.Impl
calls 
Mycalls: {
  P_Spg : subprogram Do_Ping_Spg;
};
connections
  parameter P_Spg.Data_Source -> Data_Source;
properties
  Dispatch_Protocol                  => Periodic;
  Period                             => 10 Ms;
  Deadline                           => 10 ms;
  Priority                           => 2;
end P.Impl;

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

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

end Software;

package lua_ping
public
  with Deployment;
  with Software;

---------------
-- Processor --
---------------

processor the_processor
properties
  Deployment::Execution_Platform => native;
end the_processor;

processor implementation the_processor.Impl
properties 
   Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
   Priority_Range => 0 .. 255;
end the_processor.Impl;

---------------
-- Processes --
---------------

process A
end A;

process implementation A.Impl
subcomponents
  Pinger        : thread  Software::P.Impl;
  Ping_Me       : thread  Software::Q.Impl;
connections
  port Pinger.Data_Source -> Ping_Me.Data_Sink;
end A.Impl;

------------
-- System --
------------

system lua_ping_local
end lua_ping_local;

system implementation lua_ping_local.i
subcomponents
  Node_A : process A.Impl;
  CPU : processor the_processor.Impl;
properties
  actual_processor_binding => (reference (CPU)) applies to Node_A;
end lua_ping_local.i;

end lua_ping;