diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf index 4309c13dd3..a441ecbad9 100644 --- a/ci-scripts/conf_files/gNB_SA_DU.conf +++ b/ci-scripts/conf_files/gNB_SA_DU.conf @@ -205,7 +205,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; thread_pool_size = 8; - prach_dtx_threshold = 120; + prach_dtx_threshold = 200; pucch0_dtx_threshold = 150; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf index e1264bd069..c3f382c79a 100644 --- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -237,7 +237,7 @@ L1s = ( { num_cc = 1; tr_n_preference = "local_mac"; - prach_dtx_threshold = 120; + prach_dtx_threshold = 200; # pucch0_dtx_threshold = 150; } ); diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf index 6b7122341d..ee31a01f1a 100644 --- a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf +++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf @@ -218,6 +218,7 @@ L1s = ( num_cc = 1; tr_n_preference = "local_mac"; pusch_proc_threads = 8; + prach_dtx_threshold = 200; ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 } ); diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 305cbd612c..f22e66b206 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -221,8 +221,7 @@ void rx_func(void *param) { gNB->common_vars.rxdataF[aa], slot_rx, 0, - gNB->frame_parms.Ncp==EXTENDED?12:14, - gNB->frame_parms.ofdm_symbol_size); + gNB->frame_parms.Ncp==EXTENDED?12:14); } phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx); } diff --git a/openair1/PHY/MODULATION/nr_modulation.h b/openair1/PHY/MODULATION/nr_modulation.h index 88a4cfefed..435251868e 100644 --- a/openair1/PHY/MODULATION/nr_modulation.h +++ b/openair1/PHY/MODULATION/nr_modulation.h @@ -112,8 +112,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp, int16_t* txdata, int slot, int first_symbol, - int nsymb, - int length); + int nsymb); void init_symbol_rotation(NR_DL_FRAME_PARMS *fp); @@ -123,8 +122,7 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms, int32_t *rxdataF, int slot, int first_symbol, - int nsymb, - int length); + int nsymb); /*! \brief Perform NR precoding. TS 38.211 V15.4.0 subclause 6.3.1.5 @param[in] datatx_F_precoding, Pointer to n_layers*re data array diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index 0b8f22a094..0f79c4532b 100644 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -341,30 +341,41 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne } void apply_nr_rotation(NR_DL_FRAME_PARMS *fp, - int16_t* trxdata, + int16_t* txdataF, int slot, int first_symbol, - int nsymb, - int length) { + int nsymb) +{ int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot; - c16_t *symbol_rotation = fp->symbol_rotation[0]; + c16_t *symbol_rotation = fp->symbol_rotation[0] + symb_offset; - for (int sidx=0;sidxofdm_symbol_size; - LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d, length %d (%d,%d)\n", - first_symbol + sidx, + LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d (%d,%d)\n", + sidx, slot, - sidx + first_symbol + symb_offset, - length, - symbol_rotation[sidx + first_symbol + symb_offset].r, - symbol_rotation[sidx + first_symbol + symb_offset].i); + sidx + symb_offset, + this_rotation->r, + this_rotation->i); - rotate_cpx_vector(((c16_t*) trxdata) + sidx * length, - symbol_rotation + sidx + first_symbol + symb_offset, - ((c16_t*) trxdata) + sidx * length, - length, - 15); + if (fp->N_RB_DL & 1) { + rotate_cpx_vector(this_symbol, this_rotation, this_symbol, + (fp->N_RB_DL + 1) * 6, 15); + rotate_cpx_vector(this_symbol + fp->first_carrier_offset - 6, + this_rotation, + this_symbol + fp->first_carrier_offset - 6, + (fp->N_RB_DL + 1) * 6, 15); + } else { + rotate_cpx_vector(this_symbol, this_rotation, this_symbol, + fp->N_RB_DL * 6, 15); + rotate_cpx_vector(this_symbol + fp->first_carrier_offset, + this_rotation, + this_symbol + fp->first_carrier_offset, + fp->N_RB_DL * 6, 15); + } } } diff --git a/openair1/PHY/MODULATION/slot_fep_nr.c b/openair1/PHY/MODULATION/slot_fep_nr.c index 548db21878..71be5ba6ed 100644 --- a/openair1/PHY/MODULATION/slot_fep_nr.c +++ b/openair1/PHY/MODULATION/slot_fep_nr.c @@ -107,20 +107,36 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, symbol+symb_offset,rot2.r,rot2.i); #endif - rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], - &rot2, - (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], - frame_parms->ofdm_symbol_size, - 15); - c16_t *shift_rot = frame_parms->timeshift_symbol_rotation; + c16_t *this_symbol = (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol]; - multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], - (int16_t *)shift_rot, - (int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], - 1, - frame_parms->ofdm_symbol_size, - 15); + if (frame_parms->N_RB_DL & 1) { + rotate_cpx_vector(this_symbol, &rot2, this_symbol, + (frame_parms->N_RB_DL + 1) * 6, 15); + rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6, + &rot2, + this_symbol + frame_parms->first_carrier_offset - 6, + (frame_parms->N_RB_DL + 1) * 6, 15); + multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol, + 1, (frame_parms->N_RB_DL + 1) * 6, 15); + multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6), + (int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6), + (int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6), + 1, (frame_parms->N_RB_DL + 1) * 6, 15); + } else { + rotate_cpx_vector(this_symbol, &rot2, this_symbol, + frame_parms->N_RB_DL * 6, 15); + rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset, + &rot2, + this_symbol + frame_parms->first_carrier_offset, + frame_parms->N_RB_DL * 6, 15); + multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol, + 1, frame_parms->N_RB_DL * 6, 15); + multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset), + (int16_t *)(shift_rot + frame_parms->first_carrier_offset), + (int16_t *)(this_symbol + frame_parms->first_carrier_offset), + 1, frame_parms->N_RB_DL * 6, 15); + } } #ifdef DEBUG_FEP @@ -223,11 +239,8 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, symbol+symb_offset,rot2.r,rot2.i); #endif - rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], - &rot2, - (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol], - frame_parms->ofdm_symbol_size, - 15); + c16_t *this_symbol = (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol]; + rotate_cpx_vector(this_symbol, &rot2, this_symbol, frame_parms->ofdm_symbol_size, 15); } #ifdef DEBUG_FEP @@ -301,10 +314,8 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms, int32_t *rxdataF, int slot, int first_symbol, - int nsymb, - int length) { - - + int nsymb) +{ int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size; @@ -313,19 +324,36 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms, c16_t rot2 = frame_parms->symbol_rotation[1][symbol + symb_offset]; rot2.i=-rot2.i; LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i); - rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], - &rot2, - (c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], - length, - 15); c16_t *shift_rot = frame_parms->timeshift_symbol_rotation; + c16_t *this_symbol = (c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)]; - multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], - (int16_t *)shift_rot, - (int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)], - 1, - length, - 15); + if (frame_parms->N_RB_UL & 1) { + rotate_cpx_vector(this_symbol, &rot2, this_symbol, + (frame_parms->N_RB_UL + 1) * 6, 15); + rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6, + &rot2, + this_symbol + frame_parms->first_carrier_offset - 6, + (frame_parms->N_RB_UL + 1) * 6, 15); + multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol, + 1, (frame_parms->N_RB_UL+1) * 6, 15); + multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6), + (int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6), + (int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6), + 1, (frame_parms->N_RB_UL+1) * 6, 15); + } else { + rotate_cpx_vector(this_symbol, &rot2, this_symbol, + frame_parms->N_RB_UL * 6, 15); + rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset, + &rot2, + this_symbol + frame_parms->first_carrier_offset, + frame_parms->N_RB_UL * 6, 15); + multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol, + 1, frame_parms->N_RB_UL * 6, 15); + multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset), + (int16_t *)(shift_rot + frame_parms->first_carrier_offset), + (int16_t *)(this_symbol + frame_parms->first_carrier_offset), + 1, frame_parms->N_RB_UL * 6, 15); + } } } diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c index eaeffd0809..dba1fd194d 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c @@ -597,17 +597,28 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot; for(ap = 0; ap < n_antenna_ports; ap++) { for (int s=0;ssymbol_rotation[1])[s + symb_offset]; + c16_t *this_symbol = (c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s]; + c16_t rot=frame_parms->symbol_rotation[1][s + symb_offset]; LOG_D(PHY,"rotating txdataF symbol %d (%d) => (%d.%d)\n", s, s + symb_offset, rot.r, rot.i); - rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s], - &rot, - (c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s], - frame_parms->ofdm_symbol_size, - 15); + if (frame_parms->N_RB_UL & 1) { + rotate_cpx_vector(this_symbol, &rot, this_symbol, + (frame_parms->N_RB_UL + 1) * 6, 15); + rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6, + &rot, + this_symbol + frame_parms->first_carrier_offset - 6, + (frame_parms->N_RB_UL + 1) * 6, 15); + } else { + rotate_cpx_vector(this_symbol, &rot, this_symbol, + frame_parms->N_RB_UL * 6, 15); + rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset, + &rot, + this_symbol + frame_parms->first_carrier_offset, + frame_parms->N_RB_UL * 6, 15); + } } } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index db8a5deadd..b204a9e427 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -181,7 +181,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, //apply the OFDM symbol rotation here for (aa=0; aacarrier_config.num_tx_ant.value; aa++) { - apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size); + apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0); diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 0e648c945f..aaa28b274c 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -606,6 +606,12 @@ int main(int argc, char **argv) for (aa=0; aaframe_parms.nb_antennas_tx; aa++) { if (cyclic_prefix_type == 1) { + apply_nr_rotation(frame_parms, + (int16_t*)gNB->common_vars.txdataF[aa], + slot, + 0, + 12); + PHY_ofdm_mod(gNB->common_vars.txdataF[aa], &txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)], frame_parms->ofdm_symbol_size, @@ -613,10 +619,17 @@ int main(int argc, char **argv) frame_parms->nb_prefix_samples, CYCLIC_PREFIX); } else { + apply_nr_rotation(frame_parms, + (int16_t*)gNB->common_vars.txdataF[aa], + slot, + 0, + 14); + /*nr_normal_prefix_mod(gNB->common_vars.txdataF[aa], &txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)], 14, frame_parms);*/ + PHY_ofdm_mod(gNB->common_vars.txdataF[aa], (int*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)], frame_parms->ofdm_symbol_size, @@ -624,26 +637,12 @@ int main(int argc, char **argv) frame_parms->nb_prefix_samples0, CYCLIC_PREFIX); - apply_nr_rotation(frame_parms, - (int16_t*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)], - slot, - 0, - 1, - frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples0); - PHY_ofdm_mod(&gNB->common_vars.txdataF[aa][frame_parms->ofdm_symbol_size], (int*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)+frame_parms->nb_prefix_samples0+frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 13, frame_parms->nb_prefix_samples, CYCLIC_PREFIX); - - apply_nr_rotation(frame_parms, - (int16_t*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)+frame_parms->nb_prefix_samples0+frame_parms->ofdm_symbol_size], - slot, - 1, - 13, - frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples); } } } diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 24755684a8..fb497c3141 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -1401,8 +1401,7 @@ int main(int argc, char **argv) gNB->common_vars.rxdataF[aa], slot, 0, - gNB->frame_parms.Ncp == EXTENDED ? 12 : 14, - gNB->frame_parms.ofdm_symbol_size); + gNB->frame_parms.Ncp == EXTENDED ? 12 : 14); } ul_proc_error = phy_procedures_gNB_uespec_RX(gNB, frame, slot);