toy_example_xenomai_native.aadl 5.49 KB
Newer Older
1
--  This AADL model is derived from the AADL model published in the
yoogx's avatar
yoogx committed
2
--  IST-ASSERT d3.3.1-3 deliverable.
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

--  $Id: toy_example.aadl 407 2007-06-19 15:24:28Z delange $

package TOY_Example
public
  with Cheddar_Properties, Deployment, Data_Model;

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

subprogram Update
features
  this : requires data access POS.Impl;
properties
  source_language => C;
  source_name     => "user_update";
  source_text     => ("toy.c");
end Update;
--  This subprogram updates the internal value of POS

subprogram Read_POS
features
  this : requires data access POS.Impl;
properties
  source_language => C;
  source_name     => "user_read";
  source_text     => ("toy.c");
end Read_POS;
--  This subprogram displays the internal value of POS

subprogram GNC_Job
properties
  source_language => C;
  source_name     => "user_gnc_job";
  source_text     => ("toy.c");
end GNC_Job;
--  This subprogram consumes the CPU during a given amount of time

subprogram TMTC_Job
properties
  source_language => C;
  source_name     => "user_tmtc_job";
  source_text     => ("toy.c");
end TMTC_Job;
--  This subprogram consumes the CPU during a given amount of time

--  The two subprogram below are used for analyze purpose

subprogram GNC_Identity
properties
  source_language => C;
  source_name     => "user_gnc_identity";
  source_text     => ("toy.c");
end GNC_Identity;

subprogram TMTC_Identity
properties
  source_language => C;
  source_name     => "user_tmtc_identity";
  source_text     => ("toy.c");
end TMTC_Identity;

--------------------------
--  Subprogram Wrappers --
--------------------------

subprogram GNC_Thread_Wrapper
features
  GNC_POS : requires data access POS.Impl;
end GNC_Thread_Wrapper;

subprogram implementation GNC_Thread_Wrapper.Impl
yoogx's avatar
yoogx committed
76
calls
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Mycalls: {
  Welcome     : subprogram GNC_Identity;
  Update_POS  : subprogram POS.Update;
  GNC_Job     : subprogram GNC_Job;
  Read_POS    : subprogram POS.Read;
  Bye         : subprogram GNC_Identity;
};
connections
  Cnx_GNC_1 : data access GNC_POS -> Update_POS.this;
  Cnx_GNC_2 : data access GNC_POS -> Read_POS.this;
end GNC_Thread_Wrapper.Impl;

subprogram TMTC_Thread_Wrapper
features
  TMTC_POS : requires data access POS.Impl;
end TMTC_Thread_Wrapper;

subprogram implementation TMTC_Thread_Wrapper.Impl
yoogx's avatar
yoogx committed
95
calls
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Mycalls: {
  Welcome  : subprogram TMTC_Identity;
  TMTC_Job : subprogram TMTC_Job;
  Update   : subprogram POS.Update;
  Bye      : subprogram TMTC_Identity;
};
connections
  Cnx_TMTC_1 : data access TMTC_POS -> Update.this;
end TMTC_Thread_Wrapper.Impl;

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

thread GNC_Thread
features
  GNC_POS : requires data access POS.Impl;
end GNC_Thread;

thread implementation GNC_Thread.Impl
yoogx's avatar
yoogx committed
116
calls
117
118
119
120
121
122
123
124
125
126
Mycalls: {
  GNC_Thread_Wrapper : subprogram GNC_Thread_Wrapper.Impl;
};
connections
  Cnx_GNC_1 : data access GNC_POS -> GNC_Thread_Wrapper.GNC_POS;
properties
  Dispatch_Protocol                  => Periodic;
  Period                             => 1000 ms;
  Compute_Execution_time             => 0 ms .. 600 ms;
  Deadline                           => 1000 ms;
127
  Cheddar_Properties::Fixed_Priority => 50;
128
129
130
131
132
133
134
135
end GNC_thread.Impl;

thread TMTC_Thread
features
  TMTC_POS : requires data access POS.Impl;
end TMTC_Thread;

thread implementation TMTC_Thread.Impl
yoogx's avatar
yoogx committed
136
calls
137
138
139
140
141
142
143
144
145
146
Mycalls: {
  TMTC_Thread_Wrapper : subprogram TMTC_Thread_Wrapper.Impl;
};
connections
  Cnx_TMTC_1 : data access TMTC_POS -> TMTC_Thread_Wrapper.TMTC_POS;
properties
  Dispatch_Protocol                  => Periodic;
  Period                             => 100 ms;
  Compute_Execution_time             => 0 ms .. 50 ms;
  Deadline                           => 100 ms;
147
  Cheddar_Properties::Fixed_Priority => 40;
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
end TMTC_Thread.Impl;

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

process Toy_Example_Proc
end Toy_Example_Proc;

process implementation Toy_Example_Proc.Impl
subcomponents
  GNC_Th   : thread GNC_thread.Impl;
  TMTC_Th  : thread TMTC_Thread.Impl;
  POS_Data : data POS.Impl;
connections
  Cnx_Proc_2 : data access POS_Data -> GNC_Th.GNC_POS;
  Cnx_Proc_3 : data access POS_Data -> TMTC_Th.TMTC_POS;
end Toy_Example_Proc.Impl;

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

processor the_processor
properties
  Deployment::Execution_Platform => LINUX32_XENOMAI_NATIVE;
174
  Priority_Range => 0 .. 99;
175
176
177
178
179
180
181
182
183
184
185
186
end the_processor;

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

system toy_example
end toy_example;

system implementation toy_example.sample_1
subcomponents
  P1            : processor the_processor;
yoogx's avatar
yoogx committed
187
188
  GNC_TMTC_POS  : process Toy_Example_Proc.Impl;

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
properties
  Actual_Processor_Binding => reference (P1) applies to GNC_TMTC_POS;
end toy_example.sample_1;

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

--  POS_Internal_Type is the internal type of the POS shared variable

data POS_Internal_Type
properties
  Data_Model::Data_Representation => Integer;
end POS_Internal_Type;

--  POS is a shared variable between the nodes GNC and TMTC. Its
--  internal type is defined in POS.Impl. Therefore, POS.Impl is the
--  data component types that should be used in the remaining of the
--  model.

data POS
features
  Update : provides subprogram access Update;
  Read   : provides subprogram access Read_POS;
properties
  Priority => 250;
end POS;

data implementation POS.Impl
subcomponents
  Field : data POS_Internal_Type;
  spgUpdate : subprogram Update;
yoogx's avatar
yoogx committed
221
  spgRead   : subprogram Read_POS;
222
223
224
225
226
227
228
229
230
231

connections
  Cnx_Pos_1 : subprogram access SpgUpdate -> Update;
  Cnx_Pos_2 : subprogram access SpgRead -> Read;

properties
  Data_Model::Data_Representation => Struct;
end POS.Impl;

end TOY_Example;