fce.pr 18 KB
Newer Older
1
/* CIF PROCESS (214, 144), (150, 75) */
Maxime Perrotin's avatar
Maxime Perrotin committed
2
PROCESS fce;
3
4
5
6
7
8
9
10
11
    /* CIF TEXT (3821, 508), (320, 142) */
    -- The task of the FCE is to serve as a backup
-- for S/C attitude control

-- The FCE SW is designed to be independent
-- from the OBC CSW to prevent any failure
-- propagation from OBC to FCE
    /* CIF ENDTEXT */
    /* CIF TEXT (3766, 688), (442, 584) */
12
    -- Declaration of variables stored in RAM
Maxime Perrotin's avatar
Maxime Perrotin committed
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

DCL eeprom FCE_SGM_EEPROM;

DCL sgm_ram FCE_SGM_RAM;

DCL fdir_enable Bool_ty;

DCL new_rc Counter_ty;

--DCL ground_cmd_reset Bool_ty;

DCL areArraysDeployed Bool_ty;

--DCL ctxt MySeq;

dcl fce_stat_reg FCE_RECOVERY_STATUS_REGISTER;

dcl fce_ctrl_reg FCE_CONTROL_FLAGS_STATUS_REGISTER;

dcl op_param Bool_ty;

-- FCE Selected should be returned by the FCE Selected Determination
-- procedure (FCESW-3332) but I have no visibility on this procedure
-- (see Figure 6-5)
dcl fce_selected Bool_ty;

-- In figure 6.5 there is a test "Fce selected and
-- arr_dep = true two consecutive times".
DCL fce_selected_counter Counter_ty;

-- Fig 6-7, FCE Stop control asserted

45
DCL FCE_Stop_Control Bool_ty := false;
Maxime Perrotin's avatar
Maxime Perrotin committed
46
47
48

-- As defined in Figure 6-6
TIMER mmo_sep_check_delay;
49
    /* CIF ENDTEXT */
50
    /* CIF PROCEDURE (5705, 4), (135, 64) */
51
    PROCEDURE Bootup_actions;
52
        /* CIF TEXT (5305, 144), (387, 130) */
53
        fpar in/out
Maxime Perrotin's avatar
Maxime Perrotin committed
54
    eeprom FCE_SGM_EEPROM;
55
        /* CIF ENDTEXT */
56
        /* CIF START (4406, 147), (100, 50) */
57
        START;
58
            /* CIF TASK (4314, 212), (283, 50) */
59
            TASK eeprom!sit_4!ground_cmd_reset := false;
60
            /* CIF PROCEDURECALL (4334, 277), (243, 50) */
61
            CALL set_fce_sgm_eeprom(eeprom);
62
            /* CIF PROCEDURECALL (4320, 342), (271, 50) */
63
            CALL get_fce_status_register(fce_stat_reg);
64
            /* CIF DECISION (4380, 407), (151, 70) */
65
            DECISION fce_stat_reg!l3rec
66
            /* CIF COMMENT (4549, 408), (244, 68) */
67
            COMMENT 'determine:
Maxime Perrotin's avatar
Maxime Perrotin committed
68
69
70
- the FDIR trigger level
- the new value of the RC New_RC
- the cause of the boot-up';
71
                    /* CIF ANSWER (4717, 497), (100, 35) */
72
                    (false):
73
                        /* CIF DECISION (4688, 547), (158, 70) */
74
                        DECISION fce_stat_reg!l2rec;
75
                                /* CIF ANSWER (4980, 637), (100, 35) */
76
                                (false):
77
                                    /* CIF TASK (4924, 687), (212, 50) */
78
                                    TASK new_rc := eeprom!sit_4!rc
79
                                    /* CIF COMMENT (5152, 695), (124, 33) */
80
                                    COMMENT 'FCE Switch-on';
81
                                    /* CIF TASK (4951, 752), (158, 50) */
82
                                    TASK 'Write in data pool'
83
                                    /* CIF COMMENT (5129, 752), (176, 50) */
84
                                    COMMENT 'TODO - these
Maxime Perrotin's avatar
Maxime Perrotin committed
85
actions are in table 6-1';
86
                                /* CIF ANSWER (4562, 637), (100, 35) */
87
                                (true):
88
                                    /* CIF TASK (4506, 687), (212, 50) */
89
                                    TASK new_rc := eeprom!sit_4!rc
90
                                    /* CIF COMMENT (4734, 695), (180, 33) */
91
                                    COMMENT 'First Level2 Emergency';
92
                                    /* CIF TASK (4497, 752), (229, 98) */
93
                                    TASK 'Write in data pool',
Maxime Perrotin's avatar
Maxime Perrotin committed
94
95
96
97
98
'clear registers l2rec and
r3rec by use of the recovery
control register',
'generate event to store these
data in SKEL'
99
                                    /* CIF COMMENT (4742, 776), (176, 50) */
100
                                    COMMENT 'TODO - these
Maxime Perrotin's avatar
Maxime Perrotin committed
101
actions are in table 6-1';
102
                        ENDDECISION;
103
                    /* CIF ANSWER (4136, 497), (100, 35) */
104
                    (true):
105
                        /* CIF TASK (4080, 547), (212, 50) */
106
                        TASK new_rc := eeprom!sit_4!rc + 1
107
                        /* CIF COMMENT (4307, 538), (158, 68) */
108
                        COMMENT 'Level 3 emergency
Maxime Perrotin's avatar
Maxime Perrotin committed
109
110
111
May have also been
a second Level 2
triggering';
112
                        /* CIF TASK (4071, 612), (229, 113) */
113
                        TASK 'Add to data pool:
Maxime Perrotin's avatar
Maxime Perrotin committed
114
115
116
117
118
119
status register, new_rc',
'clear registers l2rec and
r3rec by use of the recovery
control register',
'generate event to store these
data in SKEL'
120
                        /* CIF COMMENT (4321, 643), (176, 50) */
121
                        COMMENT 'TODO - these
Maxime Perrotin's avatar
Maxime Perrotin committed
122
actions are in table 6-1';
123
                        /* CIF TASK (4069, 740), (233, 50) */
124
                        TASK eeprom!sit_4!rc := new_rc mod 5;
125
                        /* CIF JOIN (4168, 805), (35, 35) */
126
127
                        JOIN bootup_label;
            ENDDECISION;
128
            /* CIF LABEL (4395, 880), (121, 35) */
129
            bootup_label:
130
            /* CIF PROCEDURECALL (4314, 930), (283, 50) */
131
            CALL get_fce_ctrl_stat_register(fce_ctrl_reg);
132
            /* CIF DECISION (4337, 995), (238, 70) */
133
            DECISION fce_ctrl_reg!reference_pattern;
134
                    /* CIF ANSWER (4290, 1085), (100, 35) */
135
                    (ok):
136
                        /* CIF DECISION (4243, 1135), (194, 70) */
137
                        DECISION fce_ctrl_reg!arr_dep_flag;
138
                                /* CIF ANSWER (4177, 1225), (100, 35) */
139
                                (majority):
140
                                    /* CIF TASK (4124, 1275), (205, 50) */
141
                                    TASK areArraysDeployed :=TRUE;
142
                                /* CIF ANSWER (4392, 1225), (100, 35) */
143
                                ELSE:
144
                                    /* CIF TASK (4338, 1275), (208, 50) */
145
146
                                    TASK areArraysDeployed :=FALSE;
                        ENDDECISION;
147
                    /* CIF ANSWER (4611, 1085), (100, 35) */
148
                    (nok):
149
                        /* CIF TASK (4556, 1135), (210, 50) */
150
                        TASK 'Evaluate arr_dep_flag
Maxime Perrotin's avatar
Maxime Perrotin committed
151
from the other RM register'
152
                        /* CIF COMMENT (4786, 1133), (180, 53) */
153
                        COMMENT 'XXX
Maxime Perrotin's avatar
Maxime Perrotin committed
154
155
Not clear what register
we have to read';
156
                        /* CIF JOIN (4643, 1200), (35, 35) */
157
158
                        JOIN another_label;
            ENDDECISION;
159
            /* CIF TASK (4339, 1355), (233, 50) */
160
            TASK 'Provide all results to data pool'
161
            /* CIF COMMENT (4592, 1355), (251, 50) */
162
            COMMENT 'XXX Check Data pool specification';
163
            /* CIF RETURN (4431, 1420), (50, 50) */
164
            RETURN ;
165
        /* CIF LABEL (5094, 991), (125, 35) */
166
        CONNECTION another_label:
167
            /* CIF RETURN (5139, 1041), (35, 35) */
168
169
170
171
            RETURN ;
        /* CIF End Label */
        ENDCONNECTION;
    ENDPROCEDURE;
172
    /* CIF START (276, 108), (100, 50) */
173
    START;
174
        /* CIF LABEL (276, 184), (100, 50) */
175
        FCE_INIT:
176
        /* CIF TASK (216, 249), (221, 53) */
177
        TASK 'FCE internal reconfiguration
Maxime Perrotin's avatar
Maxime Perrotin committed
178
179
according to pointer position',
'Boot-up selected PM';
180
        /* CIF TASK (228, 317), (197, 50) */
181
        TASK 'Disable TM/TC reception';
182
        /* CIF TASK (186, 382), (281, 83) */
183
        TASK 'Start WD refreshing',
Maxime Perrotin's avatar
Maxime Perrotin committed
184
185
186
187
'Validity check of SGM RAM',
'Save last boot report to SGM-RAM',
'OBT validity check/restore with LLOBT',
'Enable_HW_Sync_to_PPS_for_2_sec'
188
        /* CIF COMMENT (542, 393), (238, 48) */
189
        COMMENT 'What to do if validity check fails?';
190
        /* CIF PROCEDURECALL (241, 480), (171, 50) */
191
        CALL get_fce_sgm_eeprom
Maxime Perrotin's avatar
Maxime Perrotin committed
192
(eeprom)
193
        /* CIF COMMENT (514, 467), (187, 50) */
194
        COMMENT 'If read fails for all 4 SGM,
Maxime Perrotin's avatar
Maxime Perrotin committed
195
use default SIT';
196
        /* CIF PROCEDURECALL (256, 545), (140, 50) */
197
        CALL Bootup_actions
Maxime Perrotin's avatar
Maxime Perrotin committed
198
(eeprom)
199
        /* CIF COMMENT (486, 536), (304, 63) */
200
        COMMENT 'Retrieve RSR, determine FDIR trigger level,
Maxime Perrotin's avatar
Maxime Perrotin committed
201
202
NEW_RC, cause of the boot-up, and perform
the corresponding actions (table 6-1)';
203
        /* CIF DECISION (273, 610), (107, 70) */
204
        DECISION new_rc >= 5;
205
                /* CIF ANSWER (491, 746), (100, 35) */
206
                (TRUE):
207
                    /* CIF TASK (464, 796), (154, 50) */
208
                    TASK fdir_enable := false
209
                    /* CIF COMMENT (644, 790), (112, 61) */
210
                    COMMENT 'FDIR Level 4';
211
                    /* CIF PROCEDURECALL (437, 861), (208, 50) */
212
                    CALL get_fce_sgm_ram(sgm_ram)
213
                    /* CIF COMMENT (667, 859), (163, 53) */
214
                    COMMENT 'According to FI-0011
Maxime Perrotin's avatar
Maxime Perrotin committed
215
216
Use default values if
SGM reads fail';
217
                /* CIF ANSWER (57, 700), (93, 35) */
218
                (FALSE):
219
                    /* CIF TASK (28, 755), (151, 50) */
220
                    TASK fdir_enable := true
221
                    /* CIF COMMENT (198, 755), (132, 50) */
222
                    COMMENT 'No FDIR Level 4';
223
                    /* CIF PROCEDURECALL (0, 820), (208, 50) */
224
                    CALL get_fce_sgm_ram(sgm_ram)
225
                    /* CIF COMMENT (227, 820), (136, 50) */
226
227
                    COMMENT 'Get LLAT, LLARE';
        ENDDECISION;
228
        /* CIF TASK (151, 927), (350, 50) */
229
        TASK 'Start nominal SpW link acc. SIT1',
Maxime Perrotin's avatar
Maxime Perrotin committed
230
'Start normal HK TM generation and routing to OBC';
231
        /* CIF TASK (207, 992), (239, 50) */
232
        TASK 'further FCESW startup activities'
233
        /* CIF COMMENT (501, 999), (149, 50) */
234
        COMMENT 'details tbd by asf
Maxime Perrotin's avatar
Maxime Perrotin committed
235
see 1.2';
236
        /* CIF TASK (226, 1057), (200, 50) */
237
        TASK 'Enable_TC_TM_Reception';
238
        /* CIF JOIN (301, 1122), (50, 50) */
239
        JOIN to_sbm;
240
    /* CIF LABEL (2056, 122), (124, 50) */
241
    CONNECTION sbm_to_ready:
242
        /* CIF TASK (1986, 187), (265, 50) */
243
        TASK 'fce dms initialisation to READY mode'
244
        /* CIF COMMENT (2285, 186), (206, 53) */
245
        COMMENT 'stop both RIU functions ;
Maxime Perrotin's avatar
Maxime Perrotin committed
246
247
stop SpW links to RIUs
XXX check what to do here';
248
        /* CIF TASK (2043, 252), (151, 50) */
249
        TASK fdir_enable := true
250
        /* CIF COMMENT (2217, 250), (242, 50) */
251
        COMMENT 'Even if it was set to false before?!';
252
        /* CIF DECISION (1980, 317), (277, 70) */
253
        DECISION eeprom!sit_4!ground_cmd_reset = true
Maxime Perrotin's avatar
Maxime Perrotin committed
254
255
and
fce_stat_reg!l3rec = false;
256
                /* CIF ANSWER (1877, 407), (62, 28) */
257
                (FALSE):
258
                    /* CIF NEXTSTATE (1831, 455), (155, 50) */
259
                    NEXTSTATE Wait_Attitude_Msg;
260
                /* CIF ANSWER (2287, 407), (100, 35) */
261
                (TRUE):
262
                    /* CIF LABEL (2245, 457), (185, 82) */
263
                    cmd_fce_aocs_to_ready:
264
                    /* CIF TASK (2242, 554), (191, 53) */
265
                    TASK 'FCE_AOCS_READY_CMD',
Maxime Perrotin's avatar
Maxime Perrotin committed
266
267
'Start FCE_SELECTED
Determination'
268
                    /* CIF COMMENT (2446, 554), (344, 53) */
269
                    COMMENT 'Not sure what to do here (Figure 6-4)
Maxime Perrotin's avatar
Maxime Perrotin committed
270
Do we need to execute the FCE AOCS branch too?';
271
                    /* CIF TASK (2239, 622), (196, 50) */
272
                    TASK fce_selected_counter := 0
273
                    /* CIF COMMENT (2455, 622), (260, 53) */
274
                    COMMENT 'Used to count 2 consecutive checks
Maxime Perrotin's avatar
Maxime Perrotin committed
275
276
of FCE Selected and Arr_Dep=true
(cf. Fig 6-5)';
277
                    /* CIF NEXTSTATE (2274, 687), (127, 50) */
278
279
280
281
                    NEXTSTATE Ready;
        ENDDECISION;
    /* CIF End Label */
    ENDCONNECTION;
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
    /* CIF LABEL (4842, 0), (100, 50) */
    CONNECTION to_sbm:
        /* CIF TASK (4799, 65), (186, 50) */
        TASK 'FCE_AOCS_SBM_CMD'
        /* CIF COMMENT (5070, 66), (197, 53) */
        COMMENT 'In 1.2, but what exactly
has to be done here is not
clearly stated XXX';
        /* CIF DECISION (4760, 130), (263, 70) */
        DECISION eeprom!sit_4!test_mode_counter = 0;
                /* CIF ANSWER (4928, 220), (100, 35) */
                (TRUE):
                    /* CIF NEXTSTATE (4911, 275), (134, 50) */
                    NEXTSTATE FCE_Test_Mode;
                /* CIF ANSWER (4697, 220), (110, 35) */
                (FALSE):
                    /* CIF JOIN (4727, 270), (50, 50) */
                    JOIN sbm_to_ready;
        ENDDECISION;
    /* CIF End Label */
    ENDCONNECTION;
    /* CIF LABEL (5889, 181), (152, 50) */
    CONNECTION ready_to_control:
        /* CIF TASK (5823, 246), (284, 53) */
        TASK 'stop sending packets to OBC, but
continue generation of normal HK+AOCS
packets'
        /* CIF COMMENT (6121, 215), (223, 93) */
        COMMENT '(in Figure 6-5)
This seems inconsistent
normal HK are sent to OBC
so where should we "continue"
sending them? XXX';
        /* CIF TASK (5875, 314), (180, 50) */
        TASK 'Stop TM-TC Reception'
        /* CIF COMMENT (6073, 314), (177, 50) */
        COMMENT 'what command is that?
(To whom?) XXX';
        /* CIF TASK (5888, 379), (154, 50) */
        TASK fdir_enable := false;
        /* CIF TASK (5865, 444), (201, 50) */
        TASK areArraysDeployed := true;
        /* CIF TASK (5884, 509), (163, 50) */
        TASK fce_selected := true;
        /* CIF NEXTSTATE (5915, 574), (100, 50) */
        NEXTSTATE Control;
    /* CIF End Label */
    ENDCONNECTION;
    /* CIF LABEL (5363, 104), (144, 50) */
    CONNECTION control_to_ready:
        /* CIF TASK (5367, 169), (136, 50) */
        TASK 'huge transition'
        /* CIF COMMENT (5523, 169), (147, 50) */
        COMMENT 'TODO (Figure 6-7)';
        /* CIF NEXTSTATE (5385, 234), (100, 50) */
        NEXTSTATE Ready;
    /* CIF End Label */
    ENDCONNECTION;
    /* CIF STATE (5402, 414), (134, 50) */
    STATE FCE_Test_Mode;
        /* CIF INPUT (5410, 484), (117, 50) */
        INPUT Upload_Data
(op_param)
        /* CIF COMMENT (5544, 470), (165, 78) */
        COMMENT 'From operator
in SGM EEPROM/RAM
or PM EEPROM/RAM
TBD';
            /* CIF NEXTSTATE (5401, 549), (134, 50) */
            NEXTSTATE FCE_Test_Mode;
352
    ENDSTATE;
353
    /* CIF STATE (3762, 123), (100, 50) */
354
    STATE Ready;
355
        /* CIF INPUT (4233, 193), (100, 50) */
356
        INPUT Cyclic_HK
357
        /* CIF COMMENT (4353, 193), (100, 50) */
358
        COMMENT 'Fig 6-4';
359
            /* CIF OUTPUT (4218, 258), (129, 50) */
360
            OUTPUT Normal_HK_TM
361
            /* CIF COMMENT (4380, 258), (100, 50) */
362
            COMMENT 'To OBC';
363
            /* CIF NEXTSTATE (4233, 323), (100, 50) */
364
            NEXTSTATE Ready;
365
        /* CIF INPUT (3177, 193), (104, 50) */
366
        INPUT Cyclic_FCE;
367
            /* CIF TASK (3162, 258), (133, 50) */
368
            TASK 'FCE_SELECTED'
369
            /* CIF COMMENT (3308, 256), (164, 53) */
370
            COMMENT 'As required in Fig 6-4
Maxime Perrotin's avatar
Maxime Perrotin committed
371
but no details given';
372
            /* CIF DECISION (3114, 323), (230, 70) */
373
            DECISION fce_selected and
Maxime Perrotin's avatar
Maxime Perrotin committed
374
areArraysDeployed
375
            /* CIF COMMENT (3352, 316), (247, 83) */
376
            COMMENT 'ambiguity in fig 6-5: ARR_DEP
Maxime Perrotin's avatar
Maxime Perrotin committed
377
378
379
380
or areArraysDeployed flag?
(ARR_DEP is a set of flags used 
to determine areArraysDeployed,
cf fig 6-1)';
381
                    /* CIF ANSWER (3344, 413), (100, 35) */
382
                    (false):
383
                        /* CIF TASK (3296, 463), (196, 50) */
384
                        TASK fce_selected_counter := 0;
385
                        /* CIF NEXTSTATE (3344, 528), (100, 50) */
386
                        NEXTSTATE Ready;
387
                    /* CIF ANSWER (2975, 413), (100, 35) */
388
                    (true):
389
                        /* CIF TASK (2889, 463), (273, 50) */
390
391
                        TASK fce_selected_counter :=
(fce_selected_counter + 1) mod 65535;
392
                        /* CIF DECISION (2937, 528), (176, 70) */
393
                        DECISION fce_selected_counter
Maxime Perrotin's avatar
Maxime Perrotin committed
394
= 2;
395
                                /* CIF ANSWER (2805, 618), (100, 35) */
396
                                (true):
397
                                    /* CIF JOIN (2830, 668), (50, 50) */
398
                                    JOIN ready_to_control;
399
                                /* CIF ANSWER (3188, 618), (100, 35) */
400
                                (false):
401
                                    /* CIF NEXTSTATE (3188, 668), (100, 50) */
402
403
404
                                    NEXTSTATE Ready;
                        ENDDECISION;
            ENDDECISION;
405
        /* CIF INPUT (3802, 193), (100, 50) */
406
        INPUT FDIR
407
        /* CIF COMMENT (3948, 188), (173, 76) */
408
        COMMENT 'FDIR Processing
Maxime Perrotin's avatar
Maxime Perrotin committed
409
410
411
(Figure 6-4)
No details given, not
clear what to do? XXX';
412
            /* CIF NEXTSTATE (3802, 258), (100, 50) */
413
414
            NEXTSTATE -;
    ENDSTATE;
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
    /* CIF STATE (1470, 133), (100, 50) */
    STATE Control
    /* CIF COMMENT (1613, 129), (120, 50) */
    COMMENT 'As per Fig 6-6';
        /* CIF INPUT (1679, 203), (136, 50) */
        INPUT Cyclic_Essential;
            /* CIF OUTPUT (1674, 268), (147, 50) */
            OUTPUT Essential_Packets;
            /* CIF NEXTSTATE (1697, 333), (100, 50) */
            NEXTSTATE Control;
        /* CIF INPUT (1412, 203), (100, 50) */
        INPUT Cyclic_HK;
            /* CIF OUTPUT (1398, 268), (129, 50) */
            OUTPUT Normal_HK_TM
            /* CIF COMMENT (1561, 267), (100, 50) */
            COMMENT 'To OBC';
            /* CIF NEXTSTATE (1412, 333), (100, 50) */
            NEXTSTATE Control;
        /* CIF INPUT (1069, 203), (104, 50) */
        INPUT Cyclic_FCE;
            /* CIF TASK (1016, 268), (211, 50) */
            TASK 'Stop control determination';
            /* CIF DECISION (1030, 333), (183, 70) */
            DECISION FCE_Stop_Control;
                    /* CIF ANSWER (878, 423), (100, 35) */
                    (true):
                        /* CIF TASK (840, 473), (176, 50) */
                        TASK 'FCE_AOCS_STOP_CTR';
                        /* CIF JOIN (903, 538), (50, 50) */
                        JOIN control_to_ready;
                    /* CIF ANSWER (1246, 423), (100, 35) */
                    (false):
                        /* CIF NEXTSTATE (1246, 473), (100, 50) */
                        NEXTSTATE Control;
            ENDDECISION;
450
    ENDSTATE;
451
    /* CIF STATE (1831, 455), (155, 50) */
452
    STATE Wait_Attitude_Msg;
453
        /* CIF INPUT (1846, 525), (122, 50) */
454
        INPUT Attitude_msg
455
        /* CIF COMMENT (1999, 524), (100, 50) */
456
        COMMENT 'From OBC';
457
            /* CIF JOIN (1882, 590), (50, 50) */
458
459
            JOIN cmd_fce_aocs_to_ready;
    ENDSTATE;
Maxime Perrotin's avatar
Maxime Perrotin committed
460
ENDPROCESS fce;