diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 1c3aaf432e..08d47bad0b 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -757,13 +757,13 @@ void nr_init_ul_harq_processes(NR_UL_UE_HARQ_t *harq_list, int number_of_process bzero(harq_list[i].d[r],(68*384)); } - harq_list[i].e = malloc16(14*num_rb*12*8); + harq_list[i].e = malloc16(14*num_rb*12*16); DevAssert(harq_list[i].e); - bzero(harq_list[i].e,14*num_rb*12*8); + bzero(harq_list[i].e,14*num_rb*12*16); - harq_list[i].f = malloc16(14*num_rb*12*8); + harq_list[i].f = malloc16(14*num_rb*12*16); DevAssert(harq_list[i].f); - bzero(harq_list[i].f,14*num_rb*12*8); + bzero(harq_list[i].f,14*num_rb*12*16); harq_list[i].first_tx = 1; harq_list[i].round = 0; diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index e6b7ecba44..e7ca3c99db 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -196,7 +196,6 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, } #endif - const uint8_t b_shift = pusch_pdu->nrOfLayers == 1; for (int aarx=0; aarxframe_parms.nb_antennas_rx; aarx++) { c16_t *rxdataF = (c16_t *)&gNB->common_vars.rxdataF[aarx][symbol_offset]; @@ -228,7 +227,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ch=c32x16maddShift(*pil, rxdataF[soffset + re_offset], ch, - 15+b_shift); + 16); pil++; } @@ -668,7 +667,7 @@ void nr_pusch_ptrs_processing(PHY_VARS_gNB *gNB, /*------------------------------------------------------------------------------------------------------- */ /* 3) Compensated DMRS based estimated signal with PTRS estimation */ /*--------------------------------------------------------------------------------------------------------*/ - for(uint8_t i = *startSymbIndex; i< symbInSlot ; i++) { + for(uint8_t i = *startSymbIndex; i < symbInSlot; i++) { /* DMRS Symbol has 0 phase so no need to rotate the respective symbol */ /* Skip rotation if the slot processing is wrong */ if((!is_dmrs_symbol(i,*dmrsSymbPos)) && (ret == 0)) { diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c index bfa0475f7f..6352b694cc 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c @@ -207,7 +207,7 @@ void nr_processULSegment(void* arg) { //////////////////////////// ulsch_llr =====> ulsch_harq->e ////////////////////////////// /// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) - int16_t harq_e[3*8448]; + int16_t harq_e[E]; nr_deinterleaving_ldpc(E, Qm, @@ -290,7 +290,7 @@ void nr_processULSegment(void* arg) { ////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// pl =====> llrProcBuf ////////////////////////////////// - + p_decoderParms->block_length = length_dec; no_iteration_ldpc = nrLDPC_decoder(p_decoderParms, (int8_t*)&pl[0], llrProcBuf, @@ -513,7 +513,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, t_nrLDPC_time_stats procTime = {0}; t_nrLDPC_time_stats *p_procTime = &procTime; /// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) - int16_t harq_e[3 * 8448]; + int16_t harq_e[E]; nr_deinterleaving_ldpc(E, Qm, harq_e, ulsch_llr + r_offset); diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c index 14eadefbaf..db37b0536e 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c +++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c @@ -1843,7 +1843,13 @@ uint8_t nr_ulsch_zero_forcing_rx_2layers(int **rxdataF_comp, determ_fin_128[0]); rxdataF_comp128_0[0] = mmtmpD0; - rxdataF_comp128_1[0] = mmtmpD1; + if (mod_order > 2) { + // We need to check why it is a shift of 3 + rxdataF_comp128_1[0] = _mm_srai_epi16(mmtmpD1, 3); + } else { + rxdataF_comp128_1[0] = mmtmpD1; + } + #ifdef DEBUG_DLSCH_DEMOD printf("\n Rx signal after ZF l%d rb%d\n",symbol,rb); print_shorts(" Rx layer 1:",(int16_t*)&rxdataF_comp128_0[0]); @@ -1954,7 +1960,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, int off = ((rel15_ul->rb_size&1) == 1)? 4:0; uint32_t rxdataF_ext_offset = 0; - uint8_t ad_shift = 1 + log2_approx(frame_parms->nb_antennas_rx >> 2); + uint8_t ad_shift = 1 + log2_approx(frame_parms->nb_antennas_rx >> 2) + (rel15_ul->nrOfLayers == 2); for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) { uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01; @@ -2057,18 +2063,21 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, symbol, rel15_ul->rb_size, nb_re_pusch); - - if (rel15_ul->nrOfLayers == 2)//Apply zero forcing for 2 Tx layers + + //Apply zero forcing for 2 Tx layers + if (rel15_ul->nrOfLayers == 2) { nr_ulsch_zero_forcing_rx_2layers(gNB->pusch_vars[ulsch_id]->rxdataF_comp, - gNB->pusch_vars[ulsch_id]->ul_ch_mag0, - gNB->pusch_vars[ulsch_id]->ul_ch_magb0, - gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext, - rel15_ul->rb_size, - frame_parms->nb_antennas_rx, - rel15_ul->qam_mod_order, - gNB->pusch_vars[ulsch_id]->log2_maxh, - symbol, - nb_re_pusch); + gNB->pusch_vars[ulsch_id]->ul_ch_mag0, + gNB->pusch_vars[ulsch_id]->ul_ch_magb0, + gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext, + rel15_ul->rb_size, + frame_parms->nb_antennas_rx, + rel15_ul->qam_mod_order, + gNB->pusch_vars[ulsch_id]->log2_maxh, + symbol, + nb_re_pusch); + } + stop_meas(&gNB->ulsch_mrc_stats); if (rel15_ul->transform_precoding == transformPrecoder_enabled) {