##// 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 # Makefile for building: bin/fsw
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 # Project: fsw-qt.pro
4 # Project: fsw-qt.pro
5 # Template: app
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
@@ -1,6 +1,6
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
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 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -19,17 +19,17 typedef struct ring_node
19 } ring_node;
19 } ring_node;
20
20
21 typedef struct {
21 typedef struct {
22 unsigned int norm_bp1_f0;
22 unsigned int norm_bp1;
23 unsigned int norm_bp2_f0;
23 unsigned int norm_bp2;
24 unsigned int norm_asm_f0;
24 unsigned int norm_asm;
25 unsigned int burst_sbm_bp1_f0;
25 unsigned int burst_sbm_bp1;
26 unsigned int burst_sbm_bp2_f0;
26 unsigned int burst_sbm_bp2;
27 unsigned int burst_bp1_f0;
27 unsigned int burst_bp1;
28 unsigned int burst_bp2_f0;
28 unsigned int burst_bp2;
29 unsigned int sbm1_bp1_f0;
29 unsigned int sbm1_bp1;
30 unsigned int sbm1_bp2_f0;
30 unsigned int sbm1_bp2;
31 unsigned int sbm2_bp1_f0;
31 unsigned int sbm2_bp1;
32 unsigned int sbm2_bp2_f0;
32 unsigned int sbm2_bp2;
33 } nb_sm_before_bp_asm_f0;
33 } nb_sm_before_bp_asm_f0;
34
34
35 typedef struct {
35 typedef struct {
@@ -207,7 +207,6 typedef struct {
207 #define TASKID_PRC1 17
207 #define TASKID_PRC1 17
208
208
209 #define TASK_PRIORITY_SPIQ 5
209 #define TASK_PRIORITY_SPIQ 5
210 //#define TASK_PRIORITY_SMIQ 10
211 #define TASK_PRIORITY_WTDG 20
210 #define TASK_PRIORITY_WTDG 20
212 #define TASK_PRIORITY_HOUS 30
211 #define TASK_PRIORITY_HOUS 30
213 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
212 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
@@ -219,9 +218,9 typedef struct {
219 #define TASK_PRIORITY_RECV 50
218 #define TASK_PRIORITY_RECV 50
220 #define TASK_PRIORITY_ACTN 50
219 #define TASK_PRIORITY_ACTN 50
221 #define TASK_PRIORITY_AVF0 60
220 #define TASK_PRIORITY_AVF0 60
221 #define TASK_PRIORITY_AVF1 70
222 #define TASK_PRIORITY_PRC0 100
222 #define TASK_PRIORITY_PRC0 100
223 #define TASK_PRIORITY_PRC1 100
223 #define TASK_PRIORITY_PRC1 100
224 #define TASK_PRIORITY_AVF1 60
225 #define TASK_PRIORITY_STAT 200
224 #define TASK_PRIORITY_STAT 200
226 #define TASK_PRIORITY_DUMB 200
225 #define TASK_PRIORITY_DUMB 200
227
226
@@ -25,13 +25,13
25 //
25 //
26 #define NB_BINS_PER_ASM_F1 104
26 #define NB_BINS_PER_ASM_F1 104
27 #define NB_BINS_PER_PKT_ASM_F1 52
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 #define ASM_F1_INDICE_START 6 // 104 bins
29 #define ASM_F1_INDICE_START 6 // 104 bins
30 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
30 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
31 //
31 //
32 #define NB_BINS_PER_ASM_F2 96
32 #define NB_BINS_PER_ASM_F2 96
33 #define NB_BINS_PER_PKT_ASM_F2 48
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 #define ASM_F2_INDICE_START 7 // 96 bins
35 #define ASM_F2_INDICE_START 7 // 96 bins
36 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
36 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
37 //
37 //
@@ -49,23 +49,13
49 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
49 #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4
50 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
50 #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4
51 //
51 //
52 #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS
52 #define TOTAL_SIZE_COMPRESSED_ASM_NORM_F0 275 // 11 * 25 WORDS
53 #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 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
54 #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS
55 #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 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 // NORM
57 // NORM
57 #define NB_SM_BEFORE_NORM_BP1_F0 384 // 96 * 4
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 // GENERAL
59 // GENERAL
70 #define NB_SM_BEFORE_AVF0 8
60 #define NB_SM_BEFORE_AVF0 8
71 #define NB_SM_BEFORE_AVF1 8
61 #define NB_SM_BEFORE_AVF1 8
@@ -12,6 +12,8
12 #include "fsw_processing_globals.c"
12 #include "fsw_processing_globals.c"
13
13
14 unsigned int nb_sm_f0;
14 unsigned int nb_sm_f0;
15 unsigned int nb_sm_f0_aux;
16 unsigned int nb_sm_f1;
15
17
16 //************************
18 //************************
17 // spectral matrices rings
19 // spectral matrices rings
@@ -35,8 +37,13 ring_node_asm *current_ring_node_asm_nor
35
37
36 float asm_f0_reorganized [ TOTAL_SIZE_SM ];
38 float asm_f0_reorganized [ TOTAL_SIZE_SM ];
37 char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
39 char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
38 float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_F0 ];
40 float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_NORM_F0];
39 float compressed_sm_sbm [ TOTAL_SIZE_COMPRESSED_ASM_SBM1 ];
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 // Interrupt Service Routine for spectral matrices processing
49 // Interrupt Service Routine for spectral matrices processing
@@ -44,41 +51,44 float compressed_sm_sbm [ TOTAL_SIZE_
44 void reset_nb_sm_f0( unsigned char lfrMode )
51 void reset_nb_sm_f0( unsigned char lfrMode )
45 {
52 {
46 nb_sm_f0 = 0;
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;
56 nb_sm_before_f0.norm_bp1 = 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;
57 nb_sm_before_f0.norm_bp2 = 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;
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;
51 nb_sm_before_f0.sbm1_bp1_f0 = parameter_dump_packet.sy_lfr_s1_bp_p0 * 24;
59 nb_sm_before_f0.sbm1_bp1 = 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;
60 nb_sm_before_f0.sbm1_bp2 = 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;
61 nb_sm_before_f0.sbm2_bp1 = 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;
62 nb_sm_before_f0.sbm2_bp2 = 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;
63 nb_sm_before_f0.burst_bp1 = 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;
64 nb_sm_before_f0.burst_bp2 = parameter_dump_packet.sy_lfr_b_bp_p1 * 96;
57
65
58 if (lfrMode == LFR_MODE_SBM1)
66 if (lfrMode == LFR_MODE_SBM1)
59 {
67 {
60 nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm1_bp1_f0;
68 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.sbm1_bp1;
61 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm1_bp2_f0;
69 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.sbm1_bp2;
62 }
70 }
63 else if (lfrMode == LFR_MODE_SBM2)
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;
73 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.sbm2_bp1;
66 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm2_bp2_f0;
74 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.sbm2_bp2;
67 }
75 }
68 else if (lfrMode == LFR_MODE_BURST)
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;
78 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.burst_bp1;
71 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0;
79 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.burst_bp2;
72 }
80 }
73 else
81 else
74 {
82 {
75 nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0;
83 nb_sm_before_f0.burst_sbm_bp1 = nb_sm_before_f0.burst_bp1;
76 nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0;
84 nb_sm_before_f0.burst_sbm_bp2 = nb_sm_before_f0.burst_bp2;
77 }
85 }
78 }
86 }
79
87
80 void reset_nb_sm_f1( unsigned char lfrMode )
88 void reset_nb_sm_f1( unsigned char lfrMode )
81 {
89 {
90 nb_sm_f1 = 0;
91
82 nb_sm_before_f1.norm_bp1 = parameter_dump_packet.sy_lfr_n_bp_p0 * 16;
92 nb_sm_before_f1.norm_bp1 = parameter_dump_packet.sy_lfr_n_bp_p0 * 16;
83 nb_sm_before_f1.norm_bp2 = parameter_dump_packet.sy_lfr_n_bp_p1 * 16;
93 nb_sm_before_f1.norm_bp2 = parameter_dump_packet.sy_lfr_n_bp_p1 * 16;
84 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;
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 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
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 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
191 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
179 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
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 nb_sm_f0 = 0;
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 asm_msg msgForMATR;
231 asm_msg msgForMATR;
205 ring_node_sm *ring_node_tab[8];
232 ring_node_sm *ring_node_tab[8];
206
233
207 static unsigned int nb_norm_bp1;
234 unsigned int nb_norm_bp1;
208 static unsigned int nb_norm_bp2;
235 unsigned int nb_norm_bp2;
209 static unsigned int nb_norm_asm;
236 unsigned int nb_norm_asm;
210 static unsigned int nb_sbm_bp1;
237 unsigned int nb_sbm_bp1;
211 static unsigned int nb_sbm_bp2;
238 unsigned int nb_sbm_bp2;
212
239
213 nb_norm_bp1 = 0;
240 nb_norm_bp1 = 0;
214 nb_norm_bp2 = 0;
241 nb_norm_bp2 = 0;
@@ -253,10 +280,12 rtems_task avf0_task( rtems_task_argumen
253 msgForMATR.event = 0x00; // this composite event will be sent to the MATR task
280 msgForMATR.event = 0x00; // this composite event will be sent to the MATR task
254 msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f0;
281 msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f0;
255 msgForMATR.norm = current_ring_node_asm_norm_f0;
282 msgForMATR.norm = current_ring_node_asm_norm_f0;
256 msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
283 // msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
257 msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1];
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 nb_sbm_bp1 = 0;
290 nb_sbm_bp1 = 0;
262 // set another ring for the ASM storage
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 nb_sbm_bp2 = 0;
302 nb_sbm_bp2 = 0;
274 if ( (lfrCurrentMode == LFR_MODE_BURST)
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 nb_norm_bp1 = 0;
312 nb_norm_bp1 = 0;
284 // set another ring for the ASM storage
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 nb_norm_bp2 = 0;
324 nb_norm_bp2 = 0;
296 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
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 nb_norm_asm = 0;
334 nb_norm_asm = 0;
306 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
335 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
@@ -415,8 +444,8 rtems_task prc0_task( rtems_task_argumen
415 if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 )
444 if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 )
416 {
445 {
417 // 1) compress the matrix for Basic Parameters calculation
446 // 1) compress the matrix for Basic Parameters calculation
418 ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm,
447 ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm_f0,
419 nb_sm_before_f0.burst_sbm_bp1_f0,
448 nb_sm_before_f0.burst_sbm_bp1,
420 NB_BINS_COMPRESSED_SM_SBM_F0, NB_BINS_TO_AVERAGE_ASM_SBM_F0,
449 NB_BINS_COMPRESSED_SM_SBM_F0, NB_BINS_TO_AVERAGE_ASM_SBM_F0,
421 ASM_F0_INDICE_START);
450 ASM_F0_INDICE_START);
422 // 2) compute the BP1 set
451 // 2) compute the BP1 set
@@ -448,7 +477,7 rtems_task prc0_task( rtems_task_argumen
448 {
477 {
449 // 1) compress the matrix for Basic Parameters calculation
478 // 1) compress the matrix for Basic Parameters calculation
450 ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f0,
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 NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0,
481 NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0,
453 ASM_F0_INDICE_START );
482 ASM_F0_INDICE_START );
454 // 2) compute the BP1 set
483 // 2) compute the BP1 set
@@ -460,7 +489,7 rtems_task prc0_task( rtems_task_argumen
460 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 + PACKET_LENGTH_DELTA);
489 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 + PACKET_LENGTH_DELTA);
461 if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F0)
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 // 2) send the BP2 set
494 // 2) send the BP2 set
466 set_time( packet_norm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime );
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 if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F0)
502 if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F0)
474 {
503 {
475 // 1) reorganize the ASM and divide
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 // 2) convert the float array in a char array
508 // 2) convert the float array in a char array
478 ASM_convert( asm_f0_reorganized, asm_f0_char);
509 ASM_convert( asm_f0_reorganized, asm_f0_char);
479 // 3) send the spectral matrix packets
510 // 3) send the spectral matrix packets
@@ -498,11 +529,11 rtems_task avf1_task( rtems_task_argumen
498 asm_msg msgForMATR;
529 asm_msg msgForMATR;
499 ring_node_sm *ring_node_tab[8];
530 ring_node_sm *ring_node_tab[8];
500
531
501 static unsigned int nb_norm_bp1;
532 unsigned int nb_norm_bp1;
502 static unsigned int nb_norm_bp2;
533 unsigned int nb_norm_bp2;
503 static unsigned int nb_norm_asm;
534 unsigned int nb_norm_asm;
504 static unsigned int nb_sbm_bp1;
535 unsigned int nb_sbm_bp1;
505 static unsigned int nb_sbm_bp2;
536 unsigned int nb_sbm_bp2;
506
537
507 nb_norm_bp1 = 0;
538 nb_norm_bp1 = 0;
508 nb_norm_bp2 = 0;
539 nb_norm_bp2 = 0;
@@ -547,8 +578,10 rtems_task avf1_task( rtems_task_argumen
547 msgForMATR.event = 0x00; // this composite event will be sent to the PRC1 task
578 msgForMATR.event = 0x00; // this composite event will be sent to the PRC1 task
548 msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f1;
579 msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f1;
549 msgForMATR.norm = current_ring_node_asm_norm_f1;
580 msgForMATR.norm = current_ring_node_asm_norm_f1;
550 msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
581 // msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0];
551 msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1];
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 if (nb_sbm_bp1 == nb_sm_before_f1.burst_sbm_bp1)
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 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
611 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
579 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
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 spw_ioctl_pkt_send spw_ioctl_send_ASM;
657 spw_ioctl_pkt_send spw_ioctl_send_ASM;
625 rtems_status_code status;
658 rtems_status_code status;
626 rtems_id queue_id;
659 rtems_id queue_id_send;
627 rtems_id queue_id_q_p1;
660 rtems_id queue_id_q_p1;
628 Header_TM_LFR_SCIENCE_ASM_t headerASM;
661 Header_TM_LFR_SCIENCE_ASM_t headerASM;
629 bp_packet_with_spare packet_norm_bp1;
662 bp_packet_with_spare packet_norm_bp1;
@@ -666,10 +699,10 rtems_task prc1_task( rtems_task_argumen
666 }
699 }
667 else
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 if (status != RTEMS_SUCCESSFUL)
706 if (status != RTEMS_SUCCESSFUL)
674 {
707 {
675 PRINTF1("in PRC1 *** ERR get_message_queue_id_send %d\n", status)
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 if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F1 )
730 if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F1 )
698 {
731 {
699 // 1) compress the matrix for Basic Parameters calculation
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 nb_sm_before_f1.burst_sbm_bp1,
734 nb_sm_before_f1.burst_sbm_bp1,
702 NB_BINS_COMPRESSED_SM_SBM_F1, NB_BINS_TO_AVERAGE_ASM_SBM_F1,
735 NB_BINS_COMPRESSED_SM_SBM_F1, NB_BINS_TO_AVERAGE_ASM_SBM_F1,
703 ASM_F1_INDICE_START);
736 ASM_F1_INDICE_START);
@@ -706,7 +739,7 rtems_task prc1_task( rtems_task_argumen
706 // 3) send the BP1 set
739 // 3) send the BP1 set
707 set_time( packet_sbm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime );
740 set_time( packet_sbm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime );
708 set_time( packet_sbm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
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 PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 + PACKET_LENGTH_DELTA);
743 PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 + PACKET_LENGTH_DELTA);
711 // 4) compute the BP2 set if needed
744 // 4) compute the BP2 set if needed
712 if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F1 )
745 if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F1 )
@@ -716,7 +749,7 rtems_task prc1_task( rtems_task_argumen
716 // 2) send the BP2 set
749 // 2) send the BP2 set
717 set_time( packet_sbm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime );
750 set_time( packet_sbm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime );
718 set_time( packet_sbm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
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 PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 + PACKET_LENGTH_DELTA);
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 if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F1)
762 if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F1)
730 {
763 {
731 // 1) compress the matrix for Basic Parameters calculation
764 // 1) compress the matrix for Basic Parameters calculation
732 ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f0,
765 ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f1,
733 nb_sm_before_f0.norm_bp1_f0,
766 nb_sm_before_f0.norm_bp1,
734 NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0,
767 NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0,
735 ASM_F0_INDICE_START );
768 ASM_F0_INDICE_START );
736 // 2) compute the BP1 set
769 // 2) compute the BP1 set
@@ -738,7 +771,7 rtems_task prc1_task( rtems_task_argumen
738 // 3) send the BP1 set
771 // 3) send the BP1 set
739 set_time( packet_norm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime );
772 set_time( packet_norm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime );
740 set_time( packet_norm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
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 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 + PACKET_LENGTH_DELTA);
775 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 + PACKET_LENGTH_DELTA);
743 if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F1)
776 if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F1)
744 {
777 {
@@ -747,7 +780,7 rtems_task prc1_task( rtems_task_argumen
747 // 2) send the BP2 set
780 // 2) send the BP2 set
748 set_time( packet_norm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime );
781 set_time( packet_norm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime );
749 set_time( packet_norm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime );
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 PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 + PACKET_LENGTH_DELTA);
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 if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F1)
788 if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F1)
756 {
789 {
757 // 1) reorganize the ASM and divide
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 // 2) convert the float array in a char array
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 // 3) send the spectral matrix packets
796 // 3) send the spectral matrix packets
762 set_time( headerASM.time , (unsigned char *) &incomingMsg->coarseTime );
797 set_time( headerASM.time , (unsigned char *) &incomingMsg->coarseTime );
763 set_time( headerASM.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime );
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 switch(sid)
1090 switch(sid)
1056 {
1091 {
1057 case SID_NORM_ASM_F0:
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 spw_ioctl_send->data = &spectral_matrix[
1094 spw_ioctl_send->data = &spectral_matrix[
1060 ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2
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 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
1099 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
1065 break;
1100 break;
1066 case SID_NORM_ASM_F1:
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 break;
1109 break;
1068 case SID_NORM_ASM_F2:
1110 case SID_NORM_ASM_F2:
1069 break;
1111 break;
@@ -533,7 +533,7 int enter_mode( unsigned char mode, unsi
533 status = restart_science_tasks( mode );
533 status = restart_science_tasks( mode );
534 launch_waveform_picker( mode, transitionCoarseTime );
534 launch_waveform_picker( mode, transitionCoarseTime );
535 // launch_spectral_matrix( );
535 // launch_spectral_matrix( );
536 // launch_spectral_matrix_simu( );
536 launch_spectral_matrix_simu( );
537 }
537 }
538 else if ( mode == LFR_MODE_STANDBY )
538 else if ( mode == LFR_MODE_STANDBY )
539 {
539 {
General Comments 0
You need to be logged in to leave comments. Login now