From 4e869190604fcd0df427438424c614a246dc5ae9 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Fri, 6 May 2022 18:03:48 +0200 Subject: [PATCH 1/8] gNB & nrUE: Added multiple PRS resources scheduling --- openair1/PHY/INIT/nr_init_ue.c | 28 ++-- .../nr_dl_channel_estimation.c | 14 +- openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h | 1 + openair1/PHY/defs_gNB.h | 7 +- openair1/PHY/defs_nr_UE.h | 7 +- openair1/PHY/defs_nr_common.h | 34 ++--- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 41 +++--- openair1/SCHED_NR/sched_nr.h | 1 + openair1/SCHED_NR_UE/defs.h | 1 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 44 ++++--- openair2/GNB_APP/gnb_config.c | 96 +++++++++----- openair2/GNB_APP/prs_nr_paramdef.h | 64 ++++++---- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 120 ++++++++++++------ .../gnb.sa.band78.fr1.106PRB.usrpb210.conf | 27 ++-- .../GENERIC-NR-5GC/CONF/ue_nr_prs.conf | 22 ++-- 15 files changed, 319 insertions(+), 188 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 2ef13d3c60..43bc62adf0 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -328,20 +328,22 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, for(int idx = 0; idx < NR_MAX_PRS_COMB_SIZE; idx++) { prs_vars[idx] = (NR_UE_PRS *)malloc16_clear(sizeof(NR_UE_PRS)); + for(int k = 0; k < NR_MAX_PRS_RESOURCES_PER_SET; k++) + { + // PRS channel estimates + prs_vars[idx]->prs_resource[k].prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); + prs_vars[idx]->prs_resource[k].prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); + AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed for gNB_id %d\n", idx); + prs_vars[idx]->prs_resource[k].prs_meas = (prs_meas_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(prs_meas_t *) ); + AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx); - // PRS channel estimates - prs_vars[idx]->prs_ch_estimates = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); - prs_vars[idx]->prs_ch_estimates_time = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); - AssertFatal(((prs_vars[idx]->prs_ch_estimates!=NULL) || (prs_vars[idx]->prs_ch_estimates_time!=NULL)), "NR UE init: PRS channel estimates malloc failed for gNB_id %d\n", idx); - prs_vars[idx]->prs_meas = (prs_meas_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(prs_meas_t *) ); - AssertFatal((prs_vars[idx]->prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx); - - for (i=0; inb_antennas_rx; i++) { - prs_vars[idx]->prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*NR_SYMBOLS_PER_SLOT*sizeof(int32_t)); - prs_vars[idx]->prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*NR_SYMBOLS_PER_SLOT*sizeof(int32_t)); - AssertFatal(((prs_vars[idx]->prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i); - prs_vars[idx]->prs_meas[i] = (prs_meas_t *)malloc16_clear(NR_SYMBOLS_PER_SLOT*sizeof(prs_meas_t) ); - AssertFatal((prs_vars[idx]->prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i); + for (i=0; inb_antennas_rx; i++) { + prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*NR_SYMBOLS_PER_SLOT*sizeof(int32_t)); + prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*NR_SYMBOLS_PER_SLOT*sizeof(int32_t)); + AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i); + prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(NR_SYMBOLS_PER_SLOT*sizeof(prs_meas_t) ); + AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i); + } } } // DLSCH diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 1290ec9e2a..6afdcfbac4 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -50,16 +50,17 @@ static inline int abs32(int x) } int nr_prs_channel_estimation(uint8_t gNB_id, + uint8_t rsc_id, PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, NR_DL_FRAME_PARMS *frame_params) { int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; uint32_t **nr_gold_prs = ue->nr_gold_prs[proc->nr_slot_rx]; - prs_data_t *prs_cfg = &ue->prs_vars[gNB_id]->prs_cfg; - prs_meas_t **prs_meas = ue->prs_vars[gNB_id]->prs_meas; - int32_t **prs_chestF = ue->prs_vars[gNB_id]->prs_ch_estimates; - int32_t **prs_chestT = ue->prs_vars[gNB_id]->prs_ch_estimates_time; + prs_data_t *prs_cfg = &ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg; + prs_meas_t **prs_meas = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_meas; + int32_t **prs_chestF = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates; + int32_t **prs_chestT = ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_ch_estimates_time; uint8_t rxAnt = 0, idx = prs_cfg->NPRSID; int16_t *rxF, *pil, *fl, *fm, *fmm, *fml, *fmr, *fr, mod_prs[NR_MAX_PRS_LENGTH<<1]; @@ -92,7 +93,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id, } #ifdef DEBUG_PRS_PRINTS - printf("[gNB %d] PRS config l %d k_prime %d:\nprs_cfg->SymbolStart %d\nprs_cfg->NumPRSSymbols %d\nprs_cfg->NumRB %d\nprs_cfg->CombSize %d\n", gNB_id, l, k_prime, prs_cfg->SymbolStart, prs_cfg->NumPRSSymbols, prs_cfg->NumRB, prs_cfg->CombSize); + printf("[gNB %d][rsc %d] PRS config l %d k_prime %d:\nprs_cfg->SymbolStart %d\nprs_cfg->NumPRSSymbols %d\nprs_cfg->NumRB %d\nprs_cfg->CombSize %d\n", gNB_id, rsc_id, l, k_prime, prs_cfg->SymbolStart, prs_cfg->NumPRSSymbols, prs_cfg->NumRB, prs_cfg->CombSize); #endif // Pilots generation and modulation for (int m = 0; m < num_pilots; m++) @@ -483,11 +484,10 @@ int nr_prs_channel_estimation(uint8_t gNB_id, frame_params->ofdm_symbol_size, &prs_meas[rxAnt][l].dl_toa, &ch_pwr); - LOG_I(PHY, "[gNB %d][Rx %d][sfn %d][slot %d] ToA for PRS symbol %2d ==> %d / %d samples, peak channel power %.1f dB\n", gNB_id, rxAnt, proc->frame_rx, proc->nr_slot_rx, l, prs_meas[rxAnt][l].dl_toa-(frame_params->ofdm_symbol_size>>1), frame_params->ofdm_symbol_size, 10*log10(ch_pwr)); + LOG_I(PHY, "[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] ToA for PRS symbol %2d ==> %d / %d samples, peak channel power %.1f dB\n", gNB_id, rsc_id, rxAnt, proc->frame_rx, proc->nr_slot_rx, l, prs_meas[rxAnt][l].dl_toa-(frame_params->ofdm_symbol_size>>1), frame_params->ofdm_symbol_size, 10*log10(ch_pwr)); //prs measurements prs_meas[rxAnt][l].gNB_id = gNB_id; - prs_meas[rxAnt][l].timestamp = 0; //TODO prs_meas[rxAnt][l].sfn = proc->frame_rx; prs_meas[rxAnt][l].slot = proc->nr_slot_rx; prs_meas[rxAnt][l].rxAnt_idx = rxAnt; diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h index 4f26c8e20d..ea0b8c894b 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h @@ -34,6 +34,7 @@ /* A function to perform the channel estimation of DL PRS signal */ int nr_prs_channel_estimation(uint8_t gNB_id, + uint8_t rsc_id, PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, NR_DL_FRAME_PARMS *frame_params); diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h index 565ec895c9..a1fd2ecc09 100644 --- a/openair1/PHY/defs_gNB.h +++ b/openair1/PHY/defs_gNB.h @@ -227,6 +227,11 @@ typedef struct { gNB_PRACH_list_t list[NUMBER_OF_NR_PRACH_MAX]; } NR_gNB_PRACH; +typedef struct { + uint8_t NumPRSResources; + prs_data_t prs_cfg[NR_MAX_PRS_RESOURCES_PER_SET]; +} NR_gNB_PRS; + typedef struct { /// Nfapi ULSCH PDU nfapi_nr_pusch_pdu_t ulsch_pdu; @@ -757,6 +762,7 @@ typedef struct PHY_VARS_gNB_s { nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL]; NR_gNB_COMMON common_vars; NR_gNB_PRACH prach_vars; + NR_gNB_PRS prs_vars; NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX]; NR_gNB_PUCCH_t *pucch[NUMBER_OF_NR_PUCCH_MAX]; NR_gNB_PDCCH_t pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX]; @@ -771,7 +777,6 @@ typedef struct PHY_VARS_gNB_s { NR_gNB_SCH_STATS_t ulsch_stats[NUMBER_OF_NR_SCH_STATS_MAX]; NR_gNB_UCI_STATS_t uci_stats[NUMBER_OF_NR_UCI_STATS_MAX]; t_nrPolar_params *uci_polarParams; - prs_data_t prs_cfg; uint8_t pbch_configured; char gNB_generate_rar; diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index a8082ee147..f9f72b1991 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -389,6 +389,11 @@ typedef struct { int32_t **prs_ch_estimates_time; int32_t reserved; prs_meas_t **prs_meas; +} NR_PRS_RESOURCE_t; + +typedef struct { + uint8_t NumPRSResources; + NR_PRS_RESOURCE_t prs_resource[NR_MAX_PRS_RESOURCES_PER_SET]; } NR_UE_PRS; #define NR_PDCCH_DEFS_NR_UE @@ -832,7 +837,7 @@ typedef struct { NR_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_gNB_MAX]; NR_UE_PRS *prs_vars[NR_MAX_PRS_COMB_SIZE]; - uint16_t prs_active_gNBs; + uint8_t prs_active_gNBs; uint8_t prs_start_symb; uint8_t prs_end_symb; diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index b86811a4c3..23cb14169f 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -84,6 +84,8 @@ #define NR_MAX_PRS_INIT_LENGTH_DWORD 102 // ceil(NR_MAX_CSI_RS_LENGTH/32) #define NR_MAX_NUM_PRS_SYMB 12 #define NR_MAX_PRS_COMB_SIZE 12 +#define NR_MAX_PRS_RESOURCES_PER_SET 64 +#define NR_MAX_PRS_MUTING_PATTERN_LENGTH 32 #define NR_MAX_PUSCH_DMRS_LENGTH NR_MAX_PDSCH_DMRS_LENGTH #define NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD @@ -376,28 +378,26 @@ struct NR_DL_FRAME_PARMS { // PRS structures prototype typedef struct { - uint16_t PRSResourceSetPeriod[2]; //[slot period, slot offset] - uint8_t PRSResourceOffset; // array if more than one resource sets.slot offset (0...511) (default 0) - uint8_t PRSResourceRepetition;// slot offset (1 (default), 2, 4, 6, 8, 16, 32) - uint8_t PRSResourceTimeGap; // slot offset (1 (default), 2, 4, 6, 8, 16, 32) - uint8_t NumRB; //number of RBs in freq domain a scalar =< 275 RB - uint8_t NumPRSSymbols; //number of PRS symbols in time domain - uint8_t SymbolStart; //starting OFDM symbol of PRS resource in time domain - uint8_t RBOffset; //Starting PRB index of all PRS resources in a PRS resource set. - uint8_t CombSize; //RE density of all PRS resources in a PRS resource set. i∈{2,4,6,12} - uint8_t REOffset; //Starting RE offset in the first OFDM symbol of each PRS resource in a PRS resource set. - uint32_t MutingPattern1[2]; //Muting bit pattern option-1, specified as [] or a binary-valued vector of length 2, 4, 6, 8, 16, or 32. - uint32_t MutingPattern2[2]; - uint8_t MutingBitRepetition; - uint16_t NPRSID; -} prs_data_t; //32bytes + uint16_t PRSResourceSetPeriod[2]; // [slot period, slot offset] + uint8_t PRSResourceOffset; // array if more than one resource sets.slot offset (0...511) (default 0) + uint8_t PRSResourceRepetition; // slot offset (1 (default), 2, 4, 6, 8, 16, 32) + uint8_t PRSResourceTimeGap; // slot offset (1 (default), 2, 4, 6, 8, 16, 32) + uint8_t NumRB; // number of RBs in freq domain a scalar =< 275 RB + uint8_t NumPRSSymbols; // number of PRS symbols in time domain + uint8_t SymbolStart; // starting OFDM symbol of PRS resource in time domain + uint8_t RBOffset; // Starting PRB index of all PRS resources in a PRS resource set + uint8_t CombSize; // RE density of all PRS resources in a PRS resource set. i∈{2,4,6,12} + uint8_t REOffset; // Starting RE offset in the first OFDM symbol of each PRS resource in a PRS resource set + uint32_t MutingPattern1[32]; // Muting bit pattern option-1, specified as [] or a binary-valued vector of length 2, 4, 6, 8, 16, or 32 + uint32_t MutingPattern2[32]; // Muting bit pattern option-2, specified as [] or a binary-valued vector of length 2, 4, 6, 8, 16, or 32 + uint8_t MutingBitRepetition; // Muting bit repetition factor, specified as 1, 2, 4, or 8 + uint16_t NPRSID; // Sequence identity of each PRS resource specified as a scalar or a vector of integers in the range [0, 4095] +} prs_data_t; typedef struct { int8_t gNB_id; - int32_t timestamp; int32_t sfn; int8_t slot; - int8_t symbol; int8_t rxAnt_idx; int32_t dl_toa; int32_t dl_aoa; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c107a3a546..05843b21c4 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -67,6 +67,21 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->ssb_table.ssb_offset_point_a.value,sco); } +uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, int nr_slot_tx) +{ + uint8_t is_prs_slot = 0, rsc_id = 0; + for(rsc_id = 0; rsc_id < prs_vars->NumPRSResources; rsc_id++) + { + if((prs_vars->prs_cfg[rsc_id].PRSResourceSetPeriod[1] + prs_vars->prs_cfg[rsc_id].PRSResourceOffset) == nr_slot_tx) + { + is_prs_slot = 1; + *prs_rsc_id = rsc_id; + break; + } + } + return is_prs_slot; +} + void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu) { NR_DL_FRAME_PARMS *fp=&gNB->frame_parms; @@ -100,23 +115,6 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_ else nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); -/* - prs_data_t prs_data; - prs_data.PRSResourceSetPeriod[0]=40; // PRS resource slot period - prs_data.PRSResourceSetPeriod[1]=0; // resource slot offset - prs_data.SymbolStart=7; - prs_data.NumPRSSymbols=4; - prs_data.NumRB=fp->N_RB_DL; - prs_data.RBOffset=0; - prs_data.CombSize=4; - prs_data.REOffset=0; - prs_data.PRSResourceOffset=0; - prs_data.PRSResourceRepetition=1; - prs_data.PRSResourceTimeGap=1; - prs_data.NPRSID=0; -*/ - nr_generate_prs(gNB->nr_gold_prs[slot],&txdataF[0][txdataF_offset], AMP, &gNB->prs_cfg, cfg, fp); - if (T_ACTIVE(T_GNB_PHY_MIB)) { unsigned char bch[3]; @@ -156,6 +154,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; int offset = gNB->CC_id; int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP; + uint8_t rsc_id = 0, is_prs_slot = 0; if ((cfg->cell_config.frame_duplex_type.value == TDD) && (nr_slot_select(cfg,frame,slot) == NR_UPLINK_SLOT)) return; @@ -170,6 +169,14 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, memset(&gNB->common_vars.beam_id[aa][slot*fp->symbols_per_slot],255,fp->symbols_per_slot*sizeof(uint8_t)); } + // Check for PRS slot + is_prs_slot = check_prs_slot_gNB(&rsc_id, &gNB->prs_vars, slot); + if(is_prs_slot) + { + LOG_I(PHY,"gNB_TX: frame %d, slot %d, slots_per_frame %d, PRS Resource ID %d\n",frame,slot, fp->slots_per_frame, rsc_id); + nr_generate_prs(gNB->nr_gold_prs[slot],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); + } + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1); for (int i=0; iLmax; i++) { if (msgTx->ssb[i].active) { diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h index d7e0332b85..4fcdfe2858 100644 --- a/openair1/SCHED_NR/sched_nr.h +++ b/openair1/SCHED_NR/sched_nr.h @@ -54,5 +54,6 @@ void nr_fep_full(RU_t *ru, int slot); void nr_fep_full_2thread(RU_t *ru, int slot); void feptx_prec(RU_t *ru,int frame_tx,int tti_tx); int nr_phy_init_RU(RU_t *ru); +uint8_t check_prs_slot_gNB(uint8_t *prs_rsc_id, NR_gNB_PRS *prs_vars, int nr_slot_tx); #endif diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index b3527365a5..f07dd85c40 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -388,6 +388,7 @@ int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx); int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp); int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp); +uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int nr_slot_rx); /*! \brief This function prepares the dl indication to pass to the MAC @param diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 6114d30652..a112d273b5 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1581,6 +1581,24 @@ int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL } } +uint8_t check_prs_slot_nrUE(PHY_VARS_NR_UE *ue, uint8_t *prs_gNB_id, uint8_t *prs_rsc_id, int nr_slot_rx) +{ + uint8_t is_prs_slot = 0, rsc_id = 0, gNB_id = 0; + for(gNB_id = 0; gNB_id < ue->prs_active_gNBs; gNB_id++) + { + for(rsc_id = 0; rsc_id < ue->prs_vars[gNB_id]->NumPRSResources; rsc_id++) + { + if((ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceSetPeriod[1] + ue->prs_vars[gNB_id]->prs_resource[rsc_id].prs_cfg.PRSResourceOffset) == nr_slot_rx) + { + is_prs_slot = 1; + *prs_rsc_id = rsc_id; + *prs_gNB_id = gNB_id; + return is_prs_slot; + } + } + } + return is_prs_slot; +} int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, @@ -1595,6 +1613,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, int slot_ssb; NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[proc->thread_id][0]; fapi_nr_config_request_t *cfg = &ue->nrUE_config; + uint8_t rsc_id = 0, is_prs_slot = 0, prs_gNB_id = 0; uint8_t nb_symb_pdcch = pdcch_vars->nb_search_space > 0 ? pdcch_vars->pdcch_config[0].coreset.duration : 0; uint8_t dci_cnt = 0; @@ -1659,21 +1678,12 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_ue_rrc_measurements(ue, proc, nr_slot_rx); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PBCH, VCD_FUNCTION_OUT); } + } -/* - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0]=40; // PRS resource slot period - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1]=0; // resource slot offset - ue->prs_vars[gNB_id]->prs_cfg.SymbolStart=7; - ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols=4; - ue->prs_vars[gNB_id]->prs_cfg.NumRB=fp->N_RB_DL; - ue->prs_vars[gNB_id]->prs_cfg.RBOffset=0; - ue->prs_vars[gNB_id]->prs_cfg.CombSize=4; - ue->prs_vars[gNB_id]->prs_cfg.REOffset=0; - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset=0; - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition=1; - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap=1; - ue->prs_vars[gNB_id]->prs_cfg.NPRSID=0; -*/ + // Check for PRS slot + is_prs_slot = check_prs_slot_nrUE(ue, &prs_gNB_id, &rsc_id, nr_slot_rx); + if (is_prs_slot) + { for(int j = ue->prs_start_symb; j < ue->prs_end_symb; j++) { nr_slot_fep(ue, @@ -1683,8 +1693,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, } //PRS channel estimation - for(int gIdx = 0; gIdx < ue->prs_active_gNBs; gIdx++) - nr_prs_channel_estimation(gIdx,ue,proc,fp); + //for(int gIdx = 0; gIdx < ue->prs_active_gNBs; gIdx++) + { + nr_prs_channel_estimation(prs_gNB_id,rsc_id,ue,proc,fp); + } } if ((frame_rx%64 == 0) && (nr_slot_rx==0)) { diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 4d1bb245fc..b8ea49b0ca 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -605,7 +605,7 @@ void RCconfig_nr_flexran() void RCconfig_nr_prs(void) { - uint16_t j; + uint16_t j = 0, k = 0; paramdef_t PRS_Params[] = PRS_PARAMS_DESC; paramlist_def_t PRS_ParamList = {CONFIG_STRING_PRS_CONFIG,NULL,0}; @@ -619,7 +619,6 @@ void RCconfig_nr_prs(void) config_getlist( &PRS_ParamList,PRS_Params,sizeof(PRS_Params)/sizeof(paramdef_t), NULL); if (PRS_ParamList.numelt > 0) { - for (j = 0; j < RC.nb_nr_L1_inst; j++) { if (RC.gNB[j] == NULL) { @@ -629,35 +628,72 @@ void RCconfig_nr_prs(void) RC.gNB[j]->Mod_id = j; } - RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[0] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD0].uptr); - RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[1] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD1].uptr); - RC.gNB[j]->prs_cfg.SymbolStart = *(PRS_ParamList.paramarray[j][PRS_SYMBOL_START].uptr); - RC.gNB[j]->prs_cfg.NumPRSSymbols = *(PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS].uptr); - RC.gNB[j]->prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr); - RC.gNB[j]->prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr); - RC.gNB[j]->prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr); - RC.gNB[j]->prs_cfg.REOffset = *(PRS_ParamList.paramarray[j][PRS_RE_OFFSET].uptr); - RC.gNB[j]->prs_cfg.PRSResourceOffset = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET].uptr); - RC.gNB[j]->prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); - RC.gNB[j]->prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); - RC.gNB[j]->prs_cfg.NPRSID = *(PRS_ParamList.paramarray[j][PRS_ID].uptr); + RC.gNB[j]->prs_vars.NumPRSResources = *(PRS_ParamList.paramarray[j][NUM_PRS_RESOURCES].uptr); + for (k = 0; k < RC.gNB[j]->prs_vars.NumPRSResources; k++) + { + RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceSetPeriod[0] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[0]; + RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceSetPeriod[1] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[1]; + // per PRS resources parameters + RC.gNB[j]->prs_vars.prs_cfg[k].SymbolStart = PRS_ParamList.paramarray[j][PRS_SYMBOL_START_LIST].uptr[k]; + RC.gNB[j]->prs_vars.prs_cfg[k].NumPRSSymbols = PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS_LIST].uptr[k]; + RC.gNB[j]->prs_vars.prs_cfg[k].REOffset = PRS_ParamList.paramarray[j][PRS_RE_OFFSET_LIST].uptr[k]; + RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceOffset = PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET_LIST].uptr[k]; + RC.gNB[j]->prs_vars.prs_cfg[k].NPRSID = PRS_ParamList.paramarray[j][PRS_ID_LIST].uptr[k]; + // Common parameters to all PRS resources + RC.gNB[j]->prs_vars.prs_cfg[k].NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr); + RC.gNB[j]->prs_vars.prs_cfg[k].RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr); + RC.gNB[j]->prs_vars.prs_cfg[k].CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr); + RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); + RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); + RC.gNB[j]->prs_vars.prs_cfg[k].MutingBitRepetition = *(PRS_ParamList.paramarray[j][PRS_MUTING_BIT_REPETITION].uptr); + for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++) + RC.gNB[j]->prs_vars.prs_cfg[k].MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l]; + for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++) + RC.gNB[j]->prs_vars.prs_cfg[k].MutingPattern2[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].uptr[l]; - LOG_I(PHY, "--------------------------\n"); - LOG_I(PHY, "PRS Config for gNB_ID %d\n", j); - LOG_I(PHY, "--------------------------\n"); - LOG_I(PHY, "PRSResourceSetPeriod0 %d\n", RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[0]); - LOG_I(PHY, "PRSResourceSetPeriod1 %d\n", RC.gNB[j]->prs_cfg.PRSResourceSetPeriod[1]); - LOG_I(PHY, "SymbolStart %d\n", RC.gNB[j]->prs_cfg.SymbolStart); - LOG_I(PHY, "NumPRSSymbols %d\n", RC.gNB[j]->prs_cfg.NumPRSSymbols); - LOG_I(PHY, "NumRB %d\n", RC.gNB[j]->prs_cfg.NumRB); - LOG_I(PHY, "RBOffset %d\n", RC.gNB[j]->prs_cfg.RBOffset); - LOG_I(PHY, "CombSize %d\n", RC.gNB[j]->prs_cfg.CombSize); - LOG_I(PHY, "REOffset %d\n", RC.gNB[j]->prs_cfg.REOffset); - LOG_I(PHY, "PRSResourceOffset %d\n", RC.gNB[j]->prs_cfg.PRSResourceOffset); - LOG_I(PHY, "PRSResourceRepetition %d\n", RC.gNB[j]->prs_cfg.PRSResourceRepetition); - LOG_I(PHY, "PRSResourceTimeGap %d\n", RC.gNB[j]->prs_cfg.PRSResourceTimeGap); - LOG_I(PHY, "NPRS_ID %d\n", RC.gNB[j]->prs_cfg.NPRSID); - LOG_I(PHY, "--------------------------\n"); + } // for k + + k = 0; + LOG_I(PHY, "-----------------------------------------\n"); + LOG_I(PHY, "PRS Config for gNB_id %d @ %p\n", j, &RC.gNB[j]->prs_vars.prs_cfg[k]); + LOG_I(PHY, "-----------------------------------------\n"); + LOG_I(PHY, "NumPRSResources \t%d\n", RC.gNB[j]->prs_vars.NumPRSResources); + LOG_I(PHY, "PRSResourceSetPeriod \t[%d, %d]\n", RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceSetPeriod[0], RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceSetPeriod[1]); + LOG_I(PHY, "NumRB \t\t\t%d\n", RC.gNB[j]->prs_vars.prs_cfg[k].NumRB); + LOG_I(PHY, "RBOffset \t\t%d\n", RC.gNB[j]->prs_vars.prs_cfg[k].RBOffset); + LOG_I(PHY, "CombSize \t\t%d\n", RC.gNB[j]->prs_vars.prs_cfg[k].CombSize); + LOG_I(PHY, "PRSResourceRepetition \t%d\n", RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceRepetition); + LOG_I(PHY, "PRSResourceTimeGap \t%d\n", RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceTimeGap); + LOG_I(PHY, "MutingBitRepetition \t%d\n", RC.gNB[j]->prs_vars.prs_cfg[k].MutingBitRepetition); + LOG_I(PHY, "SymbolStart \t\t["); + for (k = 0; k < RC.gNB[j]->prs_vars.NumPRSResources; k++) + printf("%d, ", RC.gNB[j]->prs_vars.prs_cfg[k].SymbolStart); + printf("\b\b]\n"); + LOG_I(PHY, "NumPRSSymbols \t\t["); + for (k = 0; k < RC.gNB[j]->prs_vars.NumPRSResources; k++) + printf("%d, ", RC.gNB[j]->prs_vars.prs_cfg[k].NumPRSSymbols); + printf("\b\b]\n"); + LOG_I(PHY, "REOffset \t\t["); + for (k = 0; k < RC.gNB[j]->prs_vars.NumPRSResources; k++) + printf("%d, ", RC.gNB[j]->prs_vars.prs_cfg[k].REOffset); + printf("\b\b]\n"); + LOG_I(PHY, "PRSResourceOffset \t["); + for (k = 0; k < RC.gNB[j]->prs_vars.NumPRSResources; k++) + printf("%d, ", RC.gNB[j]->prs_vars.prs_cfg[k].PRSResourceOffset); + printf("\b\b]\n"); + LOG_I(PHY, "NPRS_ID \t\t["); + for (k = 0; k < RC.gNB[j]->prs_vars.NumPRSResources; k++) + printf("%d, ", RC.gNB[j]->prs_vars.prs_cfg[k].NPRSID); + printf("\b\b]\n"); + LOG_I(PHY, "MutingPattern1 \t\t["); + for (int l = 0, k = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++) + printf("%d, ", RC.gNB[j]->prs_vars.prs_cfg[k].MutingPattern1[l]); + printf("\b\b]\n"); + LOG_I(PHY, "MutingPattern2 \t\t["); + for (int l = 0, k = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++) + printf("%d, ", RC.gNB[j]->prs_vars.prs_cfg[k].MutingPattern2[l]); + printf("\b\b]\n"); + LOG_I(PHY, "-----------------------------------------\n"); } // for j } else diff --git a/openair2/GNB_APP/prs_nr_paramdef.h b/openair2/GNB_APP/prs_nr_paramdef.h index 5144f3c95f..0de2d36916 100644 --- a/openair2/GNB_APP/prs_nr_paramdef.h +++ b/openair2/GNB_APP/prs_nr_paramdef.h @@ -38,6 +38,7 @@ /* PRS configuration section names */ #define CONFIG_STRING_PRS_LIST "PRSs" #define CONFIG_STRING_PRS_CONFIG "prs_config" +#define CONFIG_STRING_MQTT_CONFIG "mqtt_config" /* Global parameters */ @@ -55,18 +56,21 @@ /* PRS configuration parameters names */ #define CONFIG_STRING_GNB_ID "gNB_id" -#define CONFIG_STRING_PRS_RESOURCE_SET_PERIOD0 "PRSResourceSetPeriod0" -#define CONFIG_STRING_PRS_RESOURCE_SET_PERIOD1 "PRSResourceSetPeriod1" -#define CONFIG_STRING_PRS_SYMBOL_START "SymbolStart" -#define CONFIG_STRING_PRS_NUM_SYMBOLS "NumPRSSymbols" +#define CONFIG_STRING_NUM_PRS_RESOURCES "NumPRSResources" +#define CONFIG_STRING_PRS_RESOURCE_SET_PERIOD_LIST "PRSResourceSetPeriod" +#define CONFIG_STRING_PRS_SYMBOL_START_LIST "SymbolStart" +#define CONFIG_STRING_PRS_NUM_SYMBOLS_LIST "NumPRSSymbols" #define CONFIG_STRING_PRS_NUM_RB "NumRB" #define CONFIG_STRING_PRS_RB_OFFSET "RBOffset" #define CONFIG_STRING_PRS_COMB_SIZE "CombSize" -#define CONFIG_STRING_PRS_RE_OFFSET "REOffset" -#define CONFIG_STRING_PRS_RESOURCE_OFFSET "PRSResourceOffset" +#define CONFIG_STRING_PRS_RE_OFFSET_LIST "REOffset" +#define CONFIG_STRING_PRS_RESOURCE_OFFSET_LIST "PRSResourceOffset" #define CONFIG_STRING_PRS_RESOURCE_REPETITION "PRSResourceRepetition" #define CONFIG_STRING_PRS_RESOURCE_TIME_GAP "PRSResourceTimeGap" -#define CONFIG_STRING_PRS_ID "NPRS_ID" +#define CONFIG_STRING_PRS_ID_LIST "NPRS_ID" +#define CONFIG_STRING_PRS_MUTING_PATTERN1_LIST "MutingPattern1" +#define CONFIG_STRING_PRS_MUTING_PATTERN2_LIST "MutingPattern2" +#define CONFIG_STRING_PRS_MUTING_BIT_REPETITION "MutingBitRepetition" /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ @@ -74,34 +78,40 @@ /* optname helpstr paramflags XXXptr defXXXval type numelt */ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ #define PRS_PARAMS_DESC { \ -{CONFIG_STRING_GNB_ID, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_SET_PERIOD0, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_SET_PERIOD1, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_SYMBOL_START, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_NUM_SYMBOLS, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_NUM_RB, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RB_OFFSET, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_COMB_SIZE, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RE_OFFSET, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_OFFSET, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_REPETITION, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_RESOURCE_TIME_GAP, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ -{CONFIG_STRING_PRS_ID, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0} \ +{CONFIG_STRING_GNB_ID, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_NUM_PRS_RESOURCES, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_SET_PERIOD_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_SYMBOL_START_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_NUM_SYMBOLS_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_NUM_RB, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RB_OFFSET, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_COMB_SIZE, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RE_OFFSET_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_OFFSET_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_REPETITION, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_RESOURCE_TIME_GAP, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \ +{CONFIG_STRING_PRS_ID_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_MUTING_PATTERN1_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_MUTING_PATTERN2_LIST, NULL, 0, uptr:NULL, defintarrayval:0, TYPE_UINTARRAY, 0}, \ +{CONFIG_STRING_PRS_MUTING_BIT_REPETITION, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0} \ } #define PRS_GNB_ID 0 -#define PRS_RESOURCE_SET_PERIOD0 1 -#define PRS_RESOURCE_SET_PERIOD1 2 -#define PRS_SYMBOL_START 3 -#define PRS_NUM_SYMBOLS 4 +#define NUM_PRS_RESOURCES 1 +#define PRS_RESOURCE_SET_PERIOD_LIST 2 +#define PRS_SYMBOL_START_LIST 3 +#define PRS_NUM_SYMBOLS_LIST 4 #define PRS_NUM_RB 5 #define PRS_RB_OFFSET 6 #define PRS_COMB_SIZE 7 -#define PRS_RE_OFFSET 8 -#define PRS_RESOURCE_OFFSET 9 +#define PRS_RE_OFFSET_LIST 8 +#define PRS_RESOURCE_OFFSET_LIST 9 #define PRS_RESOURCE_REPETITION 10 #define PRS_RESOURCE_TIME_GAP 11 -#define PRS_ID 12 +#define PRS_ID_LIST 12 +#define PRS_MUTING_PATTERN1_LIST 13 +#define PRS_MUTING_PATTERN2_LIST 14 +#define PRS_MUTING_BIT_REPETITION 15 /*----------------------------------------------------------------------------------------------------------------------------------------------------*/ #endif diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index e7b6d4e514..e60e6a74f2 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -1278,7 +1278,7 @@ void RCconfig_nr_ue_L1(void) { void RCconfig_nrUE_prs(void *cfg) { - int j = 0, gNB_id = 0, prs_start = 0, prs_end = 0; + int j = 0, k = 0, gNB_id = 0, prs_start = 0, prs_end = 0; char aprefix[MAX_OPTNAME_SIZE*2 + 8]; PHY_VARS_NR_UE *ue = (PHY_VARS_NR_UE *)cfg; @@ -1298,45 +1298,86 @@ void RCconfig_nrUE_prs(void *cfg) if (PRS_ParamList.numelt > 0) { for (j = 0; j < PRS_ParamList.numelt; j++) { - gNB_id = *(PRS_ParamList.paramarray[j][PRS_GNB_ID].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD0].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1] = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD1].uptr); - ue->prs_vars[gNB_id]->prs_cfg.SymbolStart = *(PRS_ParamList.paramarray[j][PRS_SYMBOL_START].uptr); - ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols = *(PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS].uptr); - ue->prs_vars[gNB_id]->prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr); - ue->prs_vars[gNB_id]->prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr); - ue->prs_vars[gNB_id]->prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr); - ue->prs_vars[gNB_id]->prs_cfg.REOffset = *(PRS_ParamList.paramarray[j][PRS_RE_OFFSET].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); - ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); - ue->prs_vars[gNB_id]->prs_cfg.NPRSID = *(PRS_ParamList.paramarray[j][PRS_ID].uptr); - if(gNB_id==0) + gNB_id = *(PRS_ParamList.paramarray[j][PRS_GNB_ID].uptr); + if(gNB_id != i) gNB_id = i; // force gNB_id to avoid mismatch + + ue->prs_vars[gNB_id]->NumPRSResources = *(PRS_ParamList.paramarray[j][NUM_PRS_RESOURCES].uptr); + for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++) { - prs_start = ue->prs_vars[gNB_id]->prs_cfg.SymbolStart; - prs_end = ue->prs_vars[gNB_id]->prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols; - } - else - { - prs_start = MIN((prs_start), (ue->prs_vars[gNB_id]->prs_cfg.SymbolStart)); - prs_end = MAX((prs_end), (ue->prs_vars[gNB_id]->prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols)); - } - LOG_I(PHY, "--------------------------\n"); - LOG_I(PHY, "PRS Config for gNB_id %d @ %p\n", gNB_id, &ue->prs_vars[gNB_id]->prs_cfg); - LOG_I(PHY, "--------------------------\n"); - LOG_I(PHY, "PRSResourceSetPeriod0 %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[0]); - LOG_I(PHY, "PRSResourceSetPeriod1 %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceSetPeriod[1]); - LOG_I(PHY, "SymbolStart %d\n", ue->prs_vars[gNB_id]->prs_cfg.SymbolStart); - LOG_I(PHY, "NumPRSSymbols %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumPRSSymbols); - LOG_I(PHY, "NumRB %d\n", ue->prs_vars[gNB_id]->prs_cfg.NumRB); - LOG_I(PHY, "RBOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.RBOffset); - LOG_I(PHY, "CombSize %d\n", ue->prs_vars[gNB_id]->prs_cfg.CombSize); - LOG_I(PHY, "REOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.REOffset); - LOG_I(PHY, "PRSResourceOffset %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceOffset); - LOG_I(PHY, "PRSResourceRepetition %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceRepetition); - LOG_I(PHY, "PRSResourceTimeGap %d\n", ue->prs_vars[gNB_id]->prs_cfg.PRSResourceTimeGap); - LOG_I(PHY, "NPRS_ID %d\n", ue->prs_vars[gNB_id]->prs_cfg.NPRSID); - LOG_I(PHY, "--------------------------\n"); + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[0] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[0]; + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[1] = PRS_ParamList.paramarray[j][PRS_RESOURCE_SET_PERIOD_LIST].uptr[1]; + // per PRS resources parameters + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart = PRS_ParamList.paramarray[j][PRS_SYMBOL_START_LIST].uptr[k]; + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols = PRS_ParamList.paramarray[j][PRS_NUM_SYMBOLS_LIST].uptr[k]; + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.REOffset = PRS_ParamList.paramarray[j][PRS_RE_OFFSET_LIST].uptr[k]; + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NPRSID = PRS_ParamList.paramarray[j][PRS_ID_LIST].uptr[k]; + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceOffset = PRS_ParamList.paramarray[j][PRS_RESOURCE_OFFSET_LIST].uptr[k]; + // Common parameters to all PRS resources + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumRB = *(PRS_ParamList.paramarray[j][PRS_NUM_RB].uptr); + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.RBOffset = *(PRS_ParamList.paramarray[j][PRS_RB_OFFSET].uptr); + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.CombSize = *(PRS_ParamList.paramarray[j][PRS_COMB_SIZE].uptr); + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceRepetition = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_REPETITION].uptr); + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceTimeGap = *(PRS_ParamList.paramarray[j][PRS_RESOURCE_TIME_GAP].uptr); + + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingBitRepetition = *(PRS_ParamList.paramarray[j][PRS_MUTING_BIT_REPETITION].uptr); + for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++) + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l]; + for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++) + ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern2[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].uptr[l]; + + if(gNB_id==0 && k==0) + { + prs_start = ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart; + prs_end = (ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols)%NR_SYMBOLS_PER_SLOT; + } + else + { + prs_start = MIN((prs_start), (ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart)); + prs_end = MAX((prs_end), (ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart+ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols)%NR_SYMBOLS_PER_SLOT); + } + } // for k + + k = 0; + LOG_I(PHY, "-----------------------------------------\n"); + LOG_I(PHY, "PRS Config for gNB_id %d @ %p\n", gNB_id, &ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg); + LOG_I(PHY, "-----------------------------------------\n"); + LOG_I(PHY, "NumPRSResources \t%d\n", ue->prs_vars[gNB_id]->NumPRSResources); + LOG_I(PHY, "PRSResourceSetPeriod \t[%d, %d]\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[0], ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceSetPeriod[1]); + LOG_I(PHY, "NumRB \t\t\t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumRB); + LOG_I(PHY, "RBOffset \t\t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.RBOffset); + LOG_I(PHY, "CombSize \t\t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.CombSize); + LOG_I(PHY, "PRSResourceRepetition \t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceRepetition); + LOG_I(PHY, "PRSResourceTimeGap \t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceTimeGap); + LOG_I(PHY, "MutingBitRepetition \t%d\n", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingBitRepetition); + LOG_I(PHY, "SymbolStart \t\t["); + for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++) + printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.SymbolStart); + printf("\b\b]\n"); + LOG_I(PHY, "NumPRSSymbols \t\t["); + for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++) + printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NumPRSSymbols); + printf("\b\b]\n"); + LOG_I(PHY, "REOffset \t\t["); + for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++) + printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.REOffset); + printf("\b\b]\n"); + LOG_I(PHY, "PRSResourceOffset \t["); + for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++) + printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.PRSResourceOffset); + printf("\b\b]\n"); + LOG_I(PHY, "NPRS_ID \t\t["); + for (k = 0; k < ue->prs_vars[gNB_id]->NumPRSResources; k++) + printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.NPRSID); + printf("\b\b]\n"); + LOG_I(PHY, "MutingPattern1 \t\t["); + for (int l = 0, k = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++) + printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern1[l]); + printf("\b\b]\n"); + LOG_I(PHY, "MutingPattern2 \t\t["); + for (int l = 0, k = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++) + printf("%d, ", ue->prs_vars[gNB_id]->prs_resource[k].prs_cfg.MutingPattern2[l]); + printf("\b\b]\n"); + LOG_I(PHY, "-----------------------------------------\n"); } } else @@ -1347,4 +1388,5 @@ void RCconfig_nrUE_prs(void *cfg) ue->prs_start_symb = prs_start; ue->prs_end_symb = prs_end; LOG_I(PHY, "prs_active_gNBs %d, prs_start_symb %d, prs_end_symb %d\n", ue->prs_active_gNBs, ue->prs_start_symb, ue->prs_end_symb); + AssertFatal(prs_start <= prs_end, "Invalid PRS symbol allocation, please check the start and end symbols\n"); } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf index 068d4291c3..482ff07163 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf @@ -217,18 +217,21 @@ MACRLCs = ( prs_config = ( { - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; - NumRB = 106; - RBOffset = 0; - CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; - PRSResourceRepetition = 1; - PRSResourceTimeGap = 1; - NPRS_ID = 0; + NumPRSResources = 2; + PRSResourceSetPeriod = [20, 5]; + SymbolStart = [7, 8]; + NumPRSSymbols = [5, 5]; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = [0, 1]; + PRSResourceOffset = [0, 1]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [0, 5]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf index ada5d4fd57..8df47984d8 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf @@ -1,22 +1,25 @@ PRSs = ( { - Active_gNBs = 2; + Active_gNBs = 1; prs_config0 = ( { gNB_id = 0; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; + NumPRSResources = 2; + PRSResourceSetPeriod = [20, 5]; + SymbolStart = [7, 8]; + NumPRSSymbols = [5, 5]; NumRB = 106; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0, 1]; + PRSResourceOffset = [0, 1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0, 5]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); @@ -35,6 +38,9 @@ PRSs = PRSResourceRepetition = 1; PRSResourceTimeGap = 1; NPRS_ID = 0; + MutingPattern1 = [0]; + MutingPattern2 = [0]; + MutingBitRepetition = 1; } ); } From 9af7987e75420335997d2c18c7c921aabadcae6a Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Sat, 7 May 2022 12:48:08 +0200 Subject: [PATCH 2/8] OAI UE: Cleaned up PRS buffer handling --- openair1/PHY/INIT/nr_init_ue.c | 6 +-- .../nr_dl_channel_estimation.c | 42 +++++++++---------- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 6 +-- .../GENERIC-NR-5GC/CONF/ue_nr_prs.conf | 18 ++++---- 4 files changed, 34 insertions(+), 38 deletions(-) diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 43bc62adf0..d75c845227 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -338,10 +338,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas!=NULL), "NR UE init: PRS measurements malloc failed for gNB_id %d\n", idx); for (i=0; inb_antennas_rx; i++) { - prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*NR_SYMBOLS_PER_SLOT*sizeof(int32_t)); - prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*NR_SYMBOLS_PER_SLOT*sizeof(int32_t)); + prs_vars[idx]->prs_resource[k].prs_ch_estimates[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); + prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t)); AssertFatal(((prs_vars[idx]->prs_resource[k].prs_ch_estimates[i]!=NULL) || (prs_vars[idx]->prs_resource[k].prs_ch_estimates_time[i]!=NULL)), "NR UE init: PRS channel estimates malloc failed for rx_ant %d\n", i); - prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(NR_SYMBOLS_PER_SLOT*sizeof(prs_meas_t) ); + prs_vars[idx]->prs_resource[k].prs_meas[i] = (prs_meas_t *)malloc16_clear(sizeof(prs_meas_t) ); AssertFatal((prs_vars[idx]->prs_resource[k].prs_meas[i]!=NULL), "NR UE init: PRS measurements malloc failed for rx_ant %d\n", i); } } diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c index 6afdcfbac4..215e1fdc2e 100644 --- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c +++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c @@ -240,7 +240,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id, #endif // average out the SNR computed snr = snr/num_pilots; - prs_meas[rxAnt][l].snr = snr; + prs_meas[rxAnt]->snr = snr; } else if(prs_cfg->CombSize == 4) { @@ -384,7 +384,7 @@ int nr_prs_channel_estimation(uint8_t gNB_id, #endif // average out the SNR computed snr = snr/num_pilots; - prs_meas[rxAnt][l].snr = snr; + prs_meas[rxAnt]->snr = snr; } else { @@ -396,7 +396,6 @@ int nr_prs_channel_estimation(uint8_t gNB_id, } // for rxAnt } //for l - int16_t l = 0; //symbIdx for (rxAnt=0; rxAnt < frame_params->nb_antennas_rx; rxAnt++) { // scale by averaging factor 1/NumPrsSymbols @@ -423,9 +422,9 @@ int nr_prs_channel_estimation(uint8_t gNB_id, first_half = frame_params->ofdm_symbol_size - re_offset; second_half = (prs_cfg->NumRB*12) - first_half; if(first_half > 0) - memcpy((int16_t *)&prs_chestF[rxAnt][l*frame_params->ofdm_symbol_size+re_offset], &ch_tmp[0], first_half*sizeof(int32_t)); + memcpy((int16_t *)&prs_chestF[rxAnt][re_offset], &ch_tmp[0], first_half*sizeof(int32_t)); if(second_half > 0) - memcpy((int16_t *)&prs_chestF[rxAnt][l*frame_params->ofdm_symbol_size], &ch_tmp[(frame_params->ofdm_symbol_size - re_offset)<<1], second_half*sizeof(int32_t)); + memcpy((int16_t *)&prs_chestF[rxAnt][0], &ch_tmp[(first_half<<1)], second_half*sizeof(int32_t)); // Time domain IMPULSE response idft_size_idx_t idftsizeidx; @@ -472,39 +471,40 @@ int nr_prs_channel_estimation(uint8_t gNB_id, } idft(idftsizeidx, - (int16_t *)&prs_chestF[rxAnt][l*frame_params->ofdm_symbol_size], + (int16_t *)&prs_chestF[rxAnt][0], (int16_t *)&ch_tmp[0],1); // rearrange impulse response - memcpy((int16_t *)&prs_chestT[rxAnt][l*frame_params->ofdm_symbol_size], &ch_tmp[frame_params->ofdm_symbol_size], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); - memcpy((int16_t *)&prs_chestT[rxAnt][l*frame_params->ofdm_symbol_size + (frame_params->ofdm_symbol_size>>1)], &ch_tmp[0], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); + memcpy((int16_t *)&prs_chestT[rxAnt][0], &ch_tmp[frame_params->ofdm_symbol_size], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); + memcpy((int16_t *)&prs_chestT[rxAnt][(frame_params->ofdm_symbol_size>>1)], &ch_tmp[0], (frame_params->ofdm_symbol_size>>1)*sizeof(int32_t)); // peak estimator - peak_estimator(&prs_chestT[rxAnt][l*frame_params->ofdm_symbol_size], + peak_estimator(&prs_chestT[rxAnt][0], frame_params->ofdm_symbol_size, - &prs_meas[rxAnt][l].dl_toa, + &prs_meas[rxAnt]->dl_toa, &ch_pwr); - LOG_I(PHY, "[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] ToA for PRS symbol %2d ==> %d / %d samples, peak channel power %.1f dB\n", gNB_id, rsc_id, rxAnt, proc->frame_rx, proc->nr_slot_rx, l, prs_meas[rxAnt][l].dl_toa-(frame_params->ofdm_symbol_size>>1), frame_params->ofdm_symbol_size, 10*log10(ch_pwr)); //prs measurements - prs_meas[rxAnt][l].gNB_id = gNB_id; - prs_meas[rxAnt][l].sfn = proc->frame_rx; - prs_meas[rxAnt][l].slot = proc->nr_slot_rx; - prs_meas[rxAnt][l].rxAnt_idx = rxAnt; - prs_meas[rxAnt][l].dl_aoa = 0; + prs_meas[rxAnt]->dl_toa -= (frame_params->ofdm_symbol_size>>1); + prs_meas[rxAnt]->gNB_id = gNB_id; + prs_meas[rxAnt]->sfn = proc->frame_rx; + prs_meas[rxAnt]->slot = proc->nr_slot_rx; + prs_meas[rxAnt]->rxAnt_idx = rxAnt; + prs_meas[rxAnt]->dl_aoa = 0; + LOG_I(PHY, "[gNB %d][rsc %d][Rx %d][sfn %d][slot %d] DL PRS ToA ==> %d / %d samples, peak channel power %.1f dB, SNR %+2d dB\n", gNB_id, rsc_id, rxAnt, proc->frame_rx, proc->nr_slot_rx, prs_meas[rxAnt]->dl_toa, frame_params->ofdm_symbol_size, 10*log10(ch_pwr), prs_meas[rxAnt]->snr); #ifdef DEBUG_PRS_CHEST sprintf(filename, "%s%i%s", "PRSpilot_", rxAnt, ".m"); LOG_M(filename, "prs_loc", &mod_prs[0], prs_cfg->NumRB*(12/prs_cfg->CombSize),1,1); sprintf(filename, "%s%i%s", "rxSigF_", rxAnt, ".m"); sprintf(varname, "%s%i", "rxF_", rxAnt); - LOG_M(filename, varname, &rxdataF[rxAnt][prs_cfg->SymbolStart*frame_params->ofdm_symbol_size], prs_cfg->NumPRSSymbols*frame_params->ofdm_symbol_size,1,1); + LOG_M(filename, varname, &rxdataF[rxAnt][0], prs_cfg->NumPRSSymbols*frame_params->ofdm_symbol_size,1,1); sprintf(filename, "%s%i%s", "prsChestF_", rxAnt, ".m"); sprintf(varname, "%s%i", "prsChF_", rxAnt); - LOG_M(filename, varname, &prs_chestF[rxAnt][l*frame_params->ofdm_symbol_size], frame_params->ofdm_symbol_size,1,1); + LOG_M(filename, varname, &prs_chestF[rxAnt][0], frame_params->ofdm_symbol_size,1,1); sprintf(filename, "%s%i%s", "prsChestT_", rxAnt, ".m"); sprintf(varname, "%s%i", "prsChT_", rxAnt); - LOG_M(filename, varname, &prs_chestT[rxAnt][l*frame_params->ofdm_symbol_size], frame_params->ofdm_symbol_size,1,1); + LOG_M(filename, varname, &prs_chestT[rxAnt][0], frame_params->ofdm_symbol_size,1,1); #endif // T tracer dump @@ -514,11 +514,11 @@ int nr_prs_channel_estimation(uint8_t gNB_id, T(T_UE_PHY_DL_CHANNEL_ESTIMATE_FREQ, T_INT(gNB_id), T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), - T_INT(rxAnt), T_BUFFER(&prs_chestF[rxAnt][l*frame_params->ofdm_symbol_size], prs_cfg->NumPRSSymbols*frame_params->ofdm_symbol_size*sizeof(int32_t))); + T_INT(rxAnt), T_BUFFER(&prs_chestF[rxAnt][0], frame_params->ofdm_symbol_size*sizeof(int32_t))); T(T_UE_PHY_DL_CHANNEL_ESTIMATE, T_INT(gNB_id), T_INT(proc->frame_rx), T_INT(proc->nr_slot_rx), - T_INT(rxAnt), T_BUFFER(&prs_chestT[rxAnt][l*frame_params->ofdm_symbol_size], prs_cfg->NumPRSSymbols*frame_params->ofdm_symbol_size*sizeof(int32_t))); + T_INT(rxAnt), T_BUFFER(&prs_chestT[rxAnt][0], frame_params->ofdm_symbol_size*sizeof(int32_t))); } free(ch_tmp); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index a112d273b5..4e472318a9 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -1692,11 +1692,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, nr_slot_rx); } - //PRS channel estimation - //for(int gIdx = 0; gIdx < ue->prs_active_gNBs; gIdx++) - { - nr_prs_channel_estimation(prs_gNB_id,rsc_id,ue,proc,fp); - } + nr_prs_channel_estimation(prs_gNB_id,rsc_id,ue,proc,fp); } if ((frame_rx%64 == 0) && (nr_slot_rx==0)) { diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf index 8df47984d8..044f5c6feb 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue_nr_prs.conf @@ -26,20 +26,20 @@ PRSs = prs_config1 = ( { gNB_id = 1; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; + NumPRSResources = 1; + PRSResourceSetPeriod = [20, 5]; + SymbolStart = [8]; + NumPRSSymbols = [5]; NumRB = 106; RBOffset = 0; CombSize = 4; - REOffset = 1; - PRSResourceOffset = 0; + REOffset = [1]; + PRSResourceOffset = [1]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; - MutingPattern1 = [0]; - MutingPattern2 = [0]; + NPRS_ID = [5]; + MutingPattern1 = []; + MutingPattern2 = []; MutingBitRepetition = 1; } ); From 9418fa84ce9d3def9b2182fc3dd19c1447089ced Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Sat, 7 May 2022 14:12:47 +0200 Subject: [PATCH 3/8] updated FR1 and FR2 PRS config files --- ...nb.sa.band257.fr2.128PRB.prs.usrpx310.conf | 17 ++++--- ...gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf | 17 ++++--- ...gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf | 17 ++++--- ...gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf | 17 ++++--- .../CONF/ue.nr.prs.fr1.106prb.conf | 34 ++++++++------ .../CONF/ue.nr.prs.fr1.217prb.conf | 36 ++++++++------ .../CONF/ue.nr.prs.fr2.128prb.conf | 36 ++++++++------ .../CONF/ue.nr.prs.fr2.64prb.conf | 47 +++++++++++++++++++ .../CONF/ue.nr.prs.fr2.66prb.conf | 41 ---------------- 9 files changed, 149 insertions(+), 113 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf delete mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.66prb.conf diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf index 1aa33fb52c..10f77dcef5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.128PRB.prs.usrpx310.conf @@ -216,18 +216,21 @@ MACRLCs = ( prs_config = ( { - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 128; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf index 9f00f6b787..56bbc23ef0 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band257.fr2.64PRB.prs.usrpx310.conf @@ -216,18 +216,21 @@ MACRLCs = ( prs_config = ( { - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 64; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf index 228b718bc6..c0912cd19d 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.prs.usrpn310.conf @@ -217,18 +217,21 @@ MACRLCs = ( prs_config = ( { - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 106; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf index 4b5052f2d3..c0642afba5 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.217PRB.prs.usrpx310.conf @@ -217,18 +217,21 @@ MACRLCs = ( prs_config = ( { - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 216; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf index 38714e546e..04912424f2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf @@ -5,36 +5,42 @@ PRSs = prs_config0 = ( { gNB_id = 0; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 106; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); prs_config1 = ( { gNB_id = 1; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 106; RBOffset = 0; CombSize = 4; - REOffset = 1; - PRSResourceOffset = 0; + REOffset = [1]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf index e84aac5b6a..3c76026015 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.217prb.conf @@ -5,36 +5,42 @@ PRSs = prs_config0 = ( { gNB_id = 0; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 216; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); prs_config1 = ( { gNB_id = 1; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; - NumRB = 106; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [4]; + NumRB = 216; RBOffset = 0; CombSize = 4; - REOffset = 1; - PRSResourceOffset = 0; + REOffset = [1]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [5]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf index 27f30359b6..8619eca5f4 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.128prb.conf @@ -5,36 +5,42 @@ PRSs = prs_config0 = ( { gNB_id = 0; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; NumRB = 128; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); prs_config1 = ( { gNB_id = 1; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; - NumRB = 106; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [4]; + NumRB = 128; RBOffset = 0; CombSize = 4; - REOffset = 1; - PRSResourceOffset = 0; + REOffset = [1]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [5]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf new file mode 100644 index 0000000000..2d04955726 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.64prb.conf @@ -0,0 +1,47 @@ +PRSs = +( + { + Active_gNBs = 1; + prs_config0 = ( + { + gNB_id = 0; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; + NumRB = 64; + RBOffset = 0; + CombSize = 4; + REOffset = [0]; + PRSResourceOffset = [0]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; + } + ); + + prs_config1 = ( + { + gNB_id = 1; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [4]; + NumRB = 64; + RBOffset = 0; + CombSize = 4; + REOffset = [1]; + PRSResourceOffset = [0]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [5]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; + } + ); + } +); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.66prb.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.66prb.conf deleted file mode 100644 index a1c129348a..0000000000 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr2.66prb.conf +++ /dev/null @@ -1,41 +0,0 @@ -PRSs = -( - { - Active_gNBs = 1; - prs_config0 = ( - { - gNB_id = 0; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; - NumRB = 64; - RBOffset = 0; - CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; - PRSResourceRepetition = 1; - PRSResourceTimeGap = 1; - NPRS_ID = 0; - } - ); - - prs_config1 = ( - { - gNB_id = 1; - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 4; - NumRB = 106; - RBOffset = 0; - CombSize = 4; - REOffset = 1; - PRSResourceOffset = 0; - PRSResourceRepetition = 1; - PRSResourceTimeGap = 1; - NPRS_ID = 0; - } - ); - } -); From 0bc6b0bdce5b851e0ce2bfd6d6c9ca04a33c1240 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Mon, 9 May 2022 14:20:18 +0200 Subject: [PATCH 4/8] revisiting the initialization of the future_ul_tti_request when gps sync is used --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 57a7fe7c4d..ee0ea94a85 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -69,7 +69,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0]; nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***)gNB->pdcch_pdu_idx[CC_idP]; nfapi_nr_ul_tti_request_t *future_ul_tti_req = - &gNB->UL_tti_req_ahead[CC_idP][(slotP+6)]; // + num_slots - 1) % num_slots]; + &gNB->UL_tti_req_ahead[CC_idP][(slotP)]; // + num_slots - 1) % num_slots]; nfapi_nr_ul_dci_request_t *UL_dci_req = &gNB->UL_dci_req[0]; nfapi_nr_tx_data_request_t *TX_req = &gNB->TX_req[0]; @@ -87,7 +87,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, UL_dci_req[CC_idP].numPdus = 0; /* advance last round's future UL_tti_req to be ahead of current frame/slot */ - future_ul_tti_req->SFN = ((slotP+6SFN = frameP; //(slotP == 0 ? frameP : frameP + 1) % 1024; LOG_D(MAC,"Future_ul_tti SFN = %d for slot %d \n", future_ul_tti_req->SFN, (slotP + num_slots - 1) % num_slots); /* future_ul_tti_req->Slot is fixed! */ future_ul_tti_req->n_pdus = 0; From 6b08c43ae8bf8a07d6f7cc25ef141f6724d5e423 Mon Sep 17 00:00:00 2001 From: Sagar Parsawar Date: Fri, 6 May 2022 14:10:54 +0200 Subject: [PATCH 5/8] Added 2gNB config for PRS --- .../gnb.sa.band78.fr1.106PRB.usrpb210.conf2 | 320 ++++++++++++++++++ 1 file changed, 320 insertions(+) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf2 diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf2 new file mode 100644 index 0000000000..3be2d2cdc0 --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf2 @@ -0,0 +1,320 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 2; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 641280; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640008; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 2; + PRSResourceSetPeriod = [20, 5]; + SymbolStart = [7, 8]; + NumPRSSymbols = [5, 5]; + NumRB = 106; + RBOffset = 0; + CombSize = 4; + REOffset = [2, 3]; + PRSResourceOffset = [0, 1]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [2, 6]; + MutingPattern1 = []; + MutingPattern2 = []; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + clock_src = "internal"; +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + From e7671506d10130e5beda7a003cd9fe75d4973d54 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Mon, 9 May 2022 15:38:33 +0200 Subject: [PATCH 6/8] config files for 273PRB for 2gNBs --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- ...gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf | 21 +- ...nb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 | 322 ++++++++++++++++++ 3 files changed, 335 insertions(+), 10 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 05843b21c4..71eb7c2cad 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -173,7 +173,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, is_prs_slot = check_prs_slot_gNB(&rsc_id, &gNB->prs_vars, slot); if(is_prs_slot) { - LOG_I(PHY,"gNB_TX: frame %d, slot %d, slots_per_frame %d, PRS Resource ID %d\n",frame,slot, fp->slots_per_frame, rsc_id); + LOG_D(PHY,"gNB_TX: frame %d, slot %d, slots_per_frame %d, PRS Resource ID %d\n",frame,slot, fp->slots_per_frame, rsc_id); nr_generate_prs(gNB->nr_gold_prs[slot],&gNB->common_vars.txdataF[0][txdataF_offset], AMP, &gNB->prs_vars.prs_cfg[rsc_id], cfg, fp); } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf index c223bb78c6..605a4afdb2 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf @@ -217,18 +217,21 @@ MACRLCs = ( prs_config = ( { - PRSResourceSetPeriod0 = 40; - PRSResourceSetPeriod1 = 0; - SymbolStart = 7; - NumPRSSymbols = 7; - NumRB = 272; + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; + NumRB = 240; RBOffset = 0; CombSize = 4; - REOffset = 0; - PRSResourceOffset = 0; + REOffset = [0]; + PRSResourceOffset = [0]; PRSResourceRepetition = 1; PRSResourceTimeGap = 1; - NPRS_ID = 0; + NPRS_ID = [0]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; } ); @@ -258,7 +261,7 @@ RUs = ( #beamforming 1x4 matrix: bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; #clock_src = "internal"; - sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,clock_source=external,time_source=external" + sdr_addrs = "addr=192.168.10.2,clock_source=gpsdo,time_source=gpsdo" } ); diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 new file mode 100644 index 0000000000..ef3b6fca6e --- /dev/null +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.273PRB.prs.usrpn310.conf2 @@ -0,0 +1,322 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + sib1_tda = 0; + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 1; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 650000; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 646736; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 273; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 273; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 28875; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 2; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.70.132"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24"; + GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; + GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( +{ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; + pusch_TargetSNRx10 = 150; + pucch_TargetSNRx10 = 200; + ulsch_max_frame_inactivity = 1; +} +); + +prs_config = ( +{ + NumPRSResources = 1; + PRSResourceSetPeriod = [40, 0]; + SymbolStart = [7]; + NumPRSSymbols = [7]; + NumRB = 240; + RBOffset = 0; + CombSize = 4; + REOffset = [1]; + PRSResourceOffset = [0]; + PRSResourceRepetition = 1; + PRSResourceTimeGap = 1; + NPRS_ID = [1]; + MutingPattern1 = []; + MutingPattern2 = []; + MutingBitRepetition = 1; +} +); + +L1s = ( +{ + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0 +} +); + +RUs = ( +{ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 114; + sf_extension = 0; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "internal"; + sdr_addrs = "addr=192.168.20.2,clock_source=gpsdo,time_source=gpsdo" +} +); + +THREAD_STRUCT = ( +{ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +} +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + +log_config : +{ + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; +}; + From f67a38473acf74644dc61d7e7fcceaf2bd6db573 Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger Date: Wed, 11 May 2022 05:20:12 +0200 Subject: [PATCH 7/8] reverting init of future_ul_tti_req to develop version --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ee0ea94a85..5988e8b1ee 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -69,7 +69,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0]; nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***pdcch = (nfapi_nr_dl_tti_pdcch_pdu_rel15_t ***)gNB->pdcch_pdu_idx[CC_idP]; nfapi_nr_ul_tti_request_t *future_ul_tti_req = - &gNB->UL_tti_req_ahead[CC_idP][(slotP)]; // + num_slots - 1) % num_slots]; + &gNB->UL_tti_req_ahead[CC_idP][(slotP + num_slots - 1) % num_slots]; nfapi_nr_ul_dci_request_t *UL_dci_req = &gNB->UL_dci_req[0]; nfapi_nr_tx_data_request_t *TX_req = &gNB->TX_req[0]; @@ -87,7 +87,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, UL_dci_req[CC_idP].numPdus = 0; /* advance last round's future UL_tti_req to be ahead of current frame/slot */ - future_ul_tti_req->SFN = frameP; //(slotP == 0 ? frameP : frameP + 1) % 1024; + future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024; LOG_D(MAC,"Future_ul_tti SFN = %d for slot %d \n", future_ul_tti_req->SFN, (slotP + num_slots - 1) % num_slots); /* future_ul_tti_req->Slot is fixed! */ future_ul_tti_req->n_pdus = 0; From f2c60f446e018e0d4470df3b34c22a60c7d51e20 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 10 May 2022 17:59:10 +0200 Subject: [PATCH 8/8] Remove assert for frame/slot checking in future_ul_tti_req --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 20 ++++++++++++------- .../LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 20 +++++++++++-------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index ca641ed1ba..8b949a615e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -47,13 +47,19 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot]; - AssertFatal(future_ul_tti_req->SFN == pucch->frame - && future_ul_tti_req->Slot == pucch->ul_slot, - "future UL_tti_req's frame.slot %d.%d does not match PUCCH %d.%d\n", - future_ul_tti_req->SFN, - future_ul_tti_req->Slot, - pucch->frame, - pucch->ul_slot); + + if (future_ul_tti_req->SFN != pucch->frame || future_ul_tti_req->Slot != pucch->ul_slot) + LOG_W(MAC, + "Current %d.%d : future UL_tti_req's frame.slot %4d.%2d does not match PUCCH %4d.%2d\n", + frame,slot, + future_ul_tti_req->SFN, + future_ul_tti_req->Slot, + pucch->frame, + pucch->ul_slot); + AssertFatal(future_ul_tti_req->n_pdus < + sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]), + "Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus); + future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE; future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pucch_pdu_t); nfapi_nr_pucch_pdu_t *pucch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pucch_pdu; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index bde6c6109d..1bfd1b179b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -1547,14 +1547,18 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) /* PUSCH in a later slot, but corresponding DCI now! */ nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][sched_pusch->slot]; - AssertFatal(future_ul_tti_req->SFN == sched_pusch->frame - && future_ul_tti_req->Slot == sched_pusch->slot, - "%d.%d future UL_tti_req's frame.slot %d.%d does not match PUSCH %d.%d\n", - frame, slot, - future_ul_tti_req->SFN, - future_ul_tti_req->Slot, - sched_pusch->frame, - sched_pusch->slot); + if (future_ul_tti_req->SFN != sched_pusch->frame || future_ul_tti_req->Slot != sched_pusch->slot) + LOG_W(MAC, + "%d.%d future UL_tti_req's frame.slot %d.%d does not match PUSCH %d.%d\n", + frame, slot, + future_ul_tti_req->SFN, + future_ul_tti_req->Slot, + sched_pusch->frame, + sched_pusch->slot); + AssertFatal(future_ul_tti_req->n_pdus < + sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]), + "Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus); + future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE; future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pusch_pdu_t); nfapi_nr_pusch_pdu_t *pusch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pusch_pdu;