@@ -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: T |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Apr 3 10:09:31 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 | |
@@ -10,7 +10,7 | |||||
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 |
DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=5 -DPRINT_MESSAGES_ON_CONSOLE |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=5 -DPRINT_MESSAGES_ON_CONSOLE | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../../LFR_basic-parameters |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../../LFR_basic-parameters |
@@ -1,7 +1,7 | |||||
1 | TEMPLATE = app |
|
1 | TEMPLATE = app | |
2 | # CONFIG += console v8 sim |
|
2 | # CONFIG += console v8 sim | |
3 | # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch |
|
3 | # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch | |
4 |
CONFIG += console verbose |
|
4 | CONFIG += console verbose | |
5 | CONFIG -= qt |
|
5 | CONFIG -= qt | |
6 |
|
6 | |||
7 | include(./sparc.pri) |
|
7 | include(./sparc.pri) |
@@ -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-0 |
|
3 | <!-- Written by QtCreator 3.0.1, 2014-04-03T08:17:16. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -42,8 +42,8 | |||||
42 | #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS |
|
42 | #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS | |
43 | #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS |
|
43 | #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS | |
44 | #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS |
|
44 | #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS | |
45 |
#define NB_AVERAGE_NORMAL_ |
|
45 | #define NB_AVERAGE_NORMAL_F0 384 // 96 * 4 | |
46 |
#define NB_AVERAGE_SBM1_ |
|
46 | #define NB_AVERAGE_SBM1_F0 24 // 24 matrices at f0 = 0.25 second | |
47 | #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8 |
|
47 | #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8 | |
48 |
|
48 | |||
49 | typedef struct { |
|
49 | typedef struct { |
@@ -203,14 +203,14 rtems_task smiq_task(rtems_task_argument | |||||
203 | rtems_task avf0_task(rtems_task_argument argument) |
|
203 | rtems_task avf0_task(rtems_task_argument argument) | |
204 | { |
|
204 | { | |
205 | int i; |
|
205 | int i; | |
206 | static unsigned int nb_average_norm; |
|
206 | static unsigned int nb_average_norm_f0; | |
207 | static unsigned int nb_average_sbm1; |
|
207 | static unsigned int nb_average_sbm1_f0; | |
208 | rtems_event_set event_out; |
|
208 | rtems_event_set event_out; | |
209 | rtems_status_code status; |
|
209 | rtems_status_code status; | |
210 | ring_node_sm *ring_node_tab[8]; |
|
210 | ring_node_sm *ring_node_tab[8]; | |
211 |
|
211 | |||
212 | nb_average_norm = 0; |
|
212 | nb_average_norm_f0 = 0; | |
213 | nb_average_sbm1 = 0; |
|
213 | nb_average_sbm1_f0 = 0; | |
214 |
|
214 | |||
215 | BOOT_PRINTF("in AVFO *** \n") |
|
215 | BOOT_PRINTF("in AVFO *** \n") | |
216 |
|
216 | |||
@@ -226,34 +226,36 rtems_task avf0_task(rtems_task_argument | |||||
226 | // copy time information in the averaged_sm_f0 buffer |
|
226 | // copy time information in the averaged_sm_f0 buffer | |
227 | averaged_sm_f0[0] = ring_node_tab[7]->coarseTime; |
|
227 | averaged_sm_f0[0] = ring_node_tab[7]->coarseTime; | |
228 | averaged_sm_f0[1] = ring_node_tab[7]->fineTime; |
|
228 | averaged_sm_f0[1] = ring_node_tab[7]->fineTime; | |
229 |
averaged_sm_ |
|
229 | averaged_sm_sbm1[0] = ring_node_tab[7]->coarseTime; | |
230 |
averaged_sm_ |
|
230 | averaged_sm_sbm1[1] = ring_node_tab[7]->fineTime; | |
231 |
|
231 | |||
232 | // compute the average and store it in the averaged_sm_f1 buffer |
|
232 | // compute the average and store it in the averaged_sm_f1 buffer | |
233 |
ASM_average( averaged_sm_f0, averaged_sm_ |
|
233 | ASM_average( averaged_sm_f0, averaged_sm_sbm1, | |
234 | ring_node_tab, |
|
234 | ring_node_tab, | |
235 | nb_average_norm, nb_average_sbm1 ); |
|
235 | nb_average_norm_f0, nb_average_sbm1_f0 ); | |
236 |
|
236 | |||
237 |
|
237 | |||
238 | // update nb_average |
|
238 | // update nb_average | |
239 | nb_average_norm = nb_average_norm + NB_SM_TO_RECEIVE_BEFORE_AVF0; |
|
239 | nb_average_norm_f0 = nb_average_norm_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0; | |
240 | nb_average_sbm1 = nb_average_sbm1 + NB_SM_TO_RECEIVE_BEFORE_AVF0; |
|
240 | nb_average_sbm1_f0 = nb_average_sbm1_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0; | |
241 |
|
241 | |||
242 | // launch actions depending on the current mode |
|
242 | // launch actions depending on the current mode | |
|
243 | ||||
|
244 | if (nb_average_sbm1_f0 == NB_AVERAGE_SBM1_F0) | |||
|
245 | { | |||
|
246 | nb_average_sbm1_f0 = 0; | |||
243 | if (lfrCurrentMode == LFR_MODE_SBM1) |
|
247 | if (lfrCurrentMode == LFR_MODE_SBM1) | |
244 | { |
|
248 | { | |
245 | if (nb_average_sbm1 == NB_AVERAGE_SBM1_f0) { |
|
|||
246 | nb_average_sbm1 = 0; |
|
|||
247 | status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_SBM1 ); // sending an event to the task 7, BPF0 |
|
249 | status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_SBM1 ); // sending an event to the task 7, BPF0 | |
248 |
if (status != RTEMS_SUCCESSFUL) |
|
250 | if (status != RTEMS_SUCCESSFUL) | |
249 | printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status); |
|
251 | { | |
|
252 | printf("in AVF0 *** Error sending RTEMS_EVENT_MODE_SBM1, code %d\n", status); | |||
250 | } |
|
253 | } | |
251 | } |
|
254 | } | |
252 | } |
|
255 | } | |
253 | if (lfrCurrentMode == LFR_MODE_NORMAL) |
|
256 | ||
254 | { |
|
257 | if (nb_average_norm_f0 == NB_AVERAGE_NORMAL_F0) { | |
255 |
|
|
258 | nb_average_norm_f0 = 0; | |
256 | nb_average_norm = 0; |
|
|||
257 |
|
|
259 | status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_NORMAL ); // sending an event to the task 7, BPF0 | |
258 |
|
|
260 | if (status != RTEMS_SUCCESSFUL) { | |
259 |
|
|
261 | printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status); | |
@@ -261,7 +263,6 rtems_task avf0_task(rtems_task_argument | |||||
261 |
|
|
263 | } | |
262 |
|
|
264 | } | |
263 | } |
|
265 | } | |
264 | } |
|
|||
265 |
|
266 | |||
266 | rtems_task matr_task(rtems_task_argument argument) |
|
267 | rtems_task matr_task(rtems_task_argument argument) | |
267 | { |
|
268 | { | |
@@ -292,20 +293,22 rtems_task matr_task(rtems_task_argument | |||||
292 | ASM_compress( averaged_sm_f0, 0, compressed_sm_f0 ); |
|
293 | ASM_compress( averaged_sm_f0, 0, compressed_sm_f0 ); | |
293 | // 2) compute the BP1 set |
|
294 | // 2) compute the BP1 set | |
294 |
|
295 | |||
295 | // 3) convert the float array in a char array |
|
296 | // 3) send the BP1 set | |
|
297 | ||||
|
298 | // 4) convert the float array in a char array | |||
296 | ASM_reorganize( averaged_sm_f0, averaged_sm_f0_reorganized ); |
|
299 | ASM_reorganize( averaged_sm_f0, averaged_sm_f0_reorganized ); | |
297 | ASM_convert( averaged_sm_f0_reorganized, averaged_sm_f0_char); |
|
300 | ASM_convert( averaged_sm_f0_reorganized, averaged_sm_f0_char); | |
298 |
// |
|
301 | // 5) send the spectral matrix packets | |
299 | ASM_send( &headerASM, averaged_sm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id); |
|
302 | ASM_send( &headerASM, averaged_sm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id); | |
300 | } |
|
303 | } | |
301 | else if (event_out==RTEMS_EVENT_MODE_SBM1) |
|
304 | else if (event_out==RTEMS_EVENT_MODE_SBM1) | |
302 | { |
|
305 | { | |
303 | // 1) compress the matrix for Basic Parameters calculation |
|
306 | // 1) compress the matrix for Basic Parameters calculation | |
304 |
ASM_compress( averaged_sm_ |
|
307 | ASM_compress( averaged_sm_sbm1, 0, compressed_sm_sbm1 ); | |
305 | // 2) compute the BP1 set |
|
308 | // 2) compute the BP1 set | |
306 |
|
309 | |||
307 |
// |
|
310 | // 3) send the basic parameters set 1 packet | |
308 | BP1_send( ); |
|
311 | ||
309 | } |
|
312 | } | |
310 | else |
|
313 | else | |
311 | { |
|
314 | { | |
@@ -327,7 +330,7 void matrix_reset(volatile float *averag | |||||
327 |
|
330 | |||
328 | void ASM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, |
|
331 | void ASM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, | |
329 | ring_node_sm *ring_node_tab[], |
|
332 | ring_node_sm *ring_node_tab[], | |
330 |
unsigned int |
|
333 | unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ) | |
331 | { |
|
334 | { | |
332 | float sum; |
|
335 | float sum; | |
333 | unsigned int i; |
|
336 | unsigned int i; | |
@@ -343,25 +346,24 void ASM_average( float *averaged_spec_m | |||||
343 | + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] |
|
346 | + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] | |
344 | + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; |
|
347 | + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; | |
345 |
|
348 | |||
346 |
if ( ( |
|
349 | if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) ) | |
347 | { |
|
350 | { | |
348 |
averaged_spec_mat_f0[ i ] = |
|
351 | averaged_spec_mat_f0[ TIME_OFFSET + i ] = sum; | |
349 |
averaged_spec_mat_f1[ i ] = |
|
352 | averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum; | |
350 | } |
|
353 | } | |
351 |
else if ( ( |
|
354 | else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) ) | |
352 | { |
|
355 | { | |
353 | averaged_spec_mat_f0[ i ] = averaged_spec_mat_f0[ i ] + sum; |
|
356 | averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum ); | |
354 | averaged_spec_mat_f1[ i ] = sum; |
|
357 | averaged_spec_mat_f1[ TIME_OFFSET + i ] = ( averaged_spec_mat_f1[ TIME_OFFSET + i ] + sum ); | |
355 | } |
|
358 | } | |
356 |
else if ( ( |
|
359 | else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) ) | |
357 | { |
|
360 | { | |
358 | averaged_spec_mat_f0[ i ] = sum; |
|
361 | averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum ); | |
359 |
averaged_spec_mat_f1[ i ] = |
|
362 | averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum; | |
360 | } |
|
363 | } | |
361 | else |
|
364 | else | |
362 | { |
|
365 | { | |
363 | averaged_spec_mat_f0[ i ] = sum; |
|
366 | PRINTF2("ERR *** in ASM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0) | |
364 | averaged_spec_mat_f1[ i ] = sum; |
|
|||
365 | } |
|
367 | } | |
366 | } |
|
368 | } | |
367 | } |
|
369 | } | |
@@ -379,8 +381,8 void ASM_reorganize( float *averaged_spe | |||||
379 | { |
|
381 | { | |
380 | for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ ) |
|
382 | for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ ) | |
381 | { |
|
383 | { | |
382 |
averaged_spec_mat_reorganized[ frequencyBin * NB_VALUES_PER_SM + asmComponent |
|
384 | averaged_spec_mat_reorganized[ TIME_OFFSET + frequencyBin * NB_VALUES_PER_SM + asmComponent ] = | |
383 |
averaged_spec_mat[ asmComponent * NB_BINS_PER_SM + frequencyBin |
|
385 | averaged_spec_mat[ TIME_OFFSET + asmComponent * NB_BINS_PER_SM + frequencyBin ]; | |
384 | } |
|
386 | } | |
385 | } |
|
387 | } | |
386 | } |
|
388 | } |
@@ -532,7 +532,7 int enter_mode( unsigned char mode, unsi | |||||
532 | #endif |
|
532 | #endif | |
533 | status = restart_science_tasks(); |
|
533 | status = restart_science_tasks(); | |
534 | launch_waveform_picker( mode, transitionCoarseTime ); |
|
534 | launch_waveform_picker( mode, transitionCoarseTime ); | |
535 | launch_spectral_matrix_simu( mode ); |
|
535 | // launch_spectral_matrix_simu( mode ); | |
536 | } |
|
536 | } | |
537 | else if ( mode == LFR_MODE_STANDBY ) |
|
537 | else if ( mode == LFR_MODE_STANDBY ) | |
538 | { |
|
538 | { |
General Comments 0
You need to be logged in to leave comments.
Login now