build-script.sh 13.7 KB
Newer Older
1
#!/bin/bash -e
2

3
# This script will build your TASTE system.
4
5
6

# You should not change this file as it was automatically generated.

7
8
9
10
# If you need additional preprocessing, there are three hook files
# that you can provide and that are called dring the build:
# user_init_pre.sh, user_init_post.sh and user_init_last.sh
# These files will never get overwritten by TASTE.'
11
12
13
14
15
16
17

# Inside these files you may set some environment variables:
#    C_INCLUDE_PATH=/usr/include/xenomai/analogy/:${C_INCLUDE_PATH}
#    unset USE_POHIC   

CWD=$(pwd)

18
if [ -t 1 ] ; then
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    COLORON="\e[1m\e[32m"
    COLOROFF="\e[0m"
else
    COLORON=""
    COLOROFF=""
fi
INFO="${COLORON}[INFO]${COLOROFF}"

if [ -f user_init_pre.sh ]
then
    echo -e "${INFO} Executing user-defined init script"
    source user_init_pre.sh
fi

# Use PolyORB-HI-C runtime
USE_POHIC=1

36
37
38
# Set Debug mode by default
DEBUG_MODE=--debug

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Detect models from Ellidiss tools v2, and convert them to 1.3
INTERFACEVIEW=InterfaceView.aadl
grep "version => \"2" InterfaceView.aadl >/dev/null && {
    echo -e "${INFO} Converting interface view from V2 to V1.3"
    TASTE --load-interface-view InterfaceView.aadl --export-interface-view-to-1_3 __iv_1_3.aadl
    INTERFACEVIEW=__iv_1_3.aadl
};

if [ -z "$DEPLOYMENTVIEW" ]
then
    DEPLOYMENTVIEW=DeploymentView.aadl
fi

# Detect models from Ellidiss tools v2, and convert them to 1.3
grep "version => \"2" "$DEPLOYMENTVIEW" >/dev/null && {
    echo -e "${INFO} Converting deployment view from V2 to V1.3"
    TASTE --load-deployment-view "$DEPLOYMENTVIEW" --export-deployment-view-to-1_3 __dv_1_3.aadl
    DEPLOYMENTVIEW=__dv_1_3.aadl
};

SKELS="./"

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Check if Dataview references existing files 
mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j /tmp/dv.asn

# Generate code for OpenGEODE function st01_acceptance
cd "$SKELS"/st01_acceptance && opengeode --toAda st01_acceptance.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function st02_on_off_cmds
cd "$SKELS"/st02_on_off_cmds && opengeode --toAda st02_on_off_cmds.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function st01_execution
cd "$SKELS"/st01_execution && opengeode --toAda st01_execution.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function tm_st01
cd "$SKELS"/tm_st01 && opengeode --toAda tm_st01.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function processtc
cd "$SKELS"/processtc && opengeode --toAda processtc.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function sendtm
cd "$SKELS"/sendtm && opengeode --toAda sendtm.pr system_structure.pr && cd $OLDPWD
81

82
83
# Generate code for OpenGEODE function obsw_routing
cd "$SKELS"/obsw_routing && opengeode --toAda obsw_routing.pr system_structure.pr && cd $OLDPWD
84

85
86
87
# Generate code for OpenGEODE function acceptance_cpdu1
cd "$SKELS"/acceptance_cpdu1 && opengeode --toAda acceptance_cpdu1.pr system_structure.pr && cd $OLDPWD

88
89
# Generate code for OpenGEODE function cpdu1_cmds
cd "$SKELS"/cpdu1_cmds && opengeode --toAda cpdu1_cmds.pr system_structure.pr && cd $OLDPWD
90
91
92
93
94
95
96

# Generate code for OpenGEODE function execution_cpdu1
cd "$SKELS"/execution_cpdu1 && opengeode --toAda execution_cpdu1.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function tm_cpdu1
cd "$SKELS"/tm_cpdu1 && opengeode --toAda tm_cpdu1.pr system_structure.pr && cd $OLDPWD

97
98
# Generate code for OpenGEODE function acceptance_hk
cd "$SKELS"/acceptance_hk && opengeode --toAda acceptance_hk.pr system_structure.pr && cd $OLDPWD
Daniel Tonoiu's avatar
Daniel Tonoiu committed
99
100
101
102

# Generate code for OpenGEODE function hk_service
cd "$SKELS"/hk_service && opengeode --toAda hk_service.pr system_structure.pr && cd $OLDPWD

103
104
# Generate code for OpenGEODE function execution_hk
cd "$SKELS"/execution_hk && opengeode --toAda execution_hk.pr system_structure.pr && cd $OLDPWD
Daniel Tonoiu's avatar
Daniel Tonoiu committed
105

106
107
# Generate code for OpenGEODE function tm_hk
cd "$SKELS"/tm_hk && opengeode --toAda tm_hk.pr system_structure.pr && cd $OLDPWD
Daniel Tonoiu's avatar
Daniel Tonoiu committed
108

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Generate code for OpenGEODE function event_report
cd "$SKELS"/event_report && opengeode --toAda event_report.pr system_structure.pr && cd $OLDPWD

# Generate code for function execution_obm (instance of OpenGEODE function execution_generic)
cd "$SKELS"/execution_obm && opengeode --toAda system_structure.pr ../execution_generic/execution_generic.pr && rm -f execution_generic.ad* && cd $OLDPWD

# Generate code for OpenGEODE function tm_obm
cd "$SKELS"/tm_obm && opengeode --toAda tm_obm.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function on_board_monitoring
cd "$SKELS"/on_board_monitoring && opengeode --toAda on_board_monitoring.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function acceptance_st12
cd "$SKELS"/acceptance_st12 && opengeode --toAda acceptance_st12.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function execution_generic
cd "$SKELS"/execution_generic && opengeode --toAda execution_generic.pr system_structure.pr && cd $OLDPWD

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Generate code for OpenGEODE function acceptance_st09
cd "$SKELS"/acceptance_st09 && opengeode --toAda acceptance_st09.pr system_structure.pr && cd $OLDPWD

# Generate code for function execution_st09 (instance of OpenGEODE function execution_generic)
cd "$SKELS"/execution_st09 && opengeode --toAda system_structure.pr ../execution_generic/execution_generic.pr && rm -f execution_generic.ad* && cd $OLDPWD

# Generate code for OpenGEODE function tm_st09
cd "$SKELS"/tm_st09 && opengeode --toAda tm_st09.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function time_management
cd "$SKELS"/time_management && opengeode --toAda time_management.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function sc_routing
cd "$SKELS"/sc_routing && opengeode --toAda sc_routing.pr system_structure.pr && cd $OLDPWD

142
143
144
145
146
147
148
149
150
151
152
153
# Generate code for OpenGEODE function event_action
cd "$SKELS"/event_action && opengeode --toAda event_action.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function acceptance_st19
cd "$SKELS"/acceptance_st19 && opengeode --toAda acceptance_st19.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function tm_st19
cd "$SKELS"/tm_st19 && opengeode --toAda tm_st19.pr system_structure.pr && cd $OLDPWD

# Generate code for function execution_ev_act (instance of OpenGEODE function execution_generic)
cd "$SKELS"/execution_ev_act && opengeode --toAda system_structure.pr ../execution_generic/execution_generic.pr && rm -f execution_generic.ad* && cd $OLDPWD

154
155
156
157
158
159
160
161
162
163
164
165
# Generate code for OpenGEODE function time_scheduling
cd "$SKELS"/time_scheduling && opengeode --toAda time_scheduling.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function acceptance_st11
cd "$SKELS"/acceptance_st11 && opengeode --toAda acceptance_st11.pr system_structure.pr && cd $OLDPWD

# Generate code for OpenGEODE function tm_st11
cd "$SKELS"/tm_st11 && opengeode --toAda tm_st11.pr system_structure.pr && cd $OLDPWD

# Generate code for function execution_time_sched (instance of OpenGEODE function execution_generic)
cd "$SKELS"/execution_time_sched && opengeode --toAda system_structure.pr ../execution_generic/execution_generic.pr && rm -f execution_generic.ad* && cd $OLDPWD

166
cd "$SKELS" && rm -f st01_acceptance.zip && zip st01_acceptance st01_acceptance/* && cd $OLDPWD
167

168
cd "$SKELS" && rm -f st02_on_off_cmds.zip && zip st02_on_off_cmds st02_on_off_cmds/* && cd $OLDPWD
169

170
cd "$SKELS" && rm -f st01_execution.zip && zip st01_execution st01_execution/* && cd $OLDPWD
171

172
cd "$SKELS" && rm -f tm_st01.zip && zip tm_st01 tm_st01/* && cd $OLDPWD
173

174
175
cd "$SKELS" && rm -f sensor2.zip && zip sensor2 sensor2/* && cd $OLDPWD

176
cd "$SKELS" && rm -f processtc.zip && zip processtc processtc/* && cd $OLDPWD
177

178
cd "$SKELS" && rm -f sendtm.zip && zip sendtm sendtm/* && cd $OLDPWD
179

180
cd "$SKELS" && rm -f obsw_routing.zip && zip obsw_routing obsw_routing/* && cd $OLDPWD
181

182
183
cd "$SKELS" && rm -f acceptance_cpdu1.zip && zip acceptance_cpdu1 acceptance_cpdu1/* && cd $OLDPWD

184
cd "$SKELS" && rm -f cpdu1_cmds.zip && zip cpdu1_cmds cpdu1_cmds/* && cd $OLDPWD
185
186
187
188
189

cd "$SKELS" && rm -f execution_cpdu1.zip && zip execution_cpdu1 execution_cpdu1/* && cd $OLDPWD

cd "$SKELS" && rm -f tm_cpdu1.zip && zip tm_cpdu1 tm_cpdu1/* && cd $OLDPWD

190
191
cd "$SKELS" && rm -f cpdu1.zip && zip cpdu1 cpdu1/* && cd $OLDPWD

192
cd "$SKELS" && rm -f acceptance_hk.zip && zip acceptance_hk acceptance_hk/* && cd $OLDPWD
Daniel Tonoiu's avatar
Daniel Tonoiu committed
193
194
195

cd "$SKELS" && rm -f hk_service.zip && zip hk_service hk_service/* && cd $OLDPWD

196
cd "$SKELS" && rm -f execution_hk.zip && zip execution_hk execution_hk/* && cd $OLDPWD
Daniel Tonoiu's avatar
Daniel Tonoiu committed
197

198
199
200
201
202
203
204
cd "$SKELS" && rm -f tm_hk.zip && zip tm_hk tm_hk/* && cd $OLDPWD

cd "$SKELS" && rm -f hk_definitions.zip && zip hk_definitions hk_definitions/* && cd $OLDPWD

cd "$SKELS" && rm -f sensor1.zip && zip sensor1 sensor1/* && cd $OLDPWD

cd "$SKELS" && rm -f cpdu2.zip && zip cpdu2 cpdu2/* && cd $OLDPWD
Daniel Tonoiu's avatar
Daniel Tonoiu committed
205

206
207
208
209
210
211
212
213
214
215
216
217
cd "$SKELS" && rm -f event_report.zip && zip event_report event_report/* && cd $OLDPWD

cd "$SKELS" && rm -f execution_obm.zip && zip execution_obm execution_obm/* && cd $OLDPWD

cd "$SKELS" && rm -f tm_obm.zip && zip tm_obm tm_obm/* && cd $OLDPWD

cd "$SKELS" && rm -f on_board_monitoring.zip && zip on_board_monitoring on_board_monitoring/* && cd $OLDPWD

cd "$SKELS" && rm -f acceptance_st12.zip && zip acceptance_st12 acceptance_st12/* && cd $OLDPWD

cd "$SKELS" && rm -f execution_generic.zip && zip execution_generic execution_generic/* && cd $OLDPWD

218
219
220
221
222
223
224
225
226
227
228
229
cd "$SKELS" && rm -f acceptance_st09.zip && zip acceptance_st09 acceptance_st09/* && cd $OLDPWD

cd "$SKELS" && rm -f execution_st09.zip && zip execution_st09 execution_st09/* && cd $OLDPWD

cd "$SKELS" && rm -f tm_st09.zip && zip tm_st09 tm_st09/* && cd $OLDPWD

cd "$SKELS" && rm -f time_management.zip && zip time_management time_management/* && cd $OLDPWD

cd "$SKELS" && rm -f data_pool.zip && zip data_pool data_pool/* && cd $OLDPWD

cd "$SKELS" && rm -f sc_routing.zip && zip sc_routing sc_routing/* && cd $OLDPWD

230
231
232
233
234
235
236
237
238
239
cd "$SKELS" && rm -f event_action.zip && zip event_action event_action/* && cd $OLDPWD

cd "$SKELS" && rm -f acceptance_st19.zip && zip acceptance_st19 acceptance_st19/* && cd $OLDPWD

cd "$SKELS" && rm -f tm_st19.zip && zip tm_st19 tm_st19/* && cd $OLDPWD

cd "$SKELS" && rm -f execution_ev_act.zip && zip execution_ev_act execution_ev_act/* && cd $OLDPWD

cd "$SKELS" && rm -f ev_act_definitions.zip && zip ev_act_definitions ev_act_definitions/* && cd $OLDPWD

240
241
242
243
244
245
246
247
248
249
cd "$SKELS" && rm -f time_scheduling.zip && zip time_scheduling time_scheduling/* && cd $OLDPWD

cd "$SKELS" && rm -f acceptance_st11.zip && zip acceptance_st11 acceptance_st11/* && cd $OLDPWD

cd "$SKELS" && rm -f tm_st11.zip && zip tm_st11 tm_st11/* && cd $OLDPWD

cd "$SKELS" && rm -f execution_time_sched.zip && zip execution_time_sched execution_time_sched/* && cd $OLDPWD

cd "$SKELS" && rm -f sched_act_defs.zip && zip sched_act_defs sched_act_defs/* && cd $OLDPWD

250
251
252
253
254
[ ! -z "$CLEANUP" ] && rm -rf binary*

if [ -f ConcurrencyView.pro ]
then
    ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView.pro "
255
256
257
258
259
260
261
262
263
264
265
266
267
268
elif [ -f ConcurrencyView_Properties.aadl ]
then
    ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView_Properties.aadl "
fi

if [ -f user_init_post.sh ]
then
    echo -e "${INFO} Executing user-defined post-init script"
    source user_init_post.sh
fi

if [ -f additionalCommands.sh ]
then
    source additionalCommands.sh
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
fi

if [ ! -z "$USE_POHIC" ]
then
    OUTPUTDIR=binary.c
    ORCHESTRATOR_OPTIONS+=" -p "
elif [ ! -z "$USE_POHIADA" ]
then
    OUTPUTDIR=binary.ada
else
    OUTPUTDIR=binary
fi

cd "$CWD" && assert-builder-ocarina.py \
	--fast \
284
	$DEBUG_MODE \
285
286
287
288
289
	--aadlv2 \
	--keep-case \
	--interfaceView "$INTERFACEVIEW" \
	--deploymentView "$DEPLOYMENTVIEW" \
	-o "$OUTPUTDIR" \
290
291
292
293
	--subAda st01_acceptance:"$SKELS"/st01_acceptance.zip \
	--subAda st02_on_off_cmds:"$SKELS"/st02_on_off_cmds.zip \
	--subAda st01_execution:"$SKELS"/st01_execution.zip \
	--subAda tm_st01:"$SKELS"/tm_st01.zip \
294
	--subAda sensor2:"$SKELS"/sensor2.zip \
295
296
	--subAda processtc:"$SKELS"/processtc.zip \
	--subAda sendtm:"$SKELS"/sendtm.zip \
297
	--subAda obsw_routing:"$SKELS"/obsw_routing.zip \
298
	--subAda acceptance_cpdu1:"$SKELS"/acceptance_cpdu1.zip \
299
	--subAda cpdu1_cmds:"$SKELS"/cpdu1_cmds.zip \
300
301
	--subAda execution_cpdu1:"$SKELS"/execution_cpdu1.zip \
	--subAda tm_cpdu1:"$SKELS"/tm_cpdu1.zip \
302
	--subAda cpdu1:"$SKELS"/cpdu1.zip \
303
	--subAda acceptance_hk:"$SKELS"/acceptance_hk.zip \
Daniel Tonoiu's avatar
Daniel Tonoiu committed
304
	--subAda hk_service:"$SKELS"/hk_service.zip \
305
306
307
308
309
	--subAda execution_hk:"$SKELS"/execution_hk.zip \
	--subAda tm_hk:"$SKELS"/tm_hk.zip \
	--subAda hk_definitions:"$SKELS"/hk_definitions.zip \
	--subAda sensor1:"$SKELS"/sensor1.zip \
	--subAda cpdu2:"$SKELS"/cpdu2.zip \
310
311
312
313
314
315
	--subAda event_report:"$SKELS"/event_report.zip \
	--subAda execution_obm:"$SKELS"/execution_obm.zip \
	--subAda tm_obm:"$SKELS"/tm_obm.zip \
	--subAda on_board_monitoring:"$SKELS"/on_board_monitoring.zip \
	--subAda acceptance_st12:"$SKELS"/acceptance_st12.zip \
	--with-extra-Ada-code execution_generic:"$SKELS"/execution_generic \
316
317
318
319
320
321
	--subAda acceptance_st09:"$SKELS"/acceptance_st09.zip \
	--subAda execution_st09:"$SKELS"/execution_st09.zip \
	--subAda tm_st09:"$SKELS"/tm_st09.zip \
	--subAda time_management:"$SKELS"/time_management.zip \
	--subAda data_pool:"$SKELS"/data_pool.zip \
	--subAda sc_routing:"$SKELS"/sc_routing.zip \
322
323
324
325
326
	--subAda event_action:"$SKELS"/event_action.zip \
	--subAda acceptance_st19:"$SKELS"/acceptance_st19.zip \
	--subAda tm_st19:"$SKELS"/tm_st19.zip \
	--subAda execution_ev_act:"$SKELS"/execution_ev_act.zip \
	--subAda ev_act_definitions:"$SKELS"/ev_act_definitions.zip \
327
328
329
330
331
	--subAda time_scheduling:"$SKELS"/time_scheduling.zip \
	--subAda acceptance_st11:"$SKELS"/acceptance_st11.zip \
	--subAda tm_st11:"$SKELS"/tm_st11.zip \
	--subAda execution_time_sched:"$SKELS"/execution_time_sched.zip \
	--subAda sched_act_defs:"$SKELS"/sched_act_defs.zip \
332
	$ORCHESTRATOR_OPTIONS
333
334
335
336
337
338
339

if [ -f user_init_last.sh ]
then
    echo -e "${INFO} Executing user-defined post-build script"
    source user_init_last.sh
fi