From 2556b087f9406dc137210fbca53397bf85b51a2a Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 19 Apr 2021 12:41:21 +0200 Subject: [PATCH 1/4] added physicalCellGroupConfig to RRCSetup message --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 40f94b32d6..ddb8d1d934 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1149,6 +1149,10 @@ void fill_initial_cellGroupConfig(rnti_t rnti, } cellGroupConfig->mac_CellGroupConfig = mac_CellGroupConfig; + physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig)); + physicalCellGroupConfig->p_NR_FR1 = calloc(1,sizeof(*physicalCellGroupConfig->p_NR_FR1)); + physicalCellGroupConfig->p_NR_FR1 = 20; + physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic; cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig; cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig)); From a22a2b5745ed0e466399ecdbe892c7eecf47d3e9 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 19 Apr 2021 13:01:08 +0200 Subject: [PATCH 2/4] fixed bug in physicalCellGroupConfig initialization --- openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index ddb8d1d934..cc1e7c0172 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1151,7 +1151,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig)); physicalCellGroupConfig->p_NR_FR1 = calloc(1,sizeof(*physicalCellGroupConfig->p_NR_FR1)); - physicalCellGroupConfig->p_NR_FR1 = 20; + *physicalCellGroupConfig->p_NR_FR1 = 20; physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic; cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig; From 564311525e3a8f93a77da32ff00bc5f29e09f4b6 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Mon, 19 Apr 2021 23:53:28 +0200 Subject: [PATCH 3/4] applied patch for UE PUCCH TX from Albesmart. changed p-NR-FR1 to 0 (from 20) to reduce SNR on UL. PUCCH is now functional after inserting physicalCellGroupConfig (before and after applying MasterCellGroupConfig) --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 23 +++++++++++------------ openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c | 4 ++-- openair1/SCHED_NR_UE/pucch_uci_ue_nr.c | 2 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 3 ++- openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 65b19e777d..d12e1dc449 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -247,7 +247,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, x_im[1] = table_5_2_2_2_2_Im[u[1]]; int16_t xr[2][24] __attribute__((aligned(32))); - int32_t xrtmag=0; + int64_t xrtmag=0; uint8_t maxpos=0; uint8_t index=0; memset((void*)xr[0],0,24*sizeof(int16_t)); @@ -272,10 +272,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, #endif } } - int32_t corr_re[2],corr_im[2],temp,no_corr=0; - int32_t av_corr=0; + int32_t corr_re[2],corr_im[2],no_corr=0; int seq_index; - + int64_t temp,av_corr=0; for(i=0;inr_of_symbols;l++) { corr_re[l]=0;corr_im[l]=0; @@ -292,15 +291,15 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } } -#ifdef DEBUG_NR_PUCCH_RX - printf("PUCCH IDFT = (%d,%d)=>%f\n",corr_re[0],corr_im[0],10*log10(corr_re[0]*corr_re[0] + corr_im[0]*corr_im[0])); - if (l>1) printf("PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",mcs[i],seq_index,corr_re[1],corr_im[1],10*log10(corr_re[1]*corr_re[1] + corr_im[1]*corr_im[1])); -#endif +//#ifdef DEBUG_NR_PUCCH_RX + LOG_I(PHY,"PUCCH IDFT = (%d,%d)=>%f\n",corr_re[0],corr_im[0],10*log10((double)corr_re[0]*corr_re[0] + (double)corr_im[0]*corr_im[0])); + if (l>1) LOG_I(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",mcs[i],seq_index,corr_re[1],corr_im[1],10*log10((double)corr_re[1]*corr_re[1] + (double)corr_im[1]*corr_im[1])); +//#endif if (pucch_pdu->freq_hop_flag == 0 && l==1) // non-coherent correlation - temp=corr_re[0]*corr_re[0] + corr_im[0]*corr_im[0]; + temp=(int64_t)corr_re[0]*corr_re[0] + (int64_t)corr_im[0]*corr_im[0]; else if (pucch_pdu->freq_hop_flag == 0 && l==2) { - int32_t corr_re2 = corr_re[0]+corr_re[1]; - int32_t corr_im2 = corr_im[0]+corr_im[1]; + int64_t corr_re2 = (int64_t)corr_re[0]+corr_re[1]; + int64_t corr_im2 = (int64_t)corr_im[0]+corr_im[1]; // coherent combining of 2 symbols and then complex modulus for single-frequency case temp=corr_re2*corr_re2 + corr_im2*corr_im2; } @@ -319,7 +318,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, no_corr=(av_corr-xrtmag)/(nr_sequences-1)/l; av_corr/=nr_sequences/l; - uint8_t xrtmag_dB = dB_fixed(xrtmag); + uint8_t xrtmag_dB = dB_fixed64(xrtmag); #ifdef DEBUG_NR_PUCCH_RX printf("PUCCH 0 : maxpos %d\n",maxpos); diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c index 316c37741f..9a191ae6f9 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c +++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c @@ -112,9 +112,9 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue, } for (int l=0; l>15) diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c index 23c50d58f1..6946b0289e 100644 --- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c +++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c @@ -466,7 +466,7 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_ nb_symbols_total = get_nb_symbols_pucch(pucch_resource, format); starting_symbol_index = get_starting_symb_idx(pucch_resource, format); startingPRB = BWPstart + pucch_resource->startingPRB; - secondHopPRB = pucch_resource->intraSlotFrequencyHopping ? (BWPstart+pucch_resource->secondHopPRB) : startingPRB; + secondHopPRB = pucch_resource->intraSlotFrequencyHopping ? (BWPstart+*pucch_resource->secondHopPRB) : startingPRB; if (format==pucch_format1_nr) time_domain_occ = pucch_resource->format.choice.format1->timeDomainOCC; if (format==pucch_format4_nr) { diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 12165a1d3e..8572441241 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -107,7 +107,8 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) UL_info->uci_ind.num_ucis = 0; // mark corresponding PUCCH resources as free - // NOTE: we just assume it is BWP ID 1, to be revised for multiple BWPs + // NOTE: we just assume it is BWP ID 0 and 1, to be revised for multiple BWPs + RC.nrmac[mod_id]->pucch_index_used[0][slot] = 0; RC.nrmac[mod_id]->pucch_index_used[1][slot] = 0; } diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index cc1e7c0172..c8b719cfc9 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1151,7 +1151,7 @@ void fill_initial_cellGroupConfig(rnti_t rnti, physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig)); physicalCellGroupConfig->p_NR_FR1 = calloc(1,sizeof(*physicalCellGroupConfig->p_NR_FR1)); - *physicalCellGroupConfig->p_NR_FR1 = 20; + *physicalCellGroupConfig->p_NR_FR1 = 0; physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic; cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig; From 03f00ee7baea1e0ecf8325b7615d4cd7967dc80e Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Tue, 20 Apr 2021 12:02:06 +0200 Subject: [PATCH 4/4] fixed dynamic range in PUCCH RX for 2 symbol/frequency-hopping --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index d12e1dc449..99bc5b5774 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -305,7 +305,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } else if (pucch_pdu->freq_hop_flag == 1) // full non-coherent combining of 2 symbols for frequency-hopping case - temp = corr_re[0]*corr_re[0] + corr_im[0]*corr_im[0] + corr_re[1]*corr_re[1] + corr_im[1]*corr_im[1]; + temp = (int64_t)corr_re[0]*corr_re[0] + (int64_t)corr_im[0]*corr_im[0] + (int64_t)corr_re[1]*corr_re[1] + (int64_t)corr_im[1]*corr_im[1]; else AssertFatal(1==0,"shouldn't happen\n"); av_corr+=temp; @@ -363,8 +363,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; - LOG_I(PHY, "Slot %d HARQ value %d with confidence level (0 is good, 1 is bad) %d\n", - slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level); + LOG_I(PHY, "Slot %d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d\n", + slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dB); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>1) ? 1 : 0; @@ -378,8 +378,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01; - LOG_D(PHY, "Slot %d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d\n", - slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level); + LOG_D(PHY, "Slot %d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d\n", + slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dB); if (pucch_pdu->sr_flag == 1) { uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); uci_pdu->sr->sr_indication = (index>3) ? 1 : 0;