# HG changeset patch # User paul # Date 2014-04-03 08:09:55 # Node ID 46134e185f5562ed4bd10b9d2e3ca0df1e500651 # Parent 693baae2bc2c6217c9a1c7ebd3f413a76ed74829 rev 1.0.0.5 diff --git a/FSW-qt/Makefile b/FSW-qt/Makefile --- a/FSW-qt/Makefile +++ b/FSW-qt/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: bin/fsw -# Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Apr 1 12:03:12 2014 +# Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Apr 3 10:09:31 2014 # Project: fsw-qt.pro # Template: app # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro @@ -10,7 +10,7 @@ CC = sparc-rtems-gcc CXX = sparc-rtems-g++ -DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=5 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS +DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=5 -DPRINT_MESSAGES_ON_CONSOLE CFLAGS = -pipe -O3 -Wall $(DEFINES) CXXFLAGS = -pipe -O3 -Wall $(DEFINES) INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../../LFR_basic-parameters diff --git a/FSW-qt/fsw-qt.pro b/FSW-qt/fsw-qt.pro --- a/FSW-qt/fsw-qt.pro +++ b/FSW-qt/fsw-qt.pro @@ -1,7 +1,7 @@ TEMPLATE = app # CONFIG += console v8 sim # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch -CONFIG += console verbose cpu_usage_report +CONFIG += console verbose CONFIG -= qt include(./sparc.pri) diff --git a/FSW-qt/fsw-qt.pro.user b/FSW-qt/fsw-qt.pro.user --- a/FSW-qt/fsw-qt.pro.user +++ b/FSW-qt/fsw-qt.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/header/fsw_params_processing.h b/header/fsw_params_processing.h --- a/header/fsw_params_processing.h +++ b/header/fsw_params_processing.h @@ -42,8 +42,8 @@ #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS -#define NB_AVERAGE_NORMAL_f0 384 // 96 * 4 -#define NB_AVERAGE_SBM1_f0 24 // 24 matrices at f0 = 0.25 second +#define NB_AVERAGE_NORMAL_F0 384 // 96 * 4 +#define NB_AVERAGE_SBM1_F0 24 // 24 matrices at f0 = 0.25 second #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8 typedef struct { diff --git a/src/fsw_processing.c b/src/fsw_processing.c --- a/src/fsw_processing.c +++ b/src/fsw_processing.c @@ -203,14 +203,14 @@ rtems_task smiq_task(rtems_task_argument rtems_task avf0_task(rtems_task_argument argument) { int i; - static unsigned int nb_average_norm; - static unsigned int nb_average_sbm1; + static unsigned int nb_average_norm_f0; + static unsigned int nb_average_sbm1_f0; rtems_event_set event_out; rtems_status_code status; ring_node_sm *ring_node_tab[8]; - nb_average_norm = 0; - nb_average_sbm1 = 0; + nb_average_norm_f0 = 0; + nb_average_sbm1_f0 = 0; BOOT_PRINTF("in AVFO *** \n") @@ -226,38 +226,39 @@ rtems_task avf0_task(rtems_task_argument // copy time information in the averaged_sm_f0 buffer averaged_sm_f0[0] = ring_node_tab[7]->coarseTime; averaged_sm_f0[1] = ring_node_tab[7]->fineTime; - averaged_sm_f1[0] = ring_node_tab[7]->coarseTime; - averaged_sm_f1[1] = ring_node_tab[7]->fineTime; + averaged_sm_sbm1[0] = ring_node_tab[7]->coarseTime; + averaged_sm_sbm1[1] = ring_node_tab[7]->fineTime; // compute the average and store it in the averaged_sm_f1 buffer - ASM_average( averaged_sm_f0, averaged_sm_f1, + ASM_average( averaged_sm_f0, averaged_sm_sbm1, ring_node_tab, - nb_average_norm, nb_average_sbm1 ); + nb_average_norm_f0, nb_average_sbm1_f0 ); // update nb_average - nb_average_norm = nb_average_norm + NB_SM_TO_RECEIVE_BEFORE_AVF0; - nb_average_sbm1 = nb_average_sbm1 + NB_SM_TO_RECEIVE_BEFORE_AVF0; + nb_average_norm_f0 = nb_average_norm_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0; + nb_average_sbm1_f0 = nb_average_sbm1_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0; // launch actions depending on the current mode - if (lfrCurrentMode == LFR_MODE_SBM1) + + if (nb_average_sbm1_f0 == NB_AVERAGE_SBM1_F0) { - if (nb_average_sbm1 == NB_AVERAGE_SBM1_f0) { - nb_average_sbm1 = 0; + nb_average_sbm1_f0 = 0; + if (lfrCurrentMode == LFR_MODE_SBM1) + { status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_SBM1 ); // sending an event to the task 7, BPF0 - if (status != RTEMS_SUCCESSFUL) { - printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status); + if (status != RTEMS_SUCCESSFUL) + { + printf("in AVF0 *** Error sending RTEMS_EVENT_MODE_SBM1, code %d\n", status); } } } - if (lfrCurrentMode == LFR_MODE_NORMAL) - { - if (nb_average_norm == NB_AVERAGE_NORMAL_f0) { - nb_average_norm = 0; - status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_NORMAL ); // sending an event to the task 7, BPF0 - if (status != RTEMS_SUCCESSFUL) { - printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status); - } + + if (nb_average_norm_f0 == NB_AVERAGE_NORMAL_F0) { + nb_average_norm_f0 = 0; + status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_NORMAL ); // sending an event to the task 7, BPF0 + if (status != RTEMS_SUCCESSFUL) { + printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status); } } } @@ -292,20 +293,22 @@ rtems_task matr_task(rtems_task_argument ASM_compress( averaged_sm_f0, 0, compressed_sm_f0 ); // 2) compute the BP1 set - // 3) convert the float array in a char array + // 3) send the BP1 set + + // 4) convert the float array in a char array ASM_reorganize( averaged_sm_f0, averaged_sm_f0_reorganized ); ASM_convert( averaged_sm_f0_reorganized, averaged_sm_f0_char); - // 4) send the spectral matrix packets + // 5) send the spectral matrix packets ASM_send( &headerASM, averaged_sm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id); } else if (event_out==RTEMS_EVENT_MODE_SBM1) { // 1) compress the matrix for Basic Parameters calculation - ASM_compress( averaged_sm_f1, 0, compressed_sm_f1 ); + ASM_compress( averaged_sm_sbm1, 0, compressed_sm_sbm1 ); // 2) compute the BP1 set - // 4) send the basic parameters set 1 packet - BP1_send( ); + // 3) send the basic parameters set 1 packet + } else { @@ -327,7 +330,7 @@ void matrix_reset(volatile float *averag void ASM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, ring_node_sm *ring_node_tab[], - unsigned int firstTimeF0, unsigned int firstTimeF1 ) + unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ) { float sum; unsigned int i; @@ -343,25 +346,24 @@ void ASM_average( float *averaged_spec_m + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; - if ( (firstTimeF0 == 0) && (firstTimeF1 == 0) ) + if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) ) { - averaged_spec_mat_f0[ i ] = averaged_spec_mat_f0[ i ] + sum; - averaged_spec_mat_f1[ i ] = averaged_spec_mat_f1[ i ] + sum; + averaged_spec_mat_f0[ TIME_OFFSET + i ] = sum; + averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum; } - else if ( (firstTimeF0 == 0) && (firstTimeF1 != 0) ) + else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) ) { - averaged_spec_mat_f0[ i ] = averaged_spec_mat_f0[ i ] + sum; - averaged_spec_mat_f1[ i ] = sum; + averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum ); + averaged_spec_mat_f1[ TIME_OFFSET + i ] = ( averaged_spec_mat_f1[ TIME_OFFSET + i ] + sum ); } - else if ( (firstTimeF0 != 0) && (firstTimeF1 == 0) ) + else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) ) { - averaged_spec_mat_f0[ i ] = sum; - averaged_spec_mat_f1[ i ] = averaged_spec_mat_f1[ i ] + sum; + averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum ); + averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum; } else { - averaged_spec_mat_f0[ i ] = sum; - averaged_spec_mat_f1[ i ] = sum; + PRINTF2("ERR *** in ASM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0) } } } @@ -379,8 +381,8 @@ void ASM_reorganize( float *averaged_spe { for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ ) { - averaged_spec_mat_reorganized[ frequencyBin * NB_VALUES_PER_SM + asmComponent + TIME_OFFSET ] = - averaged_spec_mat[ asmComponent * NB_BINS_PER_SM + frequencyBin + TIME_OFFSET]; + averaged_spec_mat_reorganized[ TIME_OFFSET + frequencyBin * NB_VALUES_PER_SM + asmComponent ] = + averaged_spec_mat[ TIME_OFFSET + asmComponent * NB_BINS_PER_SM + frequencyBin ]; } } } diff --git a/src/tc_handler.c b/src/tc_handler.c --- a/src/tc_handler.c +++ b/src/tc_handler.c @@ -532,7 +532,7 @@ int enter_mode( unsigned char mode, unsi #endif status = restart_science_tasks(); launch_waveform_picker( mode, transitionCoarseTime ); - launch_spectral_matrix_simu( mode ); +// launch_spectral_matrix_simu( mode ); } else if ( mode == LFR_MODE_STANDBY ) {