@@ -1,2 +1,2 | |||||
1 | a309a930a482e851061936696121f4a1cf7005de LFR_basic-parameters |
|
1 | d896e23033404156cdc95f5bf66e038de84de04b LFR_basic-parameters | |
2 | 2b5dc338fb623046072d6eb98c26ad884e17f95e header/lfr_common_headers |
|
2 | 5cfb4f574403f86583ac510d5921709548a9c902 header/lfr_common_headers |
@@ -2,7 +2,7 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 | # lpp_dpu_destid |
|
4 | # lpp_dpu_destid | |
5 | CONFIG += console verbose lpp_dpu_destid |
|
5 | CONFIG += console verbose lpp_dpu_destid cpu_usage_report | |
6 | CONFIG -= qt |
|
6 | CONFIG -= qt | |
7 |
|
7 | |||
8 | include(./sparc.pri) |
|
8 | include(./sparc.pri) | |
@@ -28,7 +28,7 contains( CONFIG, lpp_dpu_destid ) { | |||||
28 | contains( CONFIG, debug_tch ) { |
|
28 | contains( CONFIG, debug_tch ) { | |
29 | DEFINES += DEBUG_TCH |
|
29 | DEFINES += DEBUG_TCH | |
30 | } |
|
30 | } | |
31 |
DEFINES += |
|
31 | DEFINES += MSB_FIRST_TCH | |
32 |
|
32 | |||
33 | contains( CONFIG, vhdl_dev ) { |
|
33 | contains( CONFIG, vhdl_dev ) { | |
34 | DEFINES += VHDL_DEV |
|
34 | DEFINES += VHDL_DEV |
@@ -193,8 +193,6 rtems_task prc0_task( rtems_task_argumen | |||||
193 | bp_packet packet_sbm_bp2; |
|
193 | bp_packet packet_sbm_bp2; | |
194 | ring_node *current_ring_node_to_send_asm_f0; |
|
194 | ring_node *current_ring_node_to_send_asm_f0; | |
195 |
|
195 | |||
196 | unsigned long long int localTime; |
|
|||
197 |
|
||||
198 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU |
|
196 | // init the ring of the averaged spectral matrices which will be transmitted to the DPU | |
199 | init_ring( ring_to_send_asm_f0, NB_RING_NODES_ASM_F0, (volatile int*) buffer_asm_f0, TOTAL_SIZE_SM ); |
|
197 | init_ring( ring_to_send_asm_f0, NB_RING_NODES_ASM_F0, (volatile int*) buffer_asm_f0, TOTAL_SIZE_SM ); | |
200 | current_ring_node_to_send_asm_f0 = ring_to_send_asm_f0; |
|
198 | current_ring_node_to_send_asm_f0 = ring_to_send_asm_f0; | |
@@ -261,8 +259,6 rtems_task prc0_task( rtems_task_argumen | |||||
261 |
|
259 | |||
262 | incomingMsg = (asm_msg*) incomingData; |
|
260 | incomingMsg = (asm_msg*) incomingData; | |
263 |
|
261 | |||
264 | localTime = getTimeAsUnsignedLongLongInt( ); |
|
|||
265 |
|
||||
266 | //**************** |
|
262 | //**************** | |
267 | //**************** |
|
263 | //**************** | |
268 | // BURST SBM1 SBM2 |
|
264 | // BURST SBM1 SBM2 | |
@@ -328,46 +324,6 rtems_task prc0_task( rtems_task_argumen | |||||
328 | BP_send( (char *) &packet_norm_bp2, queue_id, |
|
324 | BP_send( (char *) &packet_norm_bp2, queue_id, | |
329 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 + PACKET_LENGTH_DELTA, |
|
325 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 + PACKET_LENGTH_DELTA, | |
330 | SID_NORM_BP2_F0); |
|
326 | SID_NORM_BP2_F0); | |
331 |
|
||||
332 | // < TMP DATA> |
|
|||
333 | #define INDEX_COMPRESSED 1 |
|
|||
334 | unsigned int signif; |
|
|||
335 | float significand; |
|
|||
336 | unsigned int nbitexp = 6; |
|
|||
337 | unsigned int nbitsig = 16 - nbitexp; // number of bits for the significand |
|
|||
338 | unsigned int rangesig = (1 << nbitsig)-1; // == 2^nbitsig - 1 |
|
|||
339 | int expmax = 32; |
|
|||
340 | int expmin = expmax - ((int) (1 << nbitexp)) + 1; |
|
|||
341 | int exponent; |
|
|||
342 | float auto_a0; |
|
|||
343 | exponent = ( (int) ( (packet_norm_bp2.data[INDEX_COMPRESSED * NB_BYTES_PER_BP2] & 0xfc) >> 2) ) + expmin; // [1111 1100] |
|
|||
344 | printf("exponent = %x, computed with exp = %x, expmin = %d\n", |
|
|||
345 | exponent, |
|
|||
346 | (packet_norm_bp2.data[INDEX_COMPRESSED * NB_BYTES_PER_BP2] & 0xfc) >> 2, |
|
|||
347 | expmin); |
|
|||
348 | signif = ( (packet_norm_bp2.data[INDEX_COMPRESSED * NB_BYTES_PER_BP2] & 0x3) << 8 ) + packet_norm_bp2.data[INDEX_COMPRESSED * NB_BYTES_PER_BP2+1]; |
|
|||
349 | significand = ( ( (float) signif ) / ( (float) rangesig) + 1) / 2; |
|
|||
350 | auto_a0 = significand * pow(2,exponent); |
|
|||
351 | printf("(BP2) [%d] compressed = %f *** AUTO A0 = %x, %x, exponent = %x, significand = %f ===> %f\n", |
|
|||
352 | INDEX_COMPRESSED, |
|
|||
353 | compressed_sm_norm_f0[INDEX_COMPRESSED * NB_VALUES_PER_SM], |
|
|||
354 | packet_norm_bp2.data[ INDEX_COMPRESSED * NB_BYTES_PER_BP2], |
|
|||
355 | packet_norm_bp2.data[ INDEX_COMPRESSED * NB_BYTES_PER_BP2 + 1], |
|
|||
356 | exponent, significand, auto_a0 ); |
|
|||
357 | // printf("(BP2) 0 = %f, 1 = %f, 2 = %f, 3 = %f, 4 = %f, 5 = %f, 6 = %f, 7 = %f, 8 = %f, 9 = %f, 10 = %f,\n", |
|
|||
358 | // compressed_sm_norm_f0[0 * NB_VALUES_PER_SM], |
|
|||
359 | // compressed_sm_norm_f0[1 * NB_VALUES_PER_SM], |
|
|||
360 | // compressed_sm_norm_f0[2 * NB_VALUES_PER_SM], |
|
|||
361 | // compressed_sm_norm_f0[3 * NB_VALUES_PER_SM], |
|
|||
362 | // compressed_sm_norm_f0[4 * NB_VALUES_PER_SM], |
|
|||
363 | // compressed_sm_norm_f0[5 * NB_VALUES_PER_SM], |
|
|||
364 | // compressed_sm_norm_f0[6 * NB_VALUES_PER_SM], |
|
|||
365 | // compressed_sm_norm_f0[7 * NB_VALUES_PER_SM], |
|
|||
366 | // compressed_sm_norm_f0[8 * NB_VALUES_PER_SM], |
|
|||
367 | // compressed_sm_norm_f0[9 * NB_VALUES_PER_SM], |
|
|||
368 | // compressed_sm_norm_f0[10 * NB_VALUES_PER_SM]); |
|
|||
369 | // </TMP DATA> |
|
|||
370 |
|
||||
371 | } |
|
327 | } | |
372 | } |
|
328 | } | |
373 |
|
329 | |||
@@ -383,27 +339,11 rtems_task prc0_task( rtems_task_argumen | |||||
383 | current_ring_node_to_send_asm_f0->fineTime = incomingMsg->fineTimeNORM; |
|
339 | current_ring_node_to_send_asm_f0->fineTime = incomingMsg->fineTimeNORM; | |
384 | current_ring_node_to_send_asm_f0->sid = SID_NORM_ASM_F0; |
|
340 | current_ring_node_to_send_asm_f0->sid = SID_NORM_ASM_F0; | |
385 |
|
341 | |||
386 | // < TMP DATA> |
|
|||
387 | #define INDEX_TO_LOOK_AT 31 |
|
|||
388 | float b11; |
|
|||
389 | unsigned char *b11_charPtr; |
|
|||
390 | b11_charPtr = (unsigned char*) &b11; |
|
|||
391 | b11_charPtr[0] = ((unsigned char *) current_ring_node_to_send_asm_f0->buffer_address)[(INDEX_TO_LOOK_AT * NB_VALUES_PER_SM) * 2]; |
|
|||
392 | b11_charPtr[1] = ((unsigned char *) current_ring_node_to_send_asm_f0->buffer_address)[(INDEX_TO_LOOK_AT * NB_VALUES_PER_SM) * 2 +1]; |
|
|||
393 | b11_charPtr[2] = 0x00; |
|
|||
394 | b11_charPtr[3] = 0x00; |
|
|||
395 | printf("(ASM) initial = %f, reorganized and divided = %f, converted = %f\n", |
|
|||
396 | incomingMsg->norm->matrix[INDEX_TO_LOOK_AT], // 32 * 96 = 3072 Hz |
|
|||
397 | asm_f0_reorganized[ INDEX_TO_LOOK_AT * NB_VALUES_PER_SM ], |
|
|||
398 | b11); |
|
|||
399 | // </TMP DATA> |
|
|||
400 |
|
||||
401 | // 3) send the spectral matrix packets |
|
342 | // 3) send the spectral matrix packets | |
402 | status = rtems_message_queue_send( queue_id, ¤t_ring_node_to_send_asm_f0, sizeof( ring_node* ) ); |
|
343 | status = rtems_message_queue_send( queue_id, ¤t_ring_node_to_send_asm_f0, sizeof( ring_node* ) ); | |
403 | // change asm ring node |
|
344 | // change asm ring node | |
404 | current_ring_node_to_send_asm_f0 = current_ring_node_to_send_asm_f0->next; |
|
345 | current_ring_node_to_send_asm_f0 = current_ring_node_to_send_asm_f0->next; | |
405 | } |
|
346 | } | |
406 |
|
||||
407 | } |
|
347 | } | |
408 | } |
|
348 | } | |
409 |
|
349 | |||
@@ -449,50 +389,3 void init_k_coefficients_f0( void ) | |||||
449 | init_k_coefficients( k_coeff_intercalib_f0_norm, NB_BINS_COMPRESSED_SM_F0 ); |
|
389 | init_k_coefficients( k_coeff_intercalib_f0_norm, NB_BINS_COMPRESSED_SM_F0 ); | |
450 | init_k_coefficients( k_coeff_intercalib_f0_sbm, NB_BINS_COMPRESSED_SM_SBM_F0); |
|
390 | init_k_coefficients( k_coeff_intercalib_f0_sbm, NB_BINS_COMPRESSED_SM_SBM_F0); | |
451 | } |
|
391 | } | |
452 |
|
||||
453 | void test_TCH( void ) |
|
|||
454 | { |
|
|||
455 | #define NB_BINS_COMPRESSED_MATRIX_TCH 1 |
|
|||
456 |
|
||||
457 | unsigned char LFR_BP1_f0[NB_BINS_COMPRESSED_MATRIX_TCH*NB_BYTES_BP1]; |
|
|||
458 | unsigned char LFR_BP2_f0[NB_BINS_COMPRESSED_MATRIX_TCH*NB_BYTES_BP2]; |
|
|||
459 | float k_coefficients[NB_BINS_COMPRESSED_MATRIX_TCH * NB_K_COEFF_PER_BIN]; |
|
|||
460 |
|
||||
461 | float compressed_spectral_matrix_TCH[ NB_BINS_COMPRESSED_MATRIX_TCH * NB_VALUES_PER_SPECTRAL_MATRIX ] = { |
|
|||
462 | 1.02217712e+06, |
|
|||
463 | -8.58216250e+04, |
|
|||
464 | -3.22199043e+04, |
|
|||
465 | 1.01597820e+05, |
|
|||
466 | 8.10333875e+05, |
|
|||
467 | 1.19030141e+05, |
|
|||
468 | -8.69636688e+05, |
|
|||
469 | 5.01504031e+05, |
|
|||
470 | -1.01948547e+05, |
|
|||
471 | 1.35475020e+04, |
|
|||
472 | -3.67825469e+04, |
|
|||
473 | -1.10950273e+05, |
|
|||
474 | 2.10715000e+04, |
|
|||
475 | 4.49727383e+04, |
|
|||
476 | -4.37282031e+04, |
|
|||
477 | 3.83337695e+03, |
|
|||
478 | 1.05317175e+06, |
|
|||
479 | -4.04155312e+05, |
|
|||
480 | -1.32987891e+05, |
|
|||
481 | 1.49277250e+05, |
|
|||
482 | -4.39122625e+05, |
|
|||
483 | 9.46006250e+05, |
|
|||
484 | 2.64386625e+05, |
|
|||
485 | 3.71843125e+05, |
|
|||
486 | 3.39770000e+05 |
|
|||
487 | }; |
|
|||
488 |
|
||||
489 | init_k_coefficients( k_coefficients, NB_BINS_COMPRESSED_MATRIX_TCH ); |
|
|||
490 |
|
||||
491 | printf("\n"); |
|
|||
492 |
|
||||
493 | BP1_set(compressed_spectral_matrix_TCH, k_coefficients, NB_BINS_COMPRESSED_MATRIX_TCH, LFR_BP1_f0); |
|
|||
494 |
|
||||
495 | printf("\n"); |
|
|||
496 |
|
||||
497 | BP2_set(compressed_spectral_matrix_TCH, NB_BINS_COMPRESSED_MATRIX_TCH, LFR_BP2_f0); |
|
|||
498 | } |
|
@@ -57,6 +57,7 void spectral_matrices_isr_f0( void ) | |||||
57 | { |
|
57 | { | |
58 | unsigned char status; |
|
58 | unsigned char status; | |
59 | rtems_status_code status_code; |
|
59 | rtems_status_code status_code; | |
|
60 | ring_node *full_ring_node; | |||
60 |
|
61 | |||
61 | status = spectral_matrix_regs->status & 0x03; // [0011] get the status_ready_matrix_f0_x bits |
|
62 | status = spectral_matrix_regs->status & 0x03; // [0011] get the status_ready_matrix_f0_x bits | |
62 |
|
63 | |||
@@ -70,40 +71,42 void spectral_matrices_isr_f0( void ) | |||||
70 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_11 ); |
|
71 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_11 ); | |
71 | break; |
|
72 | break; | |
72 | case 1: |
|
73 | case 1: | |
73 |
ring_node |
|
74 | full_ring_node = current_ring_node_sm_f0->previous; | |
74 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; |
|
75 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; | |
75 | ring_node_for_averaging_sm_f0->coarseTime = spectral_matrix_regs->f0_0_coarse_time; |
|
|||
76 | ring_node_for_averaging_sm_f0->fineTime = spectral_matrix_regs->f0_0_fine_time; |
|
|||
77 | spectral_matrix_regs->f0_0_address = current_ring_node_sm_f0->buffer_address; |
|
76 | spectral_matrix_regs->f0_0_address = current_ring_node_sm_f0->buffer_address; | |
78 | spectral_matrix_regs->status = 0x01; // [0000 0001] |
|
|||
79 | // if there are enough ring nodes ready, wake up an AVFx task |
|
77 | // if there are enough ring nodes ready, wake up an AVFx task | |
80 | nb_sm_f0 = nb_sm_f0 + 1; |
|
78 | nb_sm_f0 = nb_sm_f0 + 1; | |
81 | if (nb_sm_f0 == NB_SM_BEFORE_AVF0) |
|
79 | if (nb_sm_f0 == NB_SM_BEFORE_AVF0) | |
82 | { |
|
80 | { | |
|
81 | ring_node_for_averaging_sm_f0 = full_ring_node; | |||
|
82 | ring_node_for_averaging_sm_f0->coarseTime = spectral_matrix_regs->f0_0_coarse_time; | |||
|
83 | ring_node_for_averaging_sm_f0->fineTime = spectral_matrix_regs->f0_0_fine_time; | |||
83 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
84 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |
84 | { |
|
85 | { | |
85 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
86 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |
86 | } |
|
87 | } | |
87 | nb_sm_f0 = 0; |
|
88 | nb_sm_f0 = 0; | |
88 | } |
|
89 | } | |
|
90 | spectral_matrix_regs->status = 0x01; // [0000 0001] | |||
89 | break; |
|
91 | break; | |
90 | case 2: |
|
92 | case 2: | |
91 |
ring_node |
|
93 | full_ring_node = current_ring_node_sm_f0->previous; | |
92 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; |
|
94 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; | |
93 | ring_node_for_averaging_sm_f0->coarseTime = spectral_matrix_regs->f0_1_coarse_time; |
|
95 | spectral_matrix_regs->f0_1_address = current_ring_node_sm_f0->buffer_address; | |
94 | ring_node_for_averaging_sm_f0->fineTime = spectral_matrix_regs->f0_1_fine_time; |
|
|||
95 | spectral_matrix_regs->f0_0_address = current_ring_node_sm_f0->buffer_address; |
|
|||
96 | spectral_matrix_regs->status = 0x02; // [0000 0010] |
|
|||
97 | // if there are enough ring nodes ready, wake up an AVFx task |
|
96 | // if there are enough ring nodes ready, wake up an AVFx task | |
98 | nb_sm_f0 = nb_sm_f0 + 1; |
|
97 | nb_sm_f0 = nb_sm_f0 + 1; | |
99 | if (nb_sm_f0 == NB_SM_BEFORE_AVF0) |
|
98 | if (nb_sm_f0 == NB_SM_BEFORE_AVF0) | |
100 | { |
|
99 | { | |
|
100 | ring_node_for_averaging_sm_f0 = full_ring_node; | |||
|
101 | ring_node_for_averaging_sm_f0->coarseTime = spectral_matrix_regs->f0_1_coarse_time; | |||
|
102 | ring_node_for_averaging_sm_f0->fineTime = spectral_matrix_regs->f0_1_fine_time; | |||
101 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
103 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |
102 | { |
|
104 | { | |
103 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
105 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |
104 | } |
|
106 | } | |
105 | nb_sm_f0 = 0; |
|
107 | nb_sm_f0 = 0; | |
106 | } |
|
108 | } | |
|
109 | spectral_matrix_regs->status = 0x02; // [0000 0010] | |||
107 | break; |
|
110 | break; | |
108 | } |
|
111 | } | |
109 | } |
|
112 | } | |
@@ -112,6 +115,7 void spectral_matrices_isr_f1( void ) | |||||
112 | { |
|
115 | { | |
113 | rtems_status_code status_code; |
|
116 | rtems_status_code status_code; | |
114 | unsigned char status; |
|
117 | unsigned char status; | |
|
118 | ring_node *full_ring_node; | |||
115 |
|
119 | |||
116 | status = (spectral_matrix_regs->status & 0x0c) >> 2; // [1100] get the status_ready_matrix_f0_x bits |
|
120 | status = (spectral_matrix_regs->status & 0x0c) >> 2; // [1100] get the status_ready_matrix_f0_x bits | |
117 |
|
121 | |||
@@ -125,40 +129,42 void spectral_matrices_isr_f1( void ) | |||||
125 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_11 ); |
|
129 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_11 ); | |
126 | break; |
|
130 | break; | |
127 | case 1: |
|
131 | case 1: | |
128 |
ring_node |
|
132 | full_ring_node = current_ring_node_sm_f1->previous; | |
129 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; |
|
133 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; | |
130 | ring_node_for_averaging_sm_f1->coarseTime = spectral_matrix_regs->f1_0_coarse_time; |
|
|||
131 | ring_node_for_averaging_sm_f1->fineTime = spectral_matrix_regs->f1_0_fine_time; |
|
|||
132 | spectral_matrix_regs->f1_0_address = current_ring_node_sm_f1->buffer_address; |
|
134 | spectral_matrix_regs->f1_0_address = current_ring_node_sm_f1->buffer_address; | |
133 | spectral_matrix_regs->status = 0x04; // [0000 0100] |
|
|||
134 | // if there are enough ring nodes ready, wake up an AVFx task |
|
135 | // if there are enough ring nodes ready, wake up an AVFx task | |
135 | nb_sm_f1 = nb_sm_f1 + 1; |
|
136 | nb_sm_f1 = nb_sm_f1 + 1; | |
136 | if (nb_sm_f1 == NB_SM_BEFORE_AVF1) |
|
137 | if (nb_sm_f1 == NB_SM_BEFORE_AVF1) | |
137 | { |
|
138 | { | |
|
139 | ring_node_for_averaging_sm_f1 = full_ring_node; | |||
|
140 | ring_node_for_averaging_sm_f1->coarseTime = spectral_matrix_regs->f1_0_coarse_time; | |||
|
141 | ring_node_for_averaging_sm_f1->fineTime = spectral_matrix_regs->f1_0_fine_time; | |||
138 | if (rtems_event_send( Task_id[TASKID_AVF1], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
142 | if (rtems_event_send( Task_id[TASKID_AVF1], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |
139 | { |
|
143 | { | |
140 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
144 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |
141 | } |
|
145 | } | |
142 | nb_sm_f1 = 0; |
|
146 | nb_sm_f1 = 0; | |
143 | } |
|
147 | } | |
|
148 | spectral_matrix_regs->status = 0x04; // [0000 0100] | |||
144 | break; |
|
149 | break; | |
145 | case 2: |
|
150 | case 2: | |
146 |
ring_node |
|
151 | full_ring_node = current_ring_node_sm_f1->previous; | |
147 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; |
|
152 | current_ring_node_sm_f1 = current_ring_node_sm_f1->next; | |
148 | ring_node_for_averaging_sm_f1->coarseTime = spectral_matrix_regs->f1_1_coarse_time; |
|
|||
149 | ring_node_for_averaging_sm_f1->fineTime = spectral_matrix_regs->f1_1_fine_time; |
|
|||
150 | spectral_matrix_regs->f1_1_address = current_ring_node_sm_f1->buffer_address; |
|
153 | spectral_matrix_regs->f1_1_address = current_ring_node_sm_f1->buffer_address; | |
151 | spectral_matrix_regs->status = 0x08; // [1000 0000] |
|
|||
152 | // if there are enough ring nodes ready, wake up an AVFx task |
|
154 | // if there are enough ring nodes ready, wake up an AVFx task | |
153 | nb_sm_f1 = nb_sm_f1 + 1; |
|
155 | nb_sm_f1 = nb_sm_f1 + 1; | |
154 | if (nb_sm_f1 == NB_SM_BEFORE_AVF1) |
|
156 | if (nb_sm_f1 == NB_SM_BEFORE_AVF1) | |
155 | { |
|
157 | { | |
|
158 | ring_node_for_averaging_sm_f1 = full_ring_node; | |||
|
159 | ring_node_for_averaging_sm_f1->coarseTime = spectral_matrix_regs->f1_1_coarse_time; | |||
|
160 | ring_node_for_averaging_sm_f1->fineTime = spectral_matrix_regs->f1_1_fine_time; | |||
156 | if (rtems_event_send( Task_id[TASKID_AVF1], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
161 | if (rtems_event_send( Task_id[TASKID_AVF1], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |
157 | { |
|
162 | { | |
158 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
163 | status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |
159 | } |
|
164 | } | |
160 | nb_sm_f1 = 0; |
|
165 | nb_sm_f1 = 0; | |
161 | } |
|
166 | } | |
|
167 | spectral_matrix_regs->status = 0x08; // [1000 0000] | |||
162 | break; |
|
168 | break; | |
163 | } |
|
169 | } | |
164 | } |
|
170 | } | |
@@ -329,9 +335,9 void SM_reset_current_ring_nodes( void ) | |||||
329 | current_ring_node_sm_f1 = sm_ring_f1[0].next; |
|
335 | current_ring_node_sm_f1 = sm_ring_f1[0].next; | |
330 | current_ring_node_sm_f2 = sm_ring_f2[0].next; |
|
336 | current_ring_node_sm_f2 = sm_ring_f2[0].next; | |
331 |
|
337 | |||
332 |
ring_node_for_averaging_sm_f0 = |
|
338 | ring_node_for_averaging_sm_f0 = NULL; | |
333 |
ring_node_for_averaging_sm_f1 = |
|
339 | ring_node_for_averaging_sm_f1 = NULL; | |
334 |
ring_node_for_averaging_sm_f2 = |
|
340 | ring_node_for_averaging_sm_f2 = NULL; | |
335 | } |
|
341 | } | |
336 |
|
342 | |||
337 | //***************** |
|
343 | //***************** |
General Comments 0
You need to be logged in to leave comments.
Login now