-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.aadl
311 lines (246 loc) · 8.79 KB
/
main.aadl
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
135
136
137
138
139
140
141
142
143
144
145
146
147
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
package thermostat_arch
public
with securityProperties;
system thermostat
end thermostat;
system implementation thermostat.impl
subcomponents
THERMOSTAT_CONTROLLER: system Thermostat_Controller;
TEMP_SENSOR:system Temp_sensor;
GENERATOR:system Generator;
LCD_DISPLAY: device LCD_Display;
MOBILE_DISPLAY: device Mobile_Display;
BATTERY: device Battery;
this_Bus: bus HWConnection.impl;
this_processor: processor MainProcessor.impl;
connections
c2: port LCD_DISPLAY.desired_temp -> THERMOSTAT_CONTROLLER.desired_temp;
c3: port THERMOSTAT_CONTROLLER. control_out -> GENERATOR.control_in;
c4: port GENERATOR.control_out -> THERMOSTAT_CONTROLLER.control_in;
c5: port THERMOSTAT_CONTROLLER. display_temp -> LCD_DISPLAY.update_temp;
c6: port LCD_DISPLAY.lower_desired_auto -> THERMOSTAT_CONTROLLER.lower_desired_auto;
c7:port LCD_DISPLAY.upper_desired_auto -> THERMOSTAT_CONTROLLER.upper_desired_auto;
c8:port THERMOSTAT_CONTROLLER.alarm->LCD_DISPLAY.alarm;
c9:port LCD_DISPLAY.set_echo -> THERMOSTAT_CONTROLLER.echo_mode;
c10: port THERMOSTAT_CONTROLLER. display_temp -> MOBILE_DISPLAY.update_temp;
c11: port MOBILE_DISPLAY.lower_desired_auto -> THERMOSTAT_CONTROLLER.lower_desired_auto;
c12:port MOBILE_DISPLAY.upper_desired_auto -> THERMOSTAT_CONTROLLER.upper_desired_auto;
c13:port MOBILE_DISPLAY.location->THERMOSTAT_CONTROLLER.Location_controller;
c14:port MOBILE_DISPLAY.set_echo -> THERMOSTAT_CONTROLLER.echo_mode;
c15: port THERMOSTAT_CONTROLLER. display_temp -> MOBILE_DISPLAY.update_temp;
c16: port MOBILE_DISPLAY.lower_desired_auto -> THERMOSTAT_CONTROLLER.lower_desired_auto;
c17:port MOBILE_DISPLAY.upper_desired_auto -> THERMOSTAT_CONTROLLER.upper_desired_auto;
c18: port MOBILE_DISPLAY.desired_temp -> THERMOSTAT_CONTROLLER.desired_temp;
c21:port BATTERY.Status_out->THERMOSTAT_CONTROLLER.Status_in;
c22:port THERMOSTAT_CONTROLLER.Status_out->LCD_DISPLAY.Status_out;
bus_send : bus access this_Bus->TEMP_SENSOR.Bus_Access;
bus_motion: bus access this_Bus-> LCD_DISPLAY.Bus_Access;
bus_magnetic: bus access this_Bus-> THERMOSTAT_CONTROLLER.Bus_Access;
bus_smoke: bus access this_Bus-> MOBILE_DISPLAY.Bus_Access;
annex Resolute{**
prove(print_aadl(this))
prove (SystemWideReq1())
prove (SystemWideReq2())
prove (Security_Features(this))
prove (Security_Connections(this))
prove (Security_Data(this))
**};
end thermostat.impl;
processor MainProcessor
features
Bus_Access: requires bus access HWCOnnection;
curr_temp: in event port;
end MainProcessor;
processor implementation MainProcessor.impl
subcomponents
this_ram: Memory Ram;
end MainProcessor.impl;
memory Ram
end Ram;
bus HWConnection
end HWConnection;
bus implementation HWConnection.impl
end HWConnection.impl;
system Thermostat_Controller
features
curr_temp: in event port;
desired_temp: in event port;
control_out: out event port;
control_in: in event port;
display_temp: out event port;
lower_desired_auto: in event port;
upper_desired_auto: in event port;
echo_mode:in event port;
alarm:out event port;
Location_controller:in event port;
status_in:in event port;
status_out:out event port;
Bus_Access: requires bus access HWCOnnection;
annex EMV2{**
use types Thermostat::error_library;
use behavior Thermostat::error_library::ThermostatError;
error propagations
curr_temp :in propagation{TemperatureSensorFailure};
alarm : out propagation{InvalidAlarm};
Location_controller : in propagation{LocationError};
control_in : in propagation{SmokeDetectionFailure};
status_out : out propagation{InvalidAlarm};
status_in : in propagation{InvalidAlarm};
flows
Path1: error sink curr_temp;
Path2 : error source alarm;
Path3 : error sink Location_controller;
Path4 : error sink control_in;
Path5 : error path status_in -> status_out;
end propagations;
**};
end Thermostat_Controller;
system implementation Thermostat_Controller.impl
subcomponents
THERMOSTAT_MODE: process Thermostat_Mode;
connections
cn1:port lower_desired_auto -> THERMOSTAT_MODE.lower_desired_auto;
cn2:port upper_desired_auto -> THERMOSTAT_MODE.upper_desired_auto;
cn3:port echo_mode -> THERMOSTAT_MODE.echo_mode;
cn4:port Location_controller -> THERMOSTAT_MODE.Location_controller;
end Thermostat_Controller.impl;
process Thermostat_Mode
features
lower_desired_auto: in event port;
upper_desired_auto: in event port;
echo_mode: in event port;
Location_controller: in event port;
out_port:out event port;
end Thermostat_Mode;
process implementation Thermostat_Mode.impl
subcomponents
ECHO: thread echo;
LOCATION: thread location;
AUTO:thread auto;
connections
cn1:port lower_desired_auto -> AUTO.lower_desired_auto;
cn2:port upper_desired_auto -> AUTO.upper_desired_auto;
cn3:port echo_mode -> ECHO.echo_in;
cn4:port Location_controller -> LOCATION.location_in;
cn5:port ECHO.echo_out->out_port;
cn6:port location.location_out->out_port;
cn7:port auto.desired_out->out_port;
end Thermostat_Mode.impl;
thread echo
features
echo_in: in event port;
echo_out: out event port;
end echo;
thread implementation echo.impl
end echo.impl;
thread location
features
location_in: in event port;
location_out: out event port;
end location;
thread implementation location.impl
end location.impl;
thread auto
features
lower_desired_auto: in event port;
upper_desired_auto: in event port;
desired_out:out event port;
end auto;
thread implementation auto.impl
end auto.impl;
system Temp_sensor
features
air: in data port{securityProperties::entryExitPointPrivileges=>1.0;securityProperties::entryExitPointAccessRights=>5.0;};
curr_temp: out data port{securityProperties::entryExitPointPrivileges=>3.0;securityProperties::entryExitPointAccessRights=>6.0;};
Bus_Access: requires bus access HWCOnnection;
annex EMV2{**
use types Thermostat::error_library;
use behavior Thermostat::error_library::ThermostatError;
error propagations
curr_temp :out propagation{TemperatureSensorFailure};
flows
Path1: error source curr_temp ;
end propagations;
**};
end Temp_sensor;
system implementation Temp_sensor.impl
end Temp_sensor.impl;
system Generator
features
control_in: in event port;
control_out: out event port;
annex EMV2{**
use types Thermostat::error_library;
use behavior Thermostat::error_library::ThermostatError;
error propagations
control_out:out propagation{SmokeDetectionFailure};
flows
Path4: error source control_out ;
end propagations;
**};
end Generator;
system implementation Generator.impl
end Generator.impl;
Device LCD_Display
features
desired_temp: out event port;
curr_temp: in event port;
set_echo:out event port;
update_temp:in event port;
lower_desired_auto:out event port;
upper_desired_auto:out event port;
alarm:in event port;
status_out:in event port;
Bus_Access: requires bus access HWCOnnection;
annex EMV2{**
use types Thermostat::error_library;
use behavior Thermostat::error_library::ThermostatError;
error propagations
alarm : in propagation{InvalidAlarm};
status_out:in propagation{InvalidAlarm};
flows
Path2 : error sink alarm;
Path5 : error sink status_out;
end propagations;
**};
end LCD_Display;
device implementation LCD_Display.impl
end LCD_Display.impl;
Device Mobile_Display
features
desired_temp: out event port;
curr_temp: in event port;
set_echo:out event port;
update_temp:in event port;
lower_desired_auto:out event port;
upper_desired_auto:out event port;
Location:out event port;
Bus_Access: requires bus access HWCOnnection;
annex EMV2{**
use types Thermostat::error_library;
use behavior Thermostat::error_library::ThermostatError;
error propagations
Location :out propagation{LocationError};
flows
Path3: error source Location ;
end propagations;
**};
end Mobile_Display;
device implementation Mobile_Display.impl
end Mobile_Display.impl;
device Battery
features
status_out: out event port;
annex EMV2{**
use types Thermostat::error_library;
use behavior Thermostat::error_library::ThermostatError;
error propagations
status_out : out propagation{InvalidAlarm};
flows
Path5 : error source status_out;
end propagations;
**};
end Battery;
device implementation Battery.impl
end Battery.impl;
end thermostat_arch;