Commit d2e8a669 authored by Raymond Knopp's avatar Raymond Knopp

improvements for SL initial synchronization

parent 2b970281
...@@ -414,18 +414,23 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -414,18 +414,23 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
} //if (Ns&1 && interpolate==1) } //if (Ns&1 && interpolate==1)
else if (interpolate == 0 && l == pilot_pos1) else if (interpolate == 0 && l == pilot_pos1)
for (k=0;k<frame_parms->symbols_per_tti>>1;k++) { for (k=0;k<frame_parms->symbols_per_tti>>1;k++) {
if (k==pilot_pos1) k++;
memcpy((void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], memcpy((void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
(void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos1], (void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos1],
frame_parms->N_RB_UL*12*sizeof(int)); frame_parms->N_RB_UL*12*sizeof(int));
if (k==pilot_pos1) k++;
} }
else if (interpolate == 0 && l == pilot_pos2) else if (interpolate == 0 && l == pilot_pos2) {
for (k=0;k<frame_parms->symbols_per_tti>>1;k++) { for (k=0;k<frame_parms->symbols_per_tti>>1;k++) {
if (k==pilot_pos1) k++; if (k==pilot_pos2) k++;
memcpy((void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*(k+(frame_parms->symbols_per_tti>>1))], memcpy((void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*(k+(frame_parms->symbols_per_tti>>1))],
(void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos2], (void*)&ul_ch_estimates[aa][frame_parms->N_RB_UL*12*pilot_pos2],
frame_parms->N_RB_UL*12*sizeof(int)); frame_parms->N_RB_UL*12*sizeof(int));
} }
delta_phase = lte_ul_freq_offset_estimation(frame_parms,
ul_ch_estimates[aa],
N_rb_alloc);
LOG_I(PHY,"delta_phase = %d\n",delta_phase);
}
} //for(aa=... } //for(aa=...
return(0); return(0);
} }
...@@ -605,18 +610,19 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -605,18 +610,19 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1); mmtmpD3 = _mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
R[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3); R[2] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
R[0] = _mm_add_epi16(_mm_srai_epi16(R[0],1),_mm_srai_epi16(R[1],1)); // R[0] = _mm_add_epi16(_mm_srai_epi16(R[0],1),_mm_srai_epi16(R[1],1));
R[0] = _mm_add_epi16(_mm_srai_epi16(R[0],1),_mm_srai_epi16(R[2],1)); // R[0] = _mm_add_epi16(_mm_srai_epi16(R[0],1),_mm_srai_epi16(R[2],1));
R[0] = _mm_add_epi16(R[0],_mm_add_epi16(R[1],R[2]));
Ravg[0] += (((short*)&R)[0] + Ravg[0] += (((short*)&R)[0] +
((short*)&R)[2] + ((short*)&R)[2] +
((short*)&R)[4] + ((short*)&R)[4] +
((short*)&R)[6])/(nb_rb*4); // ((short*)&R)[6])/(nb_rb*4);
((short*)&R)[6])/(nb_rb*12);
Ravg[1] += (((short*)&R)[1] + Ravg[1] += (((short*)&R)[1] +
((short*)&R)[3] + ((short*)&R)[3] +
((short*)&R)[5] + ((short*)&R)[5] +
((short*)&R)[7])/(nb_rb*4); // ((short*)&R)[7])/(nb_rb*4);
((short*)&R)[6])/(nb_rb*12);
ul_ch1+=3; ul_ch1+=3;
ul_ch2+=3; ul_ch2+=3;
...@@ -650,7 +656,7 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -650,7 +656,7 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms,
phase_idx = -phase_idx; phase_idx = -phase_idx;
return(phase_idx); return(phase_idx);
#elif defined(__arm__) #elif defined(__arm__)
return(0); return(0);
#endif #endif
} }
...@@ -60,12 +60,13 @@ int initial_syncSL(PHY_VARS_UE *ue) { ...@@ -60,12 +60,13 @@ int initial_syncSL(PHY_VARS_UE *ue) {
if (rx_psbch(ue) == -1) { if (rx_psbch(ue) == -1) {
ue->slbch_errors++; ue->slbch_errors++;
LOG_I(PHY,"PBCH not decoded\n");
/*
write_output("rxsig0.m","rxs0",&ue->common_vars.rxdata_syncSL[0][0],40*ue->frame_parms.samples_per_tti,1,1); write_output("rxsig0.m","rxs0",&ue->common_vars.rxdata_syncSL[0][0],40*ue->frame_parms.samples_per_tti,1,1);
write_output("corr0.m","rxsync0",sync_corr_ue0,40*ue->frame_parms.samples_per_tti,1,6); write_output("corr0.m","rxsync0",sync_corr_ue0,40*ue->frame_parms.samples_per_tti,1,6);
write_output("corr1.m","rxsync1",sync_corr_ue1,40*ue->frame_parms.samples_per_tti,1,6); write_output("corr1.m","rxsync1",sync_corr_ue1,40*ue->frame_parms.samples_per_tti,1,6);
exit(-1); exit(-1); */
return(-1); return(-1);
} }
else { else {
...@@ -77,7 +78,7 @@ int initial_syncSL(PHY_VARS_UE *ue) { ...@@ -77,7 +78,7 @@ int initial_syncSL(PHY_VARS_UE *ue) {
0, // eNB_index 0, // eNB_index
NULL, // pdu, NULL for MIB-SL NULL, // pdu, NULL for MIB-SL
0, // len, 0 for MIB-SL 0, // len, 0 for MIB-SL
&ue->slss_rx, ue->slss_rx.slmib,
&frame, &frame,
&subframe); &subframe);
......
...@@ -167,11 +167,13 @@ int rx_psbch(PHY_VARS_UE *ue) { ...@@ -167,11 +167,13 @@ int rx_psbch(PHY_VARS_UE *ue) {
if (l==0) l+=2; if (l==0) l+=2;
} }
#ifdef PSBCH_DEBUG #ifdef PSBCH_DEBUG
if (ue->frame_parms.Nid_SL==170) {
write_output("slbch_rxF.m", write_output("slbch_rxF.m",
"slbchrxF", "slbchrxF",
&rxdataF[0][0], &rxdataF[0][0],
14*ue->frame_parms.ofdm_symbol_size,1,1); 14*ue->frame_parms.ofdm_symbol_size,1,1);
write_output("slbch_rxF_ext.m","slbchrxF_ext",rxdataF_ext[0],14*12*ue->frame_parms.N_RB_DL,1,1); write_output("slbch_rxF_ext.m","slbchrxF_ext",rxdataF_ext[0],14*12*ue->frame_parms.N_RB_DL,1,1);
}
#endif #endif
lte_ul_channel_estimation(&ue->frame_parms, lte_ul_channel_estimation(&ue->frame_parms,
...@@ -185,7 +187,7 @@ int rx_psbch(PHY_VARS_UE *ue) { ...@@ -185,7 +187,7 @@ int rx_psbch(PHY_VARS_UE *ue) {
0, //v 0, //v
(ue->frame_parms.Nid_SL>>1)&7, //cyclic_shift (ue->frame_parms.Nid_SL>>1)&7, //cyclic_shift
3, 3,
1, // interpolation 0, // interpolation
0); 0);
lte_ul_channel_estimation(&ue->frame_parms, lte_ul_channel_estimation(&ue->frame_parms,
...@@ -199,7 +201,7 @@ int rx_psbch(PHY_VARS_UE *ue) { ...@@ -199,7 +201,7 @@ int rx_psbch(PHY_VARS_UE *ue) {
0,//v 0,//v
(ue->frame_parms.Nid_SL>>1)&7,//cyclic_shift, (ue->frame_parms.Nid_SL>>1)&7,//cyclic_shift,
10, 10,
1, // interpolation 0, // interpolation
0); 0);
ulsch_channel_level(drs_ch_estimates, ulsch_channel_level(drs_ch_estimates,
...@@ -208,7 +210,7 @@ int rx_psbch(PHY_VARS_UE *ue) { ...@@ -208,7 +210,7 @@ int rx_psbch(PHY_VARS_UE *ue) {
2); 2);
#ifdef PSBCH_DEBUG #ifdef PSBCH_DEBUG
write_output("drsbch_ext0.m","drsbchest0",drs_ch_estimates[0],ue->frame_parms.N_RB_UL*12*14,1,1); if (ue->frame_parms.Nid_SL == 170) write_output("drsbch_est0.m","drsbchest0",drs_ch_estimates[0],ue->frame_parms.N_RB_UL*12*14,1,1);
#endif #endif
avgs = 0; avgs = 0;
...@@ -260,7 +262,7 @@ int rx_psbch(PHY_VARS_UE *ue) { ...@@ -260,7 +262,7 @@ int rx_psbch(PHY_VARS_UE *ue) {
72); 72);
#ifdef PSBCH_DEBUG #ifdef PSBCH_DEBUG
write_output("slbch_rxF_comp.m","slbchrxF_comp",rxdataF_comp[0],ue->frame_parms.N_RB_UL*12*14,1,1); if (ue->frame_parms.Nid_SL == 170) write_output("slbch_rxF_comp.m","slbchrxF_comp",rxdataF_comp[0],ue->frame_parms.N_RB_UL*12*14,1,1);
#endif #endif
int8_t llr[PSBCH_E]; int8_t llr[PSBCH_E];
int8_t *llrp = llr; int8_t *llrp = llr;
...@@ -279,7 +281,7 @@ int rx_psbch(PHY_VARS_UE *ue) { ...@@ -279,7 +281,7 @@ int rx_psbch(PHY_VARS_UE *ue) {
1); 1);
#ifdef PSBCH_DEBUG #ifdef PSBCH_DEBUG
write_output("slbch_llr.m","slbch_llr",llr,PSBCH_E,1,4); if (ue->frame_parms.Nid_SL == 170) write_output("slbch_llr.m","slbch_llr",llr,PSBCH_E,1,4);
#endif #endif
uint8_t slbch_a[2+(PSBCH_A>>3)]; uint8_t slbch_a[2+(PSBCH_A>>3)];
......
...@@ -359,10 +359,10 @@ int rx_slsss(PHY_VARS_UE *ue,int32_t *tot_metric,uint8_t *phase_max,int Nid2) ...@@ -359,10 +359,10 @@ int rx_slsss(PHY_VARS_UE *ue,int32_t *tot_metric,uint8_t *phase_max,int Nid2)
0); 0);
// write_output("rxdataF0.m","rxF0",&rxdataF[0][0],2*14*ue->frame_parms.ofdm_symbol_size,1,1); // write_output("rxdataF0.m","rxF0",&rxdataF[0][0],2*14*ue->frame_parms.ofdm_symbol_size,1,1);
write_output("pss0_ext.m","pss0ext",pss0_ext,72,1,1); /* write_output("pss0_ext.m","pss0ext",pss0_ext,72,1,1);
write_output("sss0_ext.m","sss0ext",sss0_ext,72,1,1); write_output("sss0_ext.m","sss0ext",sss0_ext,72,1,1);
write_output("pss1_ext.m","pss1ext",pss1_ext,72,1,1); write_output("pss1_ext.m","pss1ext",pss1_ext,72,1,1);
write_output("sss1_ext.m","sss1ext",sss1_ext,72,1,1); write_output("sss1_ext.m","sss1ext",sss1_ext,72,1,1); */
......
...@@ -599,18 +599,22 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -599,18 +599,22 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_IN); (VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_IN);
LOG_D(MAC, "[UE %d] Frame %d Sending SI to RRC (LCID Id %d,len %d)\n",
module_idP, frameP, BCCH, len);
if (slss == NULL) { // this is not MIB-SL if (slss == NULL) { // this is not MIB-SL
LOG_D(MAC, "[UE %d] Frame %d Sending SI to RRC (LCID Id %d,len %d)\n",
module_idP, frameP, BCCH, len);
mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe
SI_RNTI, SI_RNTI,
BCCH, (uint8_t *) pdu, len, eNB_index, BCCH, (uint8_t *) pdu, len, eNB_index,
0); 0);
} }
else { else {
LOG_I(MAC, "[UE %d] Frame %d Sending MIBSL to RRC (LCID Id %d,len %d)\n",
module_idP, frameP, MIBSLCH, 5);
mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe
SI_RNTI, SI_RNTI,
MIBSLCH, (uint8_t *) pdu, len, eNB_index, MIBSLCH, (uint8_t *) slss->slmib, 5, eNB_index,
0); 0);
// copy frame/subframe // copy frame/subframe
*frame = UE_mac_inst[module_idP].directFrameNumber_r12; *frame = UE_mac_inst[module_idP].directFrameNumber_r12;
......
...@@ -6274,6 +6274,12 @@ int decode_MIB_SL( const protocol_ctxt_t* const ctxt_pP, ...@@ -6274,6 +6274,12 @@ int decode_MIB_SL( const protocol_ctxt_t* const ctxt_pP,
return -1; return -1;
} }
LOG_I(RRC,"Decoded MIBSL SFN.SF %d.%d, sl_Bandwidth_r12 %d, InCoverage %d\n",
BIT_STRING_to_uint32(&UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.directFrameNumber_r12), // indicates that there is no update in the frame number
UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.directSubframeNumber_r12, // /indicates that there isno update in the subframe number
&UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.sl_Bandwidth_r12,
UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.inCoverage_r12);
rrc_mac_config_req_ue(ctxt_pP->module_id, 0, 0, rrc_mac_config_req_ue(ctxt_pP->module_id, 0, 0,
(RadioResourceConfigCommonSIB_t *)NULL, (RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL, (struct PhysicalConfigDedicated *)NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment