comparison chipsetsw/layer1/cfile/l1_cmplx.c @ 66:0633e0378176

l1_cmplx.c: l1s_read_dedic_dl() reconstructed
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 28 Mar 2016 03:04:21 +0000
parents c075c55067eb
children 0375d76ce7be
comparison
equal deleted inserted replaced
65:549dc74942a0 66:0633e0378176
8073 /*--------------------------------------------------------*/ 8073 /*--------------------------------------------------------*/
8074 8074
8075 // Traces and debug. 8075 // Traces and debug.
8076 // ****************** 8076 // ******************
8077 #if (TRACE_TYPE!=0) && (TRACE_TYPE !=5) 8077 #if (TRACE_TYPE!=0) && (TRACE_TYPE !=5)
8078 trace_fct(CST_L1S_READ_DEDIC_DL, 1);//omaps00090550 8078 trace_fct(CST_L1S_READ_DEDIC_DL, -1);
8079 #endif 8079 #endif
8080 8080
8081 #if (TRACE_TYPE!=0) 8081 #if (TRACE_TYPE!=0)
8082 // Check task identifier... 8082 // Check task identifier...
8083 if((UWORD32)(l1s_dsp_com.dsp_db_r_ptr->d_task_d & 0xffff) != (UWORD32)DSP_TASK_CODE[task]) 8083 if((UWORD32)(l1s_dsp_com.dsp_db_r_ptr->d_task_d & 0xffff) != (UWORD32)DSP_TASK_CODE[task])
8148 // Read control results and feed control algorithms. 8148 // Read control results and feed control algorithms.
8149 // ************************************************** 8149 // **************************************************
8150 8150
8151 // Read control information. 8151 // Read control information.
8152 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff; 8152 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff;
8153 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff); 8153 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff) >> 5;
8154 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff; 8154 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff;
8155 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff; 8155 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff;
8156 8156
8157 l1_check_pm_error(pm, task); 8157 l1_check_pm_error(pm, task);
8158 pm = pm >> 5;
8159 8158
8160 // Update AGC: Call DPAGC algorithm 8159 // Update AGC: Call DPAGC algorithm
8161 IL_for_rxlev = l1ctl_dpagc(0,beacon,(UWORD8)pm,radio_freq,IL_info_ptr); // dtx_on = 0 8160 IL_for_rxlev = l1ctl_dpagc(0,beacon,(UWORD8)pm,radio_freq,IL_info_ptr); // dtx_on = 0
8162 8161
8163 // Dedicated mode serving cell measurement reading. 8162 // Dedicated mode serving cell measurement reading.
8194 if(l1s.toa_var.toa_snr_mask == 0) 8193 if(l1s.toa_var.toa_snr_mask == 0)
8195 #else 8194 #else
8196 if(l1s.toa_snr_mask == 0) 8195 if(l1s.toa_snr_mask == 0)
8197 #endif 8196 #endif
8198 { 8197 {
8199 UWORD32 snr_temp; 8198 #if 1 /* FreeCalypso TCS211 reconstruction */
8200 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0; 8199 if (IL_for_rxlev < IL_FOR_RXLEV_SNR)
8201 #if (TOA_ALGO == 2) 8200 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr, toa, &l1s.toa_update, &l1s.toa_period_count);
8202 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa); 8201 else
8202 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, 0, toa, &l1s.toa_update, &l1s.toa_period_count);
8203 #else 8203 #else
8204 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count 8204 UWORD32 snr_temp;
8205 #if (FF_L1_FAST_DECODING ==1) 8205 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0;
8206 ,0 8206 #if (TOA_ALGO == 2)
8207 #endif 8207 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa);
8208 ); 8208 #else
8209 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count
8210 #if (FF_L1_FAST_DECODING ==1)
8211 ,0
8212 #endif
8213 );
8214 #endif
8209 #endif 8215 #endif
8210
8211 } 8216 }
8212 #endif 8217 #endif
8213 8218
8214 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) 8219 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4)
8215 RTTL1_FILL_DL_BURST(angle, snr, l1s.afc, task, pm, toa, IL_for_rxlev) 8220 RTTL1_FILL_DL_BURST(angle, snr, l1s.afc, task, pm, toa, IL_for_rxlev)
8294 // Read control results and feed control algorithms. 8299 // Read control results and feed control algorithms.
8295 // ************************************************** 8300 // **************************************************
8296 8301
8297 // Read control information. 8302 // Read control information.
8298 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff; 8303 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff;
8299 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff); 8304 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff) >> 5;
8300 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff; 8305 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff;
8301 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff; 8306 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff;
8302 8307
8303 l1_check_pm_error(pm, task); 8308 l1_check_pm_error(pm, task);
8304 pm = pm >> 5;
8305 8309
8306 #if TRACE_TYPE==3 8310 #if TRACE_TYPE==3
8307 stats_samples_tch(toa,pm,angle,snr); 8311 stats_samples_tch(toa,pm,angle,snr);
8308 #endif 8312 #endif
8309 #if (TRACE_TYPE==2 ) || (TRACE_TYPE==3) 8313 #if (TRACE_TYPE==2 ) || (TRACE_TYPE==3)
8444 if(l1s.toa_var.toa_snr_mask == 0) 8448 if(l1s.toa_var.toa_snr_mask == 0)
8445 #else 8449 #else
8446 if(l1s.toa_snr_mask == 0) 8450 if(l1s.toa_snr_mask == 0)
8447 #endif 8451 #endif
8448 { 8452 {
8449 UWORD32 snr_temp; 8453 #if 1 /* FreeCalypso TCS211 reconstruction */
8450 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0; 8454 if (IL_for_rxlev < IL_FOR_RXLEV_SNR)
8451 #if (TOA_ALGO == 2) 8455 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1_mode, snr, toa, &l1s.toa_update, &l1s.toa_period_count);
8452 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1_mode, snr_temp, toa); 8456 else
8457 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1_mode, 0, toa, &l1s.toa_update, &l1s.toa_period_count);
8453 #else 8458 #else
8454 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1_mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count 8459 UWORD32 snr_temp;
8455 #if (FF_L1_FAST_DECODING == 1) 8460 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0;
8456 ,0 8461 #if (TOA_ALGO == 2)
8457 #endif 8462 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1_mode, snr_temp, toa);
8458 ); 8463 #else
8464 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1_mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count
8465 #if (FF_L1_FAST_DECODING == 1)
8466 ,0
8467 #endif
8468 );
8469 #endif
8459 #endif 8470 #endif
8460
8461 } 8471 }
8462 #endif 8472 #endif
8463 } // if(((channel_mode == TCH_HS_MODE) && (subchannel == 0) && 8473 } // if(((channel_mode == TCH_HS_MODE) && (subchannel == 0) &&
8464 else 8474 else
8465 { 8475 {
8946 if(l1s.toa_var.toa_snr_mask == 0) 8956 if(l1s.toa_var.toa_snr_mask == 0)
8947 #else 8957 #else
8948 if(l1s.toa_snr_mask == 0) 8958 if(l1s.toa_snr_mask == 0)
8949 #endif 8959 #endif
8950 { 8960 {
8951 UWORD32 snr_temp; 8961 #if 1 /* FreeCalypso TCS211 reconstruction */
8952 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0; 8962 if (IL_for_rxlev < IL_FOR_RXLEV_SNR)
8953 #if (TOA_ALGO == 2) 8963 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr, toa, &l1s.toa_update, &l1s.toa_period_count);
8954 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa); 8964 else
8965 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, 0, toa, &l1s.toa_update, &l1s.toa_period_count);
8955 #else 8966 #else
8956 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count 8967 UWORD32 snr_temp;
8957 #if (FF_L1_FAST_DECODING == 1) 8968 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0;
8958 ,0 8969 #if (TOA_ALGO == 2)
8959 #endif 8970 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa);
8960 ); 8971 #else
8972 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count
8973 #if (FF_L1_FAST_DECODING == 1)
8974 ,0
8975 #endif
8976 );
8977 #endif
8961 #endif 8978 #endif
8962 } 8979 }
8963 #endif 8980 #endif
8964 } 8981 }
8965 else 8982 else
9053 // Read control results and feed control algorithms. 9070 // Read control results and feed control algorithms.
9054 // ************************************************** 9071 // **************************************************
9055 9072
9056 // Read control information. 9073 // Read control information.
9057 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff; 9074 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff;
9058 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff); 9075 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff) >> 5;
9059 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff; 9076 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff;
9060 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff; 9077 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff;
9061 9078
9062 l1_check_pm_error(pm, task); 9079 l1_check_pm_error(pm, task);
9063 pm = pm >> 5;
9064 9080
9065 #if TRACE_TYPE==3 9081 #if TRACE_TYPE==3
9066 stats_samples_tch(toa,pm,angle,snr); 9082 stats_samples_tch(toa,pm,angle,snr);
9067 #endif 9083 #endif
9068 9084
9181 if(l1s.toa_var.toa_snr_mask == 0) 9197 if(l1s.toa_var.toa_snr_mask == 0)
9182 #else 9198 #else
9183 if(l1s.toa_snr_mask == 0) 9199 if(l1s.toa_snr_mask == 0)
9184 #endif 9200 #endif
9185 { 9201 {
9186 UWORD32 snr_temp; 9202 #if 1 /* FreeCalypso TCS211 reconstruction */
9187 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0; 9203 if (IL_for_rxlev < IL_FOR_RXLEV_SNR)
9188 #if (TOA_ALGO == 2) 9204 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr, toa, &l1s.toa_update, &l1s.toa_period_count);
9189 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa); 9205 else
9206 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, 0, toa, &l1s.toa_update, &l1s.toa_period_count);
9190 #else 9207 #else
9191 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count 9208 UWORD32 snr_temp;
9192 #if (FF_L1_FAST_DECODING == 1) 9209 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0;
9193 ,0 9210 #if (TOA_ALGO == 2)
9194 #endif 9211 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa);
9195 ); 9212 #else
9213 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count
9214 #if (FF_L1_FAST_DECODING == 1)
9215 ,0
9216 #endif
9217 );
9218 #endif
9196 #endif 9219 #endif
9197 } 9220 }
9198 #endif 9221 #endif
9199 } 9222 }
9200 else 9223 else
9649 if(l1s.toa_var.toa_snr_mask == 0) 9672 if(l1s.toa_var.toa_snr_mask == 0)
9650 #else 9673 #else
9651 if(l1s.toa_snr_mask == 0) 9674 if(l1s.toa_snr_mask == 0)
9652 #endif 9675 #endif
9653 { 9676 {
9654 UWORD32 snr_temp; 9677 #if 1 /* FreeCalypso TCS211 reconstruction */
9655 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0; 9678 if (IL_for_rxlev < IL_FOR_RXLEV_SNR)
9656 #if (TOA_ALGO == 2) 9679 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr, toa, &l1s.toa_update, &l1s.toa_period_count);
9657 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa); 9680 else
9681 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, 0, toa, &l1s.toa_update, &l1s.toa_period_count);
9658 #else 9682 #else
9659 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count 9683 UWORD32 snr_temp;
9660 #if (FF_L1_FAST_DECODING == 1) 9684 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0;
9661 ,0 9685 #if (TOA_ALGO == 2)
9662 #endif 9686 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa);
9663 ); 9687 #else
9688 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count
9689 #if (FF_L1_FAST_DECODING == 1)
9690 ,0
9691 #endif
9692 );
9693 #endif
9664 #endif 9694 #endif
9665 } 9695 }
9666 #endif 9696 #endif
9667 } 9697 }
9668 else 9698 else
9725 // Read control results and feed control algorithms. 9755 // Read control results and feed control algorithms.
9726 // ************************************************** 9756 // **************************************************
9727 9757
9728 // Read control information. 9758 // Read control information.
9729 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff; 9759 toa = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_TOA] & 0xffff;
9730 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff); 9760 pm = (l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_PM] & 0xffff) >> 5;
9731 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff; 9761 angle = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_ANGLE] & 0xffff;
9732 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff; 9762 snr = l1s_dsp_com.dsp_db_r_ptr->a_serv_demod[D_SNR] & 0xffff;
9733 9763
9734 #if TESTMODE 9764 #if TESTMODE
9735 if (l1_config.TestMode && l1_config.tmode.rf_params.down_up == TMODE_UPLINK) 9765 if (l1_config.TestMode && l1_config.tmode.rf_params.down_up == TMODE_UPLINK)
9752 if (l1_config.TestMode && l1_config.tmode.rf_params.down_up & TMODE_DOWNLINK) 9782 if (l1_config.TestMode && l1_config.tmode.rf_params.down_up & TMODE_DOWNLINK)
9753 #endif 9783 #endif
9754 { 9784 {
9755 l1_check_pm_error(pm, task); 9785 l1_check_pm_error(pm, task);
9756 } 9786 }
9757 pm = pm >> 5;
9758 9787
9759 #if TRACE_TYPE==3 9788 #if TRACE_TYPE==3
9760 stats_samples_tch_sacch(toa,pm,angle,snr); 9789 stats_samples_tch_sacch(toa,pm,angle,snr);
9761 #endif 9790 #endif
9762 9791
9796 if(l1s.toa_var.toa_snr_mask == 0) 9825 if(l1s.toa_var.toa_snr_mask == 0)
9797 #else 9826 #else
9798 if(l1s.toa_snr_mask == 0) 9827 if(l1s.toa_snr_mask == 0)
9799 #endif 9828 #endif
9800 { 9829 {
9801 UWORD32 snr_temp; 9830 #if 1 /* FreeCalypso TCS211 reconstruction */
9802 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0; 9831 if (IL_for_rxlev < IL_FOR_RXLEV_SNR)
9803 #if (TOA_ALGO == 2) 9832 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr, toa, &l1s.toa_update, &l1s.toa_period_count);
9804 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa); 9833 else
9834 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, 0, toa, &l1s.toa_update, &l1s.toa_period_count);
9805 #else 9835 #else
9806 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count 9836 UWORD32 snr_temp;
9807 #if (FF_L1_FAST_DECODING == 1) 9837 snr_temp = (IL_for_rxlev < IL_FOR_RXLEV_SNR)? snr: 0;
9808 ,0 9838 #if (TOA_ALGO == 2)
9809 #endif 9839 l1s.toa_var.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa);
9810 ); 9840 #else
9841 l1s.toa_shift = l1ctl_toa(TOA_RUN, l1a_l1s_com.mode, snr_temp, toa, &l1s.toa_update, &l1s.toa_period_count
9842 #if (FF_L1_FAST_DECODING == 1)
9843 ,0
9844 #endif
9845 );
9846 #endif
9811 #endif 9847 #endif
9812
9813 } 9848 }
9814 #endif 9849 #endif
9815 9850
9816 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4) 9851 #if (TRACE_TYPE == 1) || (TRACE_TYPE == 4)
9817 RTTL1_FILL_DL_BURST(angle, snr, l1s.afc, task, pm, toa, IL_for_rxlev) 9852 RTTL1_FILL_DL_BURST(angle, snr, l1s.afc, task, pm, toa, IL_for_rxlev)