##// END OF EJS Templates
Bug 703 hk_lfr_le and hk_lfr_me handling corrected
paul -
r317:0d12752c6dcd R3_plus draft
parent child
Show More
@@ -20,6 +20,28 enum lfr_reset_cause_t{
20 20 UNEXP_RESET
21 21 };
22 22
23 typedef struct{
24 unsigned char dpu_spw_parity;
25 unsigned char dpu_spw_disconnect;
26 unsigned char dpu_spw_escape;
27 unsigned char dpu_spw_credit;
28 unsigned char dpu_spw_write_sync;
29 unsigned char timecode_erroneous;
30 unsigned char timecode_missing;
31 unsigned char timecode_invalid;
32 unsigned char time_timecode_it;
33 unsigned char time_not_synchro;
34 unsigned char time_timecode_ctr;
35 unsigned char ahb_correctable;
36 } hk_lfr_le_t;
37
38 typedef struct{
39 unsigned char dpu_spw_early_eop;
40 unsigned char dpu_spw_invalid_addr;
41 unsigned char dpu_spw_eep;
42 unsigned char dpu_spw_rx_too_big;
43 } hk_lfr_me_t;
44
23 45 extern gptimer_regs_t *gptimer_regs;
24 46 extern void ASR16_get_FPRF_IURF_ErrorCounters( unsigned int*, unsigned int* );
25 47 extern void CCR_getInstructionAndDataErrorCounters( unsigned int*, unsigned int* );
@@ -775,58 +775,143 void set_hk_lfr_reset_cause( enum lfr_re
775 775
776 776 }
777 777
778 void hk_lfr_le_me_he_update()
778 void increment_hk_counter( unsigned char newValue, unsigned char oldValue, unsigned int *counter )
779 779 {
780 unsigned int hk_lfr_le_cnt;
781 unsigned int hk_lfr_me_cnt;
782 unsigned int hk_lfr_he_cnt;
783 unsigned int current_hk_lfr_le_cnt;
784 unsigned int current_hk_lfr_me_cnt;
785 unsigned int current_hk_lfr_he_cnt;
780 int delta;
781
782 delta = 0;
786 783
787 hk_lfr_le_cnt = 0;
788 hk_lfr_me_cnt = 0;
789 hk_lfr_he_cnt = 0;
790 current_hk_lfr_le_cnt = ((unsigned int) housekeeping_packet.hk_lfr_le_cnt[0]) * 256 + housekeeping_packet.hk_lfr_le_cnt[1];
791 current_hk_lfr_me_cnt = ((unsigned int) housekeeping_packet.hk_lfr_me_cnt[0]) * 256 + housekeeping_packet.hk_lfr_me_cnt[1];
792 current_hk_lfr_he_cnt = ((unsigned int) housekeeping_packet.hk_lfr_he_cnt[0]) * 256 + housekeeping_packet.hk_lfr_he_cnt[1];
784 if (newValue >= oldValue)
785 {
786 delta = newValue - oldValue;
787 }
788 else
789 {
790 delta = 255 - oldValue + newValue;
791 }
792
793 *counter = *counter + delta;
794 }
793 795
794 //update the low severity error counter
795 hk_lfr_le_cnt =
796 current_hk_lfr_le_cnt
797 + housekeeping_packet.hk_lfr_dpu_spw_parity
798 + housekeeping_packet.hk_lfr_dpu_spw_disconnect
799 + housekeeping_packet.hk_lfr_dpu_spw_escape
800 + housekeeping_packet.hk_lfr_dpu_spw_credit
801 + housekeeping_packet.hk_lfr_dpu_spw_write_sync
802 + housekeeping_packet.hk_lfr_timecode_erroneous
803 + housekeeping_packet.hk_lfr_timecode_missing
804 + housekeeping_packet.hk_lfr_timecode_invalid
805 + housekeeping_packet.hk_lfr_time_timecode_it
806 + housekeeping_packet.hk_lfr_time_not_synchro
807 + housekeeping_packet.hk_lfr_time_timecode_ctr
808 + housekeeping_packet.hk_lfr_ahb_correctable;
796 void hk_lfr_le_update( void )
797 {
798 static hk_lfr_le_t old_hk_lfr_le = {0};
799 hk_lfr_le_t new_hk_lfr_le;
800 unsigned int counter;
801
802 counter = ((unsigned int) housekeeping_packet.hk_lfr_le_cnt[0]) * 256 + housekeeping_packet.hk_lfr_le_cnt[1];
803
804 // DPU
805 new_hk_lfr_le.dpu_spw_parity = housekeeping_packet.hk_lfr_dpu_spw_parity;
806 new_hk_lfr_le.dpu_spw_disconnect= housekeeping_packet.hk_lfr_dpu_spw_disconnect;
807 new_hk_lfr_le.dpu_spw_escape = housekeeping_packet.hk_lfr_dpu_spw_escape;
808 new_hk_lfr_le.dpu_spw_credit = housekeeping_packet.hk_lfr_dpu_spw_credit;
809 new_hk_lfr_le.dpu_spw_write_sync= housekeeping_packet.hk_lfr_dpu_spw_write_sync;
810 // TIMECODE
811 new_hk_lfr_le.timecode_erroneous= housekeeping_packet.hk_lfr_timecode_erroneous;
812 new_hk_lfr_le.timecode_missing = housekeeping_packet.hk_lfr_timecode_missing;
813 new_hk_lfr_le.timecode_invalid = housekeeping_packet.hk_lfr_timecode_invalid;
814 // TIME
815 new_hk_lfr_le.time_timecode_it = housekeeping_packet.hk_lfr_time_timecode_it;
816 new_hk_lfr_le.time_not_synchro = housekeeping_packet.hk_lfr_time_not_synchro;
817 new_hk_lfr_le.time_timecode_ctr = housekeeping_packet.hk_lfr_time_timecode_ctr;
818 //AHB
819 new_hk_lfr_le.ahb_correctable = housekeeping_packet.hk_lfr_ahb_correctable;
809 820 // housekeeping_packet.hk_lfr_dpu_spw_rx_ahb => not handled by the grspw driver
810 821 // housekeeping_packet.hk_lfr_dpu_spw_tx_ahb => not handled by the grspw driver
811 822
823 // update the le counter
824 // DPU
825 increment_hk_counter( new_hk_lfr_le.dpu_spw_parity, old_hk_lfr_le.dpu_spw_parity, counter );
826 increment_hk_counter( new_hk_lfr_le.dpu_spw_disconnect,old_hk_lfr_le.dpu_spw_disconnect, counter );
827 increment_hk_counter( new_hk_lfr_le.dpu_spw_escape, old_hk_lfr_le.dpu_spw_escape, counter );
828 increment_hk_counter( new_hk_lfr_le.dpu_spw_credit, old_hk_lfr_le.dpu_spw_credit, counter );
829 increment_hk_counter( new_hk_lfr_le.dpu_spw_write_sync,old_hk_lfr_le.dpu_spw_write_sync, counter );
830 // TIMECODE
831 increment_hk_counter( new_hk_lfr_le.timecode_erroneous,old_hk_lfr_le.timecode_erroneous, counter );
832 increment_hk_counter( new_hk_lfr_le.timecode_missing, old_hk_lfr_le.timecode_missing, counter );
833 increment_hk_counter( new_hk_lfr_le.timecode_invalid, old_hk_lfr_le.timecode_invalid, counter );
834 // TIME
835 increment_hk_counter( new_hk_lfr_le.time_timecode_it, old_hk_lfr_le.time_timecode_it, counter );
836 increment_hk_counter( new_hk_lfr_le.time_not_synchro, old_hk_lfr_le.time_not_synchro, counter );
837 increment_hk_counter( new_hk_lfr_le.time_timecode_ctr, old_hk_lfr_le.time_timecode_ctr, counter );
838 // AHB
839 increment_hk_counter( new_hk_lfr_le.ahb_correctable, old_hk_lfr_le.ahb_correctable, counter );
840
841 // DPU
842 old_hk_lfr_le.dpu_spw_parity = new_hk_lfr_le.dpu_spw_parity;
843 old_hk_lfr_le.dpu_spw_disconnect= new_hk_lfr_le.dpu_spw_disconnect;
844 old_hk_lfr_le.dpu_spw_escape = new_hk_lfr_le.dpu_spw_escape;
845 old_hk_lfr_le.dpu_spw_credit = new_hk_lfr_le.dpu_spw_credit;
846 old_hk_lfr_le.dpu_spw_write_sync= new_hk_lfr_le.dpu_spw_write_sync;
847 // TIMECODE
848 old_hk_lfr_le.timecode_erroneous= new_hk_lfr_le.timecode_erroneous;
849 old_hk_lfr_le.timecode_missing = new_hk_lfr_le.timecode_missing;
850 old_hk_lfr_le.timecode_invalid = new_hk_lfr_le.timecode_invalid;
851 // TIME
852 old_hk_lfr_le.time_timecode_it = new_hk_lfr_le.time_timecode_it;
853 old_hk_lfr_le.time_not_synchro = new_hk_lfr_le.time_not_synchro;
854 old_hk_lfr_le.time_timecode_ctr = new_hk_lfr_le.time_timecode_ctr;
855 //AHB
856 old_hk_lfr_le.ahb_correctable = new_hk_lfr_le.ahb_correctable;
857 // housekeeping_packet.hk_lfr_dpu_spw_rx_ahb => not handled by the grspw driver
858 // housekeeping_packet.hk_lfr_dpu_spw_tx_ahb => not handled by the grspw driver
859
860 // update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
861 // LE
862 housekeeping_packet.hk_lfr_le_cnt[0] = (unsigned char) ((hk_lfr_le_cnt & 0xff00) >> 8);
863 housekeeping_packet.hk_lfr_le_cnt[1] = (unsigned char) (hk_lfr_le_cnt & 0x00ff);
864 }
865
866 void hk_lfr_me_update( void )
867 {
868 static hk_lfr_me_t old_hk_lfr_me = {0};
869 hk_lfr_me_t new_hk_lfr_me;
870 unsigned int counter;
871
872 counter = ((unsigned int) housekeeping_packet.hk_lfr_me_cnt[0]) * 256 + housekeeping_packet.hk_lfr_me_cnt[1];
873
874 // get the current values
875 new_hk_lfr_me.dpu_spw_early_eop = housekeeping_packet.hk_lfr_dpu_spw_early_eop;
876 new_hk_lfr_me.dpu_spw_invalid_addr = housekeeping_packet.hk_lfr_dpu_spw_invalid_addr;
877 new_hk_lfr_me.dpu_spw_eep = housekeeping_packet.hk_lfr_dpu_spw_eep;
878 new_hk_lfr_me.dpu_spw_rx_too_big = housekeeping_packet.hk_lfr_dpu_spw_rx_too_big;
879
880 // update the me counter
881 increment_hk_counter( new_hk_lfr_me.dpu_spw_early_eop, old_hk_lfr_me.dpu_spw_early_eop, counter );
882 increment_hk_counter( new_hk_lfr_me.dpu_spw_invalid_addr, old_hk_lfr_me.dpu_spw_invalid_addr, counter );
883 increment_hk_counter( new_hk_lfr_me.dpu_spw_eep, old_hk_lfr_me.dpu_spw_eep, counter );
884 increment_hk_counter( new_hk_lfr_me.dpu_spw_rx_too_big, old_hk_lfr_me.dpu_spw_rx_too_big, counter );
885
886 // store the counters for the next time
887 old_hk_lfr_me.dpu_spw_early_eop = new_hk_lfr_me.dpu_spw_early_eop;
888 old_hk_lfr_me.dpu_spw_invalid_addr = new_hk_lfr_me.dpu_spw_invalid_addr;
889 old_hk_lfr_me.dpu_spw_eep = new_hk_lfr_me.dpu_spw_eep;
890 old_hk_lfr_me.dpu_spw_rx_too_big = new_hk_lfr_me.dpu_spw_rx_too_big;
891
892 // update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
893 // ME
894 housekeeping_packet.hk_lfr_me_cnt[0] = (unsigned char) ((hk_lfr_me_cnt & 0xff00) >> 8);
895 housekeeping_packet.hk_lfr_me_cnt[1] = (unsigned char) (hk_lfr_me_cnt & 0x00ff);
896 }
897
898 void hk_lfr_le_me_he_update()
899 {
900
901 unsigned int hk_lfr_he_cnt;
902
903 hk_lfr_he_cnt = ((unsigned int) housekeeping_packet.hk_lfr_he_cnt[0]) * 256 + housekeeping_packet.hk_lfr_he_cnt[1];
904
905 //update the low severity error counter
906 hk_lfr_le_update( );
907
812 908 //update the medium severity error counter
813 hk_lfr_me_cnt =
814 current_hk_lfr_me_cnt
815 + housekeeping_packet.hk_lfr_dpu_spw_early_eop
816 + housekeeping_packet.hk_lfr_dpu_spw_invalid_addr
817 + housekeeping_packet.hk_lfr_dpu_spw_eep
818 + housekeeping_packet.hk_lfr_dpu_spw_rx_too_big;
909 hk_lfr_me_update();
819 910
820 911 //update the high severity error counter
821 912 hk_lfr_he_cnt = 0;
822 913
823 914 // update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
824 // LE
825 housekeeping_packet.hk_lfr_le_cnt[0] = (unsigned char) ((hk_lfr_le_cnt & 0xff00) >> 8);
826 housekeeping_packet.hk_lfr_le_cnt[1] = (unsigned char) (hk_lfr_le_cnt & 0x00ff);
827 // ME
828 housekeeping_packet.hk_lfr_me_cnt[0] = (unsigned char) ((hk_lfr_me_cnt & 0xff00) >> 8);
829 housekeeping_packet.hk_lfr_me_cnt[1] = (unsigned char) (hk_lfr_me_cnt & 0x00ff);
830 915 // HE
831 916 housekeeping_packet.hk_lfr_he_cnt[0] = (unsigned char) ((hk_lfr_he_cnt & 0xff00) >> 8);
832 917 housekeeping_packet.hk_lfr_he_cnt[1] = (unsigned char) (hk_lfr_he_cnt & 0x00ff);
@@ -159,7 +159,7 rtems_task recv_task( rtems_task_argumen
159 159 }
160 160 else {
161 161 estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
162 PRINTF1("incoming TC with Length (byte): %d\n", len - 3);
162 //PRINTF1("incoming TC with Length (byte): %d\n", len - 3);
163 163 currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> 8);
164 164 currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength );
165 165 // CHECK THE TC
@@ -49,8 +49,8 unsigned char lfr_rtems_cpu_usage_report
49 49 for ( i=1 ; i <= information->maximum ; i++ ) {
50 50 the_thread = (Thread_Control *)information->local_table[ i ];
51 51
52 if ( the_thread != NULL )
53 total_units += the_thread->cpu_time_used;
52 if ( the_thread != NULL ) {
53 total_units += the_thread->cpu_time_used; }
54 54 }
55 55 }
56 56 }
@@ -665,8 +665,14 void ASM_compress_reorganize_and_divide_
665 665 ( compressed_spec_mat[ offsetCompressed ]
666 666 + averaged_spec_mat[ offsetASM + k ] * fBinMask );
667 667 }
668 compressed_spec_mat[ offsetCompressed ] =
669 (divider != 0.) ? compressed_spec_mat[ offsetCompressed ] / (divider * nbBinsToAverage) : 0.0;
668 if (divider != 0)
669 {
670 compressed_spec_mat[ offsetCompressed ] = compressed_spec_mat[ offsetCompressed ] / (divider * nbBinsToAverage);
671 }
672 else
673 {
674 compressed_spec_mat[ offsetCompressed ] = 0.0;
675 }
670 676 }
671 677 }
672 678
General Comments 0
You need to be logged in to leave comments. Login now