##// END OF EJS Templates
2.0.2.1
paul -
r185:193b5419a0cb VHDL_0_1_28
parent child
Show More
@@ -1,2 +1,2
1 a586fe639ac179e95bdc150ebdbab0312f31dc30 LFR_basic-parameters
1 a586fe639ac179e95bdc150ebdbab0312f31dc30 LFR_basic-parameters
2 b984c315bf99562bdfbbd6bda8de296d2e692adc header/lfr_common_headers
2 6d02d4b02291d2b25c387fa74037dc7929cd92b5 header/lfr_common_headers
@@ -34,8 +34,8 void increment_seq_counter(unsigned shor
34 void getTime( unsigned char *time);
34 void getTime( unsigned char *time);
35 unsigned long long int getTimeAsUnsignedLongLongInt( );
35 unsigned long long int getTimeAsUnsignedLongLongInt( );
36 void send_dumb_hk( void );
36 void send_dumb_hk( void );
37 void get_temperatures( unsigned char *temperatures );
37 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
38 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
38 void get_temperatures( unsigned char *temperatures );
39 void get_cpu_load( unsigned char *resource_statistics );
39 void get_cpu_load( unsigned char *resource_statistics );
40
40
41 extern int sched_yield( void );
41 extern int sched_yield( void );
@@ -141,7 +141,8 static inline void SM_average(float *ave
141 asm_msg *msgForMATR );
141 asm_msg *msgForMATR );
142 static inline void SM_average_debug( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
142 static inline void SM_average_debug(float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
143 ring_node *ring_node_tab[],
143 ring_node *ring_node_tab[],
144 unsigned int nbAverageNORM, unsigned int nbAverageSBM );
144 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
145 asm_msg *msgForMATR );
145
146
146 void ASM_patch( float *inputASM, float *outputASM );
147 void ASM_patch( float *inputASM, float *outputASM );
147 void extractReImVectors(float *inputASM, float *outputASM, unsigned int asmComponent );
148 void extractReImVectors(float *inputASM, float *outputASM, unsigned int asmComponent );
@@ -202,7 +203,8 void SM_average( float *averaged_spec_ma
202
203
203 void SM_average_debug( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
204 void SM_average_debug( float *averaged_spec_mat_NORM, float *averaged_spec_mat_SBM,
204 ring_node *ring_node_tab[],
205 ring_node *ring_node_tab[],
205 unsigned int nbAverageNORM, unsigned int nbAverageSBM )
206 unsigned int nbAverageNORM, unsigned int nbAverageSBM,
207 asm_msg *msgForMATR )
206 {
208 {
207 float sum;
209 float sum;
208 unsigned int i;
210 unsigned int i;
@@ -210,26 +212,12 void SM_average_debug( float *averaged_s
210 for(i=0; i<TOTAL_SIZE_SM; i++)
212 for(i=0; i<TOTAL_SIZE_SM; i++)
211 {
213 {
212 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ];
214 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ];
213
214 if ( (nbAverageNORM == 0) && (nbAverageSBM == 0) )
215 {
216 averaged_spec_mat_NORM[ i ] = sum;
217 averaged_spec_mat_SBM[ i ] = sum;
218 }
219 else if ( (nbAverageNORM != 0) && (nbAverageSBM != 0) )
220 {
221 averaged_spec_mat_NORM[ i ] = sum;
215 averaged_spec_mat_NORM[ i ] = sum;
222 averaged_spec_mat_SBM[ i ] = sum;
216 averaged_spec_mat_SBM[ i ] = sum;
223 }
217 msgForMATR->coarseTimeNORM = ring_node_tab[0]->coarseTime;
224 else if ( (nbAverageNORM != 0) && (nbAverageSBM == 0) )
218 msgForMATR->fineTimeNORM = ring_node_tab[0]->fineTime;
225 {
219 msgForMATR->coarseTimeSBM = ring_node_tab[0]->coarseTime;
226 averaged_spec_mat_NORM[ i ] = sum;
220 msgForMATR->fineTimeSBM = ring_node_tab[0]->fineTime;
227 averaged_spec_mat_SBM[ i ] = sum;
228 }
229 else
230 {
231 PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNORM, nbAverageSBM)
232 }
233 }
221 }
234 }
222 }
235
223
@@ -225,8 +225,8 rtems_task hous_task(rtems_task_argument
225
225
226 spacewire_update_statistics();
226 spacewire_update_statistics();
227
227
228 get_temperatures( housekeeping_packet.hk_lfr_temp_scm );
228 get_v_e1_e2_f3( housekeeping_packet.hk_lfr_sc_v_f3 );
229 get_v_e1_e2_f3( housekeeping_packet.hk_lfr_sc_v_f3 );
229 get_temperatures( housekeeping_packet.hk_lfr_temp_scm);
230 get_cpu_load( (unsigned char *) &housekeeping_packet.hk_lfr_cpu_load );
230 get_cpu_load( (unsigned char *) &housekeeping_packet.hk_lfr_cpu_load );
231
231
232 // SEND PACKET
232 // SEND PACKET
@@ -442,6 +442,24 void send_dumb_hk( void )
442 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
442 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
443 }
443 }
444
444
445 void get_temperatures( unsigned char *temperatures )
446 {
447 unsigned char* temp_scm_ptr;
448 unsigned char* temp_pcb_ptr;
449 unsigned char* temp_fpga_ptr;
450
451 temp_scm_ptr = (unsigned char *) &time_management_regs->temp_scm;
452 temp_pcb_ptr = (unsigned char *) &time_management_regs->temp_pcb;
453 temp_fpga_ptr = (unsigned char *) &time_management_regs->temp_fpga;
454
455 temperatures[0] = temp_scm_ptr[2];
456 temperatures[1] = temp_scm_ptr[3];
457 temperatures[2] = temp_pcb_ptr[2];
458 temperatures[3] = temp_pcb_ptr[3];
459 temperatures[4] = temp_fpga_ptr[2];
460 temperatures[5] = temp_fpga_ptr[3];
461 }
462
445 void get_v_e1_e2_f3( unsigned char *spacecraft_potential )
463 void get_v_e1_e2_f3( unsigned char *spacecraft_potential )
446 {
464 {
447 unsigned char* v_ptr;
465 unsigned char* v_ptr;
@@ -460,24 +478,6 void get_v_e1_e2_f3( unsigned char *spac
460 spacecraft_potential[5] = e2_ptr[3];
478 spacecraft_potential[5] = e2_ptr[3];
461 }
479 }
462
480
463 void get_temperatures( unsigned char *temperatures )
464 {
465 unsigned char* temp_scm_ptr;
466 unsigned char* temp_pcb_ptr;
467 unsigned char* temp_fpga_ptr;
468
469 temp_scm_ptr = (unsigned char *) &time_management_regs->temp_scm;
470 temp_pcb_ptr = (unsigned char *) &time_management_regs->temp_pcb;
471 temp_fpga_ptr = (unsigned char *) &time_management_regs->temp_fpga;
472
473 temperatures[0] = temp_scm_ptr[2];
474 temperatures[1] = temp_scm_ptr[3];
475 temperatures[2] = temp_pcb_ptr[2];
476 temperatures[3] = temp_pcb_ptr[3];
477 temperatures[4] = temp_fpga_ptr[2];
478 temperatures[5] = temp_fpga_ptr[3];
479 }
480
481 void get_cpu_load( unsigned char *resource_statistics )
481 void get_cpu_load( unsigned char *resource_statistics )
482 {
482 {
483 unsigned char cpu_load;
483 unsigned char cpu_load;
@@ -988,9 +988,6 int spw_send_waveform_CWF3_light( ring_n
988 header->blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8);
988 header->blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8);
989 header->blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 );
989 header->blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 );
990
990
991 printf("spw_send_waveform_CWF3_light => [0] = %x, [1] = %x, [2] = %x, [3] = %x, [4] = %x, [5] = %x\n",
992 dataPtr[0], dataPtr[1], dataPtr[2], dataPtr[3], dataPtr[4], dataPtr[5]);
993
994 //*********************
991 //*********************
995 // SEND CWF3_light DATA
992 // SEND CWF3_light DATA
996 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) // send waveform
993 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) // send waveform
@@ -212,9 +212,9 inline void waveforms_isr_burst( void )
212 case 1:
212 case 1:
213 ring_node_to_send_cwf_f2 = current_ring_node_f2->previous;
213 ring_node_to_send_cwf_f2 = current_ring_node_f2->previous;
214 ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2;
214 ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2;
215 current_ring_node_f2 = current_ring_node_f2->next;
216 ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_0_coarse_time;
215 ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_0_coarse_time;
217 ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_0_fine_time;
216 ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_0_fine_time;
217 current_ring_node_f2 = current_ring_node_f2->next;
218 waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->buffer_address;
218 waveform_picker_regs->addr_data_f2_0 = current_ring_node_f2->buffer_address;
219 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
219 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
220 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
220 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
@@ -224,9 +224,9 inline void waveforms_isr_burst( void )
224 case 2:
224 case 2:
225 ring_node_to_send_cwf_f2 = current_ring_node_f2->previous;
225 ring_node_to_send_cwf_f2 = current_ring_node_f2->previous;
226 ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2;
226 ring_node_to_send_cwf_f2->sid = SID_BURST_CWF_F2;
227 current_ring_node_f2 = current_ring_node_f2->next;
228 ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_1_coarse_time;
227 ring_node_to_send_cwf_f2->coarseTime = waveform_picker_regs->f2_1_coarse_time;
229 ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_1_fine_time;
228 ring_node_to_send_cwf_f2->fineTime = waveform_picker_regs->f2_1_fine_time;
229 current_ring_node_f2 = current_ring_node_f2->next;
230 waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address;
230 waveform_picker_regs->addr_data_f2_1 = current_ring_node_f2->buffer_address;
231 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
231 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
232 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
232 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 );
@@ -867,8 +867,6 int send_waveform_CWF3_light( ring_node
867 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
867 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
868 }
868 }
869
869
870 printf("send_waveform_CWF3_light => [0] = %x, [1] = %x, [2] = %x\n", dataPtr[0], dataPtr[1], dataPtr[2]);
871
872 // SEND PACKET
870 // SEND PACKET
873 status = rtems_message_queue_send( queue_id, &ring_node_cwf3_light, sizeof( ring_node* ) );
871 status = rtems_message_queue_send( queue_id, &ring_node_cwf3_light, sizeof( ring_node* ) );
874 if (status != RTEMS_SUCCESSFUL) {
872 if (status != RTEMS_SUCCESSFUL) {
@@ -981,7 +979,6 void build_snapshot_from_ring( ring_node
981
979
982 // (2) compute the central reference time
980 // (2) compute the central reference time
983 centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0;
981 centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0;
984 printf("centerTime_asLong = %llx\n", centerTime_asLong);
985
982
986 // (3) compute the acquisition time of the current snapshot
983 // (3) compute the acquisition time of the current snapshot
987 switch(frequencyChannel)
984 switch(frequencyChannel)
@@ -1089,8 +1086,8 void snapshot_resynchronization( unsigne
1089 deltaPrevious = ((double) deltaPreviousTick) / 65536. * 1000.;
1086 deltaPrevious = ((double) deltaPreviousTick) / 65536. * 1000.;
1090 deltaNext = ((double) deltaNextTick) / 65536. * 1000.;
1087 deltaNext = ((double) deltaNextTick) / 65536. * 1000.;
1091
1088
1092 printf("delta previous = %f ms, delta next = %f ms\n", deltaPrevious, deltaNext);
1089 PRINTF2("delta previous = %f ms, delta next = %f ms\n", deltaPrevious, deltaNext)
1093 printf("delta previous = %llu, delta next = %llu\n", deltaPreviousTick, deltaNextTick);
1090 PRINTF2("delta previous = %llu, delta next = %llu\n", deltaPreviousTick, deltaNextTick)
1094
1091
1095 // which tick is the closest
1092 // which tick is the closest
1096 if (deltaPreviousTick > deltaNextTick)
1093 if (deltaPreviousTick > deltaNextTick)
@@ -1225,6 +1222,9 void set_wfp_data_shaping( void )
1225 + ( (data_shaping & 0x04) ) // SP1
1222 + ( (data_shaping & 0x04) ) // SP1
1226 + ( (data_shaping & 0x02) << 2 ) // R0
1223 + ( (data_shaping & 0x02) << 2 ) // R0
1227 + ( (data_shaping & 0x01) << 4 ); // R1
1224 + ( (data_shaping & 0x01) << 4 ); // R1
1225
1226 // this is a temporary way to set R2, compatible with the release 2 of the flight software
1227 waveform_picker_regs->data_shaping = waveform_picker_regs->data_shaping + ( (0x1) << 5 ); // R2
1228 }
1228 }
1229
1229
1230 void set_wfp_burst_enable_register( unsigned char mode )
1230 void set_wfp_burst_enable_register( unsigned char mode )
General Comments 0
You need to be logged in to leave comments. Login now