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