From a98cf88735aee14066e9b09135c75ff2ef38ff71 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Mon, 14 Sep 2020 13:38:30 +0200 Subject: [PATCH] fixing a mistake in the computation of the prach_start_symbol --- executables/nr-ru.c | 4 +++- openair1/SCHED_NR/nr_prach_procedures.c | 7 ++++--- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 10 +++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index b33c66ce81..ca4dd3c5db 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -1602,7 +1602,9 @@ void *ru_thread( void *param ) { &config_period); for (int prach_oc = 0; prach_ocprach_list[prach_id].num_prach_ocas; prach_oc++) { - prachStartSymbol = ru->prach_list[prach_id].prachStartSymbol+prach_oc*N_dur+14*N_RA_slot; + prachStartSymbol = ru->prach_list[prach_id].prachStartSymbol+prach_oc*N_dur; + //comment FK: the standard 38.211 section 5.3.2 has one extra term +14*N_RA_slot. This is because there prachStartSymbol is given wrt to start of the 15kHz slot or 60kHz slot. Here we work slot based, so this function is anyway only called in slots where there is PRACH. Its up to the MAC to schedule another PRACH PDU in the case there are there N_RA_slot \in {0,1}. + rx_nr_prach_ru(ru, ru->prach_list[prach_id].fmt, //could also use format ru->prach_list[prach_id].numRA, diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c index 6296684b64..a9408b5800 100644 --- a/openair1/SCHED_NR/nr_prach_procedures.c +++ b/openair1/SCHED_NR/nr_prach_procedures.c @@ -92,12 +92,13 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) { &N_RA_slot, &config_period); - for(int prach_oc = 0; prach_oc < NUMBER_OF_NR_RU_PRACH_OCCASIONS_MAX; prach_oc++) { + for(int prach_oc = 0; prach_oc < prach_pdu->num_prach_ocas; prach_oc++) { for (ru_aa=0,aa=0;ru_aanb_rx;ru_aa++,aa++) { gNB->prach_vars.rxsigF[aa] = ru->prach_rxsigF[prach_oc][ru_aa]; } - prachStartSymbol = prach_pdu->prach_start_symbol+prach_oc*N_dur+14*N_RA_slot; + prachStartSymbol = prach_pdu->prach_start_symbol+prach_oc*N_dur; + //comment FK: the standard 38.211 section 5.3.2 has one extra term +14*N_RA_slot. This is because there prachStartSymbol is given wrt to start of the 15kHz slot or 60kHz slot. Here we work slot based, so this function is anyway only called in slots where there is PRACH. Its up to the MAC to schedule another PRACH PDU in the case there are there N_RA_slot \in {0,1}. rx_nr_prach(gNB, prach_pdu, @@ -127,7 +128,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) { max_preamble_energy[0]/10, max_preamble_energy[0]%10, max_preamble_delay[0], - prach_pdu->prach_start_symbol, + prachStartSymbol, prach_pdu->num_ra); T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(gNB->Mod_id), T_INT(frame), T_INT(slot), diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 9b778ad562..042e57c768 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -467,11 +467,11 @@ void nr_initiate_ra_proc(module_id_t module_idP, if (ra->state == RA_IDLE) { uint8_t index = ssb_index_from_prach(module_idP, - frameP, - slotP, - preamble_index, - freq_index, - symbol); + frameP, + slotP, + preamble_index, + freq_index, + symbol); NR_SSB_list_t *SSB_list = &nr_mac->SSB_list[index]; int loop = 0;