##// END OF EJS Templates
AVF1 and PRC1 tasks are functional now
paul -
r122:be6c6d813285 VHDLib206
parent child
Show More
@@ -1,6 +1,6
1 1 #############################################################################
2 2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Apr 22 18:10:21 2014
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Apr 24 22:14:00 2014
4 4 # Project: fsw-qt.pro
5 5 # Template: app
6 6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
@@ -1,6 +1,6
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 3.0.1, 2014-04-22T18:12:39. -->
3 <!-- Written by QtCreator 3.0.1, 2014-04-24T22:30:22. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -19,17 +19,17 typedef struct ring_node
19 19 } ring_node;
20 20
21 21 typedef struct {
22 unsigned int norm_bp1_f0;
23 unsigned int norm_bp2_f0;
24 unsigned int norm_asm_f0;
25 unsigned int burst_sbm_bp1_f0;
26 unsigned int burst_sbm_bp2_f0;
27 unsigned int burst_bp1_f0;
28 unsigned int burst_bp2_f0;
29 unsigned int sbm1_bp1_f0;
30 unsigned int sbm1_bp2_f0;
31 unsigned int sbm2_bp1_f0;
32 unsigned int sbm2_bp2_f0;
22 unsigned int norm_bp1;
23 unsigned int norm_bp2;
24 unsigned int norm_asm;
25 unsigned int burst_sbm_bp1;
26 unsigned int burst_sbm_bp2;
27 unsigned int burst_bp1;
28 unsigned int burst_bp2;
29 unsigned int sbm1_bp1;
30 unsigned int sbm1_bp2;
31 unsigned int sbm2_bp1;
32 unsigned int sbm2_bp2;
33 33 } nb_sm_before_bp_asm_f0;
34 34
35 35 typedef struct {
@@ -207,7 +207,6 typedef struct {
207 207 #define TASKID_PRC1 17
208 208
209 209 #define TASK_PRIORITY_SPIQ 5
210 //#define TASK_PRIORITY_SMIQ 10
211 210 #define TASK_PRIORITY_WTDG 20
212 211 #define TASK_PRIORITY_HOUS 30
213 212 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
@@ -219,9 +218,9 typedef struct {
219 218 #define TASK_PRIORITY_RECV 50
220 219 #define TASK_PRIORITY_ACTN 50
221 220 #define TASK_PRIORITY_AVF0 60
221 #define TASK_PRIORITY_AVF1 70
222 222 #define TASK_PRIORITY_PRC0 100
223 223 #define TASK_PRIORITY_PRC1 100
224 #define TASK_PRIORITY_AVF1 60
225 224 #define TASK_PRIORITY_STAT 200
226 225 #define TASK_PRIORITY_DUMB 200
227 226
@@ -25,13 +25,13
25 25 //
26 26 #define NB_BINS_PER_ASM_F1 104
27 27 #define NB_BINS_PER_PKT_ASM_F1 52
28 #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104
28 #define TOTAL_SIZE_ASM_F1_IN_BYTES 5200 // 25 * 104 * 2
29 29 #define ASM_F1_INDICE_START 6 // 104 bins
30 30 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
31 31 //
32 32 #define NB_BINS_PER_ASM_F2 96
33 33 #define NB_BINS_PER_PKT_ASM_F2 48
34 #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96
34 #define TOTAL_SIZE_ASM_F2_IN_BYTES 4800 // 25 * 96 * 2
35 35 #define ASM_F2_INDICE_START 7 // 96 bins
36 36 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
37 37 //
@@ -49,23 +49,13
49 49 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
50 50 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
51 51 //
52 #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS
53 #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS
54 #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS
55 #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS
52 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
53 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F1 325 // 13 * 25 WORDS
54 #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS
55 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 550 // 22 * 25 WORDS
56 #define TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 650 // 26 * 25 WORDS
56 57 // NORM
57 58 #define NB_SM_BEFORE_NORM_BP1_F0 384 // 96 * 4
58 #define NB_SM_BEFORE_NORM_BP2_F0 1920 // 96 * 20
59 #define NB_SM_BEFORE_NORM_ASM_F0 384 // 384 matrices at f0 = 4.00 second
60 // BURST
61 #define NB_SM_BEFORE_BURST_BP1_F0 96 // 96 matrices at f0 = 1.00 second
62 #define NB_SM_BEFORE_BURST_BP2_F0 480 // 480 matrices at f0 = 5.00 second
63 // SBM1
64 #define NB_SM_BEFORE_SBM1_BP1_F0 24 // 24 matrices at f0 = 0.25 second
65 #define NB_SM_BEFORE_SBM1_BP2_F0 96 // 96 matrices at f0 = 1.00 second
66 // SBM2
67 #define NB_SM_BEFORE_SBM2_BP1_F0 96 // 96 matrices at f0 = 1.00 second
68 #define NB_SM_BEFORE_SBM2_BP2_F0 480 // 480 matrices at f0 = 5.00 second
69 59 // GENERAL
70 60 #define NB_SM_BEFORE_AVF0 8
71 61 #define NB_SM_BEFORE_AVF1 8
@@ -12,6 +12,8
12 12 #include "fsw_processing_globals.c"
13 13
14 14 unsigned int nb_sm_f0;
15 unsigned int nb_sm_f0_aux;
16 unsigned int nb_sm_f1;
15 17
16 18 //************************
17 19 // spectral matrices rings
@@ -35,8 +37,13 ring_node_asm *current_ring_node_asm_nor
35 37
36 38 float asm_f0_reorganized [ TOTAL_SIZE_SM ];
37 39 char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
38 float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_F0 ];
39 float compressed_sm_sbm [ TOTAL_SIZE_COMPRESSED_ASM_SBM1 ];
40 float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_NORM_F0];
41 float compressed_sm_sbm_f0 [ TOTAL_SIZE_COMPRESSED_ASM_SBM_F0 ];
42
43 float asm_f1_reorganized [ TOTAL_SIZE_SM ];
44 char asm_f1_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
45 float compressed_sm_norm_f1[ TOTAL_SIZE_COMPRESSED_ASM_NORM_F1];
46 float compressed_sm_sbm_f1 [ TOTAL_SIZE_COMPRESSED_ASM_SBM_F1 ];
40 47
41 48 //***********************************************************
42 49 // Interrupt Service Routine for spectral matrices processing
@@ -44,41 +51,44 float compressed_sm_sbm [ TOTAL_SIZE_
44 51 void reset_nb_sm_f0( unsigned char lfrMode )
45 52 {
46 53 nb_sm_f0 = 0;
54 nb_sm_f0_aux = 0;
47 55
48 nb_sm_before_f0.norm_bp1_f0 = parameter_dump_packet.sy_lfr_n_bp_p0 * 96;
49 nb_sm_before_f0.norm_bp2_f0 = parameter_dump_packet.sy_lfr_n_bp_p1 * 96;
50 nb_sm_before_f0.norm_asm_f0 = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 96;
51 nb_sm_before_f0.sbm1_bp1_f0 = parameter_dump_packet.sy_lfr_s1_bp_p0 * 24;
52 nb_sm_before_f0.sbm1_bp2_f0 = parameter_dump_packet.sy_lfr_s1_bp_p1 * 96;
53 nb_sm_before_f0.sbm2_bp1_f0 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 96;
54 nb_sm_before_f0.sbm2_bp2_f0 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 96;
55 nb_sm_before_f0.burst_bp1_f0 = parameter_dump_packet.sy_lfr_b_bp_p0 * 96;
56 nb_sm_before_f0.burst_bp2_f0 = parameter_dump_packet.sy_lfr_b_bp_p1 * 96;
56 nb_sm_before_f0.norm_bp1 = parameter_dump_packet.sy_lfr_n_bp_p0 * 96;
57 nb_sm_before_f0.norm_bp2 = parameter_dump_packet.sy_lfr_n_bp_p1 * 96;
58 nb_sm_before_f0.norm_asm = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 96;
59 nb_sm_before_f0.sbm1_bp1 = parameter_dump_packet.sy_lfr_s1_bp_p0 * 24;
60 nb_sm_before_f0.sbm1_bp2 = parameter_dump_packet.sy_lfr_s1_bp_p1 * 96;
61 nb_sm_before_f0.sbm2_bp1 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 96;
62 nb_sm_before_f0.sbm2_bp2 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 96;
63 nb_sm_before_f0.burst_bp1 = parameter_dump_packet.sy_lfr_b_bp_p0 * 96;
64 nb_sm_before_f0.burst_bp2 = parameter_dump_packet.sy_lfr_b_bp_p1 * 96;
57 65
58 66 if (lfrMode == LFR_MODE_SBM1)
59 67 {
60 nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm1_bp1_f0;
61 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm1_bp2_f0;
68 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.sbm1_bp1;
69 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.sbm1_bp2;
62 70 }
63 71 else if (lfrMode == LFR_MODE_SBM2)
64 72 {
65 nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm2_bp1_f0;
66 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm2_bp2_f0;
73 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.sbm2_bp1;
74 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.sbm2_bp2;
67 75 }
68 76 else if (lfrMode == LFR_MODE_BURST)
69 77 {
70 nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0;
71 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0;
78 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.burst_bp1;
79 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.burst_bp2;
72 80 }
73 81 else
74 82 {
75 nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0;
76 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0;
83 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.burst_bp1;
84 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.burst_bp2;
77 85 }
78 86 }
79 87
80 88 void reset_nb_sm_f1( unsigned char lfrMode )
81 89 {
90 nb_sm_f1 = 0;
91
82 92 nb_sm_before_f1.norm_bp1 = parameter_dump_packet.sy_lfr_n_bp_p0 * 16;
83 93 nb_sm_before_f1.norm_bp2 = parameter_dump_packet.sy_lfr_n_bp_p1 * 16;
84 94 nb_sm_before_f1.norm_asm = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 16;
@@ -173,7 +183,10 rtems_isr spectral_matrices_isr( rtems_v
173 183
174 184 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
175 185 {
176 if (nb_sm_f0 == (NB_SM_BEFORE_AVF0-1) )
186 //***
187 // F0
188 nb_sm_f0 = nb_sm_f0 + 1;
189 if (nb_sm_f0 == NB_SM_BEFORE_AVF0 )
177 190 {
178 191 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
179 192 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
@@ -182,9 +195,23 rtems_isr spectral_matrices_isr_simu( rt
182 195 }
183 196 nb_sm_f0 = 0;
184 197 }
185 else
198
199 //***
200 // F1
201 nb_sm_f0_aux = nb_sm_f0_aux + 1;
202 if (nb_sm_f0_aux == 6)
186 203 {
187 nb_sm_f0 = nb_sm_f0 + 1;
204 nb_sm_f0_aux = 0;
205 nb_sm_f1 = nb_sm_f1 + 1;
206 }
207 if (nb_sm_f1 == NB_SM_BEFORE_AVF1 )
208 {
209 ring_node_for_averaging_sm_f1 = current_ring_node_sm_f1;
210 if (rtems_event_send( Task_id[TASKID_AVF1], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
211 {
212 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
213 }
214 nb_sm_f1 = 0;
188 215 }
189 216 }
190 217
@@ -204,11 +231,11 rtems_task avf0_task( rtems_task_argumen
204 231 asm_msg msgForMATR;
205 232 ring_node_sm *ring_node_tab[8];
206 233
207 static unsigned int nb_norm_bp1;
208 static unsigned int nb_norm_bp2;
209 static unsigned int nb_norm_asm;
210 static unsigned int nb_sbm_bp1;
211 static unsigned int nb_sbm_bp2;
234 unsigned int nb_norm_bp1;
235 unsigned int nb_norm_bp2;
236 unsigned int nb_norm_asm;
237 unsigned int nb_sbm_bp1;
238 unsigned int nb_sbm_bp2;
212 239
213 240 nb_norm_bp1 = 0;
214 241 nb_norm_bp2 = 0;
@@ -253,10 +280,12 rtems_task avf0_task( rtems_task_argumen
253 280 msgForMATR.event = 0x00; // this composite event will be sent to the MATR task
254 281 msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f0;
255 282 msgForMATR.norm = current_ring_node_asm_norm_f0;
256 msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
257 msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1];
283 // msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
284 // msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1];
285 msgForMATR.coarseTime = time_management_regs->coarse_time;
286 msgForMATR.fineTime = time_management_regs->fine_time;
258 287
259 if (nb_sbm_bp1 == nb_sm_before_f0.burst_sbm_bp1_f0)
288 if (nb_sbm_bp1 == nb_sm_before_f0.burst_sbm_bp1)
260 289 {
261 290 nb_sbm_bp1 = 0;
262 291 // set another ring for the ASM storage
@@ -268,7 +297,7 rtems_task avf0_task( rtems_task_argumen
268 297 }
269 298 }
270 299
271 if (nb_sbm_bp2 == nb_sm_before_f0.burst_sbm_bp2_f0)
300 if (nb_sbm_bp2 == nb_sm_before_f0.burst_sbm_bp2)
272 301 {
273 302 nb_sbm_bp2 = 0;
274 303 if ( (lfrCurrentMode == LFR_MODE_BURST)
@@ -278,7 +307,7 rtems_task avf0_task( rtems_task_argumen
278 307 }
279 308 }
280 309
281 if (nb_norm_bp1 == nb_sm_before_f0.norm_bp1_f0)
310 if (nb_norm_bp1 == nb_sm_before_f0.norm_bp1)
282 311 {
283 312 nb_norm_bp1 = 0;
284 313 // set another ring for the ASM storage
@@ -290,7 +319,7 rtems_task avf0_task( rtems_task_argumen
290 319 }
291 320 }
292 321
293 if (nb_norm_bp2 == nb_sm_before_f0.norm_bp2_f0)
322 if (nb_norm_bp2 == nb_sm_before_f0.norm_bp2)
294 323 {
295 324 nb_norm_bp2 = 0;
296 325 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
@@ -300,7 +329,7 rtems_task avf0_task( rtems_task_argumen
300 329 }
301 330 }
302 331
303 if (nb_norm_asm == nb_sm_before_f0.norm_asm_f0)
332 if (nb_norm_asm == nb_sm_before_f0.norm_asm)
304 333 {
305 334 nb_norm_asm = 0;
306 335 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
@@ -415,8 +444,8 rtems_task prc0_task( rtems_task_argumen
415 444 if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 )
416 445 {
417 446 // 1) compress the matrix for Basic Parameters calculation
418 ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm,
419 nb_sm_before_f0.burst_sbm_bp1_f0,
447 ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm_f0,
448 nb_sm_before_f0.burst_sbm_bp1,
420 449 NB_BINS_COMPRESSED_SM_SBM_F0, NB_BINS_TO_AVERAGE_ASM_SBM_F0,
421 450 ASM_F0_INDICE_START);
422 451 // 2) compute the BP1 set
@@ -448,7 +477,7 rtems_task prc0_task( rtems_task_argumen
448 477 {
449 478 // 1) compress the matrix for Basic Parameters calculation
450 479 ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f0,
451 nb_sm_before_f0.norm_bp1_f0,
480 nb_sm_before_f0.norm_bp1,
452 481 NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0,
453 482 ASM_F0_INDICE_START );
454 483 // 2) compute the BP1 set
@@ -460,7 +489,7 rtems_task prc0_task( rtems_task_argumen
460 489 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 + PACKET_LENGTH_DELTA);
461 490 if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F0)
462 491 {
463 // 1) compute the BP2 set
492 // 1) compute the BP2 set using the same ASM as the one used for BP1
464 493
465 494 // 2) send the BP2 set
466 495 set_time( packet_norm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime );
@@ -473,7 +502,9 rtems_task prc0_task( rtems_task_argumen
473 502 if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F0)
474 503 {
475 504 // 1) reorganize the ASM and divide
476 ASM_reorganize_and_divide( incomingMsg->norm->matrix, asm_f0_reorganized, NB_SM_BEFORE_NORM_BP1_F0 );
505 ASM_reorganize_and_divide( incomingMsg->norm->matrix,
506 asm_f0_reorganized,
507 nb_sm_before_f0.norm_bp1 );
477 508 // 2) convert the float array in a char array
478 509 ASM_convert( asm_f0_reorganized, asm_f0_char);
479 510 // 3) send the spectral matrix packets
@@ -498,11 +529,11 rtems_task avf1_task( rtems_task_argumen
498 529 asm_msg msgForMATR;
499 530 ring_node_sm *ring_node_tab[8];
500 531
501 static unsigned int nb_norm_bp1;
502 static unsigned int nb_norm_bp2;
503 static unsigned int nb_norm_asm;
504 static unsigned int nb_sbm_bp1;
505 static unsigned int nb_sbm_bp2;
532 unsigned int nb_norm_bp1;
533 unsigned int nb_norm_bp2;
534 unsigned int nb_norm_asm;
535 unsigned int nb_sbm_bp1;
536 unsigned int nb_sbm_bp2;
506 537
507 538 nb_norm_bp1 = 0;
508 539 nb_norm_bp2 = 0;
@@ -547,8 +578,10 rtems_task avf1_task( rtems_task_argumen
547 578 msgForMATR.event = 0x00; // this composite event will be sent to the PRC1 task
548 579 msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f1;
549 580 msgForMATR.norm = current_ring_node_asm_norm_f1;
550 msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
551 msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1];
581 // msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
582 // msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1];
583 msgForMATR.coarseTime = time_management_regs->coarse_time;
584 msgForMATR.fineTime = time_management_regs->fine_time;
552 585
553 586 if (nb_sbm_bp1 == nb_sm_before_f1.burst_sbm_bp1)
554 587 {
@@ -578,7 +611,7 rtems_task avf1_task( rtems_task_argumen
578 611 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
579 612 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
580 613 {
581 msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0;
614 msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F1;
582 615 }
583 616 }
584 617
@@ -623,7 +656,7 rtems_task prc1_task( rtems_task_argumen
623 656 //
624 657 spw_ioctl_pkt_send spw_ioctl_send_ASM;
625 658 rtems_status_code status;
626 rtems_id queue_id;
659 rtems_id queue_id_send;
627 660 rtems_id queue_id_q_p1;
628 661 Header_TM_LFR_SCIENCE_ASM_t headerASM;
629 662 bp_packet_with_spare packet_norm_bp1;
@@ -666,10 +699,10 rtems_task prc1_task( rtems_task_argumen
666 699 }
667 700 else
668 701 {
669 PRINTF1("ERR *** in PRC1 *** unexpected lfrRequestedMode passed as argument = %d\n", (unsigned int) lfrRequestedMode)
702 PRINTF1("in PRC1 *** lfrRequestedMode is %d, several headers not initialized\n", (unsigned int) lfrRequestedMode)
670 703 }
671 704
672 status = get_message_queue_id_send( &queue_id );
705 status = get_message_queue_id_send( &queue_id_send );
673 706 if (status != RTEMS_SUCCESSFUL)
674 707 {
675 708 PRINTF1("in PRC1 *** ERR get_message_queue_id_send %d\n", status)
@@ -697,7 +730,7 rtems_task prc1_task( rtems_task_argumen
697 730 if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F1 )
698 731 {
699 732 // 1) compress the matrix for Basic Parameters calculation
700 ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm,
733 ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm_f1,
701 734 nb_sm_before_f1.burst_sbm_bp1,
702 735 NB_BINS_COMPRESSED_SM_SBM_F1, NB_BINS_TO_AVERAGE_ASM_SBM_F1,
703 736 ASM_F1_INDICE_START);
@@ -706,7 +739,7 rtems_task prc1_task( rtems_task_argumen
706 739 // 3) send the BP1 set
707 740 set_time( packet_sbm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime );
708 741 set_time( packet_sbm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
709 BP_send( (char *) &packet_sbm_bp1.header, queue_id,
742 BP_send( (char *) &packet_sbm_bp1.header, queue_id_send,
710 743 PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 + PACKET_LENGTH_DELTA);
711 744 // 4) compute the BP2 set if needed
712 745 if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F1 )
@@ -716,7 +749,7 rtems_task prc1_task( rtems_task_argumen
716 749 // 2) send the BP2 set
717 750 set_time( packet_sbm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime );
718 751 set_time( packet_sbm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
719 BP_send( (char *) &packet_sbm_bp2.header, queue_id,
752 BP_send( (char *) &packet_sbm_bp2.header, queue_id_send,
720 753 PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 + PACKET_LENGTH_DELTA);
721 754 }
722 755 }
@@ -729,8 +762,8 rtems_task prc1_task( rtems_task_argumen
729 762 if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F1)
730 763 {
731 764 // 1) compress the matrix for Basic Parameters calculation
732 ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f0,
733 nb_sm_before_f0.norm_bp1_f0,
765 ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f1,
766 nb_sm_before_f0.norm_bp1,
734 767 NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0,
735 768 ASM_F0_INDICE_START );
736 769 // 2) compute the BP1 set
@@ -738,7 +771,7 rtems_task prc1_task( rtems_task_argumen
738 771 // 3) send the BP1 set
739 772 set_time( packet_norm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime );
740 773 set_time( packet_norm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
741 BP_send( (char *) &packet_norm_bp1.header, queue_id,
774 BP_send( (char *) &packet_norm_bp1.header, queue_id_send,
742 775 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 + PACKET_LENGTH_DELTA);
743 776 if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F1)
744 777 {
@@ -747,7 +780,7 rtems_task prc1_task( rtems_task_argumen
747 780 // 2) send the BP2 set
748 781 set_time( packet_norm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime );
749 782 set_time( packet_norm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
750 BP_send( (char *) &packet_norm_bp2.header, queue_id,
783 BP_send( (char *) &packet_norm_bp2.header, queue_id_send,
751 784 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 + PACKET_LENGTH_DELTA);
752 785 }
753 786 }
@@ -755,13 +788,15 rtems_task prc1_task( rtems_task_argumen
755 788 if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F1)
756 789 {
757 790 // 1) reorganize the ASM and divide
758 ASM_reorganize_and_divide( incomingMsg->norm->matrix, asm_f0_reorganized, NB_SM_BEFORE_NORM_BP1_F0 );
791 ASM_reorganize_and_divide( incomingMsg->norm->matrix,
792 asm_f1_reorganized,
793 nb_sm_before_f0.norm_bp1 );
759 794 // 2) convert the float array in a char array
760 ASM_convert( asm_f0_reorganized, asm_f0_char);
795 ASM_convert( asm_f1_reorganized, asm_f1_char);
761 796 // 3) send the spectral matrix packets
762 797 set_time( headerASM.time , (unsigned char *) &incomingMsg->coarseTime );
763 798 set_time( headerASM.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime );
764 ASM_send( &headerASM, asm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id);
799 ASM_send( &headerASM, asm_f1_char, SID_NORM_ASM_F1, &spw_ioctl_send_ASM, queue_id_send);
765 800 }
766 801
767 802 }
@@ -1055,7 +1090,7 void ASM_send(Header_TM_LFR_SCIENCE_ASM_
1055 1090 switch(sid)
1056 1091 {
1057 1092 case SID_NORM_ASM_F0:
1058 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2;
1093 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2; // 2 packets will be sent
1059 1094 spw_ioctl_send->data = &spectral_matrix[
1060 1095 ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2
1061 1096 ];
@@ -1064,6 +1099,13 void ASM_send(Header_TM_LFR_SCIENCE_ASM_
1064 1099 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
1065 1100 break;
1066 1101 case SID_NORM_ASM_F1:
1102 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F1_IN_BYTES / 2; // 2 packets will be sent
1103 spw_ioctl_send->data = &spectral_matrix[
1104 ( (ASM_F1_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F1) ) * NB_VALUES_PER_SM ) * 2
1105 ];
1106 length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1;
1107 header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F1) >> 8 ); // BLK_NR MSB
1108 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F1); // BLK_NR LSB
1067 1109 break;
1068 1110 case SID_NORM_ASM_F2:
1069 1111 break;
@@ -533,7 +533,7 int enter_mode( unsigned char mode, unsi
533 533 status = restart_science_tasks( mode );
534 534 launch_waveform_picker( mode, transitionCoarseTime );
535 535 // launch_spectral_matrix( );
536 // launch_spectral_matrix_simu( );
536 launch_spectral_matrix_simu( );
537 537 }
538 538 else if ( mode == LFR_MODE_STANDBY )
539 539 {
General Comments 0
You need to be logged in to leave comments. Login now