software.aadl 2.47 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
--  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 344 2007-04-17 14:48:16Z zalila $

package Software
public
  with Data_Model;

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

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

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

subprogram produce_packet_init_spg
properties
  source_language => C;
  source_name     => "user_produce_pkts_init";
  source_text     => ("pinger.c");
end produce_packet_init_spg;

subprogram produce_packet_spg
properties
  source_language => C;
  source_name     => "user_produce_pkts";
  source_text     => ("pinger.c");
end produce_packet_spg;

subprogram Do_Ping_Spg
properties
  source_language => C;
  source_name     => "user_do_ping_spg";
  source_text     => ("pinger.c");
end Do_Ping_Spg;

subprogram Ping_Spg
features
  Data_Sink : in parameter Simple_Type;
properties
  source_language => C;
  source_name     => "user_ping_spg";
  source_text     => ("pingme.c");
end Ping_Spg;


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

thread packet_producer
end packet_producer;

thread implementation packet_producer.i
calls 
Mycalls: {
  produce : subprogram produce_packet_spg;
};
properties
  Initialize_Entrypoint              => classifier (software::produce_packet_init_spg);
  Dispatch_Protocol                  => Periodic;
  Period                             => 500 Ms;
  Deadline                           => 500 ms;
  Priority                           => 2;
end packet_producer.i;

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;
};
properties
  Recover_Entrypoint_Source_Text     => "recover";
  Dispatch_Protocol                  => Periodic;
  Period                             => 1000 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 
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;