From 518edc742c799128e8150044e91c81e1c5947d03 Mon Sep 17 00:00:00 2001 From: Eurecom Date: Thu, 29 Apr 2021 13:07:20 +0200 Subject: [PATCH 1/2] n300 fixes 50 MHz configuration --- cmake_targets/tools/build_helper | 1 + executables/nr-ru.c | 11 +++++++++++ openair1/SCHED_NR/phy_procedures_nr_gNB.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 15 +++++++++++++++ .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 ++ openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c | 3 ++- 6 files changed, 32 insertions(+), 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 977827b0c9..39eb64d6e0 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -113,6 +113,7 @@ check_supported_distribution() { "rhel7.6") return 0 ;; "rhel7.7") return 0 ;; "rhel7.8") return 0 ;; + "rhel7.9") return 0 ;; "rhel8.2") return 0 ;; "rhel8.3") return 0 ;; "rhel8.4") return 0 ;; diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 9dbd025680..ae897f4a1c 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -861,6 +861,17 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { cfg->tx_bw = 40e6; cfg->rx_bw = 40e6; } + } else if(N_RB == 133) { + if (fp->threequarter_fs) { + AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB); + } + else { + cfg->sample_rate=61.44e6; + cfg->samples_per_frame = 614400; + cfg->tx_bw = 50e6; + cfg->rx_bw = 50e6; + } + } else { AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu); } diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index b26c95fc4d..da32be2374 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -380,6 +380,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, // scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size switch (gNB->frame_parms.N_RB_DL) { case 106: timing_advance_update /= 16; break; + case 133: timing_advance_update /= 16; break; case 217: timing_advance_update /= 32; break; case 245: timing_advance_update /= 32; break; case 273: timing_advance_update /= 32; break; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 30a89cce77..ebec6b0cfe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -753,6 +753,21 @@ void nr_schedule_ue_spec(module_id_t module_id, current_harq_pid, harq->round, harq->ndi); + if ((get_softmodem_params()->phy_test == 1) && (frame&127) == 0) + LOG_D(MAC, + "%4d.%2d RNTI %04x start %d RBs %d startSymbol %d nb_symbsol %d MCS %d TBS %d (%f Mbps) HARQ PID %d round %d NDI %d\n", + frame, + slot, + rnti, + sched_ctrl->rbStart, + sched_ctrl->rbSize, + startSymbolIndex, + nrOfSymbols, + sched_ctrl->mcs, + TBS,((double)TBS)*(1<uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing))/1000, + current_harq_pid, + harq->round, + harq->ndi); NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp; AssertFatal(bwp->bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 6487f391b9..3ab10e4b5e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -370,6 +370,8 @@ void nr_preprocessor_phytest(module_id_t module_id, /* mark the corresponding RBs as used */ for (int rb = 0; rb < sched_ctrl->rbSize; rb++) vrb_map[rb + sched_ctrl->rbStart] = 1; + + if ((frame&127) == 0) LOG_I(MAC,"phytest: %d.%d DL mcs %d, DL rbStart %d, DL rbSize %d\n", frame, slot, sched_ctrl->mcs, rbStart,rbSize); } bool nr_ul_preprocessor_phytest(module_id_t module_id, diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c index 9c139624eb..b440ee44b1 100644 --- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c +++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c @@ -38,6 +38,7 @@ #include +#include static nr_rlc_ue_manager_t *nr_rlc_ue_manager; /* TODO: handle time a bit more properly */ @@ -250,7 +251,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind( + buf_stat.retx_size + buf_stat.tx_size; } else { - LOG_W(RLC, "[%s] Radio Bearer (channel ID %d) is NULL for UE with rntiP %x\n", __FUNCTION__, channel_idP, rntiP); + if (get_softmodem_params()->phy_test == 0) LOG_W(RLC, "[%s] Radio Bearer (channel ID %d) is NULL for UE with rntiP %x\n", __FUNCTION__, channel_idP, rntiP); ret.bytes_in_buffer = 0; } From 586fc52f8d992ddb92234149f10e6b0136196f4f Mon Sep 17 00:00:00 2001 From: Eurecom Date: Thu, 13 May 2021 09:09:09 +0200 Subject: [PATCH 2/2] 50 MHz formats, prach RX scaling --- openair1/PHY/NR_TRANSPORT/nr_dci.c | 1 - openair1/PHY/NR_TRANSPORT/nr_prach.c | 2 +- openair1/SCHED_NR/nr_prach_procedures.c | 6 ++++-- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c index cf38aaa4bf..b7de182ab7 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_dci.c +++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c @@ -94,7 +94,6 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, * in time: by its first slot and its first symbol*/ const nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[d]; - LOG_D(PHY,"DCI pdu %d, rnti %x, aggregation %d CCE %d Scrambling_Id %x ScramblingRNTI %x PayloadSizeBits %d\n",d,dci_pdu->RNTI,dci_pdu->AggregationLevel,dci_pdu->CceIndex,dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits); cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_nsymb = pdcch_pdu_rel15->DurationSymbols; dci_idx = 0; diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach.c b/openair1/PHY/NR_TRANSPORT/nr_prach.c index 34c647810d..638b0dff2c 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prach.c @@ -882,7 +882,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, log2_ifft_size = 8; // compute energy and accumulate over receive antennas and repetitions for BR for (i=0;i<256;i++) - prach_ifft[i] += ((int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)])>>10; + prach_ifft[i] += ((int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)])/nb_rx; } if (LOG_DUMPFLAG(PRACH)) { diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 533dbb8e1a..848b11dcde 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -114,23 +114,25 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) { &max_preamble_delay[0] ); free_nr_prach_entry(gNB,prach_id); - LOG_D(PHY,"[RAPROC] Frame %d, slot %d, occasion %d (prachStartSymbol %d) : Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n", + LOG_D(PHY,"[RAPROC] Frame %d, slot %d, occasion %d (prachStartSymbol %d) : Most likely preamble %d, energy %d.%d dB delay %d (prach_energy counter %d)\n", frame,slot,prach_oc,prachStartSymbol, max_preamble[0], max_preamble_energy[0]/10, + max_preamble_energy[0]%10, max_preamble_delay[0], gNB->prach_energy_counter); if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) { - LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d start symbol %u freq index %u\n", + LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n", gNB->Mod_id, frame, slot, max_preamble[0], max_preamble_energy[0]/10, max_preamble_energy[0]%10, + gNB->measurements.prach_I0,gNB->prach_thres, max_preamble_delay[0], prachStartSymbol, prach_pdu->num_ra); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index b472d7a9ba..1014be0e44 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -680,7 +680,7 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot),gNB->pusch_thres); nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1); gNB->pusch_vars[ULSCH_id]->DTX=1; - stats->DTX++; + if (stats) stats->DTX++; return; } else gNB->pusch_vars[ULSCH_id]->DTX=0;