Merge remote-tracking branch 'origin/NR_SA_F1AP_5GRECORDS' into develop-NR_SA_F1AP_5GRECORDS
# Conflicts: # openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
This commit is contained in:
@@ -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;i<nr_sequences;i++){
|
||||
for (l=0;l<pucch_pdu->nr_of_symbols;l++) {
|
||||
corr_re[l]=0;corr_im[l]=0;
|
||||
@@ -292,21 +291,21 @@ 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;
|
||||
}
|
||||
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;
|
||||
@@ -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);
|
||||
@@ -364,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;
|
||||
@@ -379,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;
|
||||
|
||||
@@ -112,9 +112,9 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
for (int l=0; l<nrofSymbols; l++) {
|
||||
alpha = nr_cyclic_shift_hopping(hoppingId,m0,mcs,l,startingSymbolIndex,nr_slot_tx);
|
||||
#ifdef DEBUG_NR_PUCCH_TX
|
||||
//#ifdef DEBUG_NR_PUCCH_TX
|
||||
printf("\t [nr_generate_pucch0] sequence generation \tu=%d \tv=%d \talpha=%lf \t(for symbol l=%d)\n",u[l],v[l],alpha,l);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
for (int n=0; n<12; n++) {
|
||||
x_n_re[l][n] = (int16_t)(((((int32_t)(round(32767*cos(alpha*n))) * table_5_2_2_2_2_Re[u[l]][n])>>15)
|
||||
|
||||
@@ -656,7 +656,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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 = 0;
|
||||
physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic;
|
||||
cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig;
|
||||
|
||||
cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig));
|
||||
|
||||
Reference in New Issue
Block a user