From 85285a55eaf43551eb0af539da01287f0a609379 Mon Sep 17 00:00:00 2001 From: francescomani Date: Fri, 23 Sep 2022 10:18:08 +0200 Subject: [PATCH 01/49] disabling dualConnectivityPHR in attempt to fix NSA PHR report --- openair2/RRC/LTE/rrc_eNB_endc.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/openair2/RRC/LTE/rrc_eNB_endc.c b/openair2/RRC/LTE/rrc_eNB_endc.c index a2792adba5..a91b81e9f4 100644 --- a/openair2/RRC/LTE/rrc_eNB_endc.c +++ b/openair2/RRC/LTE/rrc_eNB_endc.c @@ -60,8 +60,6 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, struct LTE_LogicalChannelConfig__ul_SpecificParameters ul_params; long lcg; struct LTE_RadioResourceConfigDedicated__mac_MainConfig mac; - struct LTE_MAC_MainConfig__ext4 mac_ext4; - struct LTE_MAC_MainConfig__ext4__dualConnectivityPHR dc_phr; memset(&rrcd, 0, sizeof(rrcd)); memset(&drb_list, 0, sizeof(drb_list)); @@ -72,9 +70,6 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, #endif memset(&ul_params, 0, sizeof(ul_params)); memset(&mac, 0, sizeof(mac)); - memset(&mac_ext4, 0, sizeof(mac_ext4)); - memset(&dc_phr, 0, sizeof(dc_phr)); - trans_id = rrc_eNB_get_next_transaction_identifier(ctxt->module_id); memset(&dl_dcch_msg,0,sizeof(LTE_DL_DCCH_Message_t)); @@ -128,12 +123,6 @@ int rrc_eNB_generate_RRCConnectionReconfiguration_endc(protocol_ctxt_t *ctxt, mac.present = LTE_RadioResourceConfigDedicated__mac_MainConfig_PR_explicitValue; mac.choice.explicitValue.timeAlignmentTimerDedicated = LTE_TimeAlignmentTimer_sf10240; - mac.choice.explicitValue.ext4 = &mac_ext4; - - mac_ext4.dualConnectivityPHR = &dc_phr; - - dc_phr.present = LTE_MAC_MainConfig__ext4__dualConnectivityPHR_PR_setup; - dc_phr.choice.setup.phr_ModeOtherCG_r12 = LTE_MAC_MainConfig__ext4__dualConnectivityPHR__setup__phr_ModeOtherCG_r12_virtual; /* NR config */ struct LTE_RRCConnectionReconfiguration_v890_IEs cr_890; From 86cf5e704dd1321f524ff0063bd2ec371be2abc3 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 25 Aug 2022 09:01:11 +0200 Subject: [PATCH 02/49] reworking gNB PUCCH scheduling --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 10 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 52 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 521 ++++++------------ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 7 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 6 +- 5 files changed, 231 insertions(+), 365 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 5cf4bc295c..ac9b86e5c9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -215,9 +215,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, // Schedule CSI-RS transmission nr_csirs_scheduling(module_idP, frame, slot, nr_slots_per_frame[*scc->ssbSubcarrierSpacing]); - // Schedule CSI measurement reporting: check in slot 0 for the whole frame - if (slot == 0) - nr_csi_meas_reporting(module_idP, frame, slot); + // Schedule CSI measurement reporting + nr_csi_meas_reporting(module_idP, frame, slot); // Schedule SRS: check in slot 0 for the whole frame if (slot == 0) @@ -237,10 +236,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_ue_spec(module_idP, frame, slot); stop_meas(&gNB->schedule_dlsch); - nr_schedule_pucch(RC.nrmac[module_idP], frame, slot); + nr_sr_reporting(RC.nrmac[module_idP], frame, slot, module_idP); - // This schedule SR after PUCCH for multiplexing - nr_sr_reporting(RC.nrmac[module_idP], frame, slot); + nr_schedule_pucch(RC.nrmac[module_idP], frame, slot); stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 690bb2211b..66f431946d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1087,7 +1087,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, pucch_pdu->cyclic_prefix = (current_BWP->cyclicprefix==NULL) ? 0 : *current_BWP->cyclicprefix; NR_PUCCH_Config_t *pucch_Config = current_BWP->pucch_Config; - if (r_pucch<0 || pucch_Config){ + if (r_pucch<0 || pucch_Config) { LOG_D(NR_MAC,"pucch_acknak: Filling dedicated configuration for PUCCH\n"); AssertFatal(pucch_Config->resourceSetToAddModList!=NULL, @@ -2375,6 +2375,17 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, else UL_BWP->pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup; + UL_BWP->max_fb_time = 0; + if(DL_BWP->dci_format != NR_DL_DCI_FORMAT_1_0 && + UL_BWP->pucch_Config) { + for (int i=0; ipucch_Config->dl_DataToUL_ACK->list.count; i++) { + if(*UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i] > UL_BWP->max_fb_time) + UL_BWP->max_fb_time = *UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i]; + } + } + else + UL_BWP->max_fb_time = 8; // default value + if(UE) { // setting PDCCH related structures for sched_ctrl @@ -2410,6 +2421,8 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, if (UL_BWP->csi_MeasConfig) compute_csi_bitlen (UL_BWP->csi_MeasConfig, UE->csi_report_template); + set_sched_pucch_list(sched_ctrl, UL_BWP, scc); + } if(ra) { @@ -2456,6 +2469,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, NR_RNTI_C, target_ss, false); + } void reset_srs_stats(NR_UE_info_t *UE) { @@ -2553,6 +2567,34 @@ NR_UE_info_t *add_new_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rntiP, NR_CellGroupConf return (UE); } +void set_sched_pucch_list(NR_UE_sched_ctrl_t *sched_ctrl, + NR_UE_UL_BWP_t *ul_bwp, + NR_ServingCellConfigCommon_t *scc) { + + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs]; + const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; + const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; + + const int list_size = n_ul_slots_period << (ul_bwp->max_fb_time/nr_slots_period); + if(!sched_ctrl->sched_pucch) { + sched_ctrl->sched_pucch = malloc(list_size * sizeof(*sched_ctrl->sched_pucch)); + sched_ctrl->sched_pucch_size = list_size; + for(int i=0; isched_pucch[i]; + memset(curr_pucch, 0, sizeof(*curr_pucch)); + } + } + else if (list_size > sched_ctrl->sched_pucch_size) { + sched_ctrl->sched_pucch = realloc(sched_ctrl->sched_pucch, list_size * sizeof(*sched_ctrl->sched_pucch)); + for(int i=sched_ctrl->sched_pucch_size; isched_pucch[i]; + memset(curr_pucch, 0, sizeof(*curr_pucch)); + } + sched_ctrl->sched_pucch_size = list_size; + } +} + void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, const NR_PDSCH_ServingCellConfig_t *pdsch) { const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ? @@ -2672,23 +2714,17 @@ uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) { void get_pdsch_to_harq_feedback(NR_PUCCH_Config_t *pucch_Config, nr_dci_format_t dci_format, - int *max_fb_time, uint8_t *pdsch_to_harq_feedback) { if (dci_format == NR_DL_DCI_FORMAT_1_0) { - for (int i=0; i<8; i++) { + for (int i=0; i<8; i++) pdsch_to_harq_feedback[i] = i+1; - if(pdsch_to_harq_feedback[i]>*max_fb_time) - *max_fb_time = pdsch_to_harq_feedback[i]; - } } else { AssertFatal(pucch_Config!=NULL,"pucch_Config shouldn't be null here\n"); if(pucch_Config->dl_DataToUL_ACK != NULL) { for (int i=0; i<8; i++) { pdsch_to_harq_feedback[i] = *pucch_Config->dl_DataToUL_ACK->list.array[i]; - if(pdsch_to_harq_feedback[i]>*max_fb_time) - *max_fb_time = pdsch_to_harq_feedback[i]; } } else diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index c347ea5bea..2c4166f261 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -45,8 +45,8 @@ static void nr_fill_nfapi_pucch(gNB_MAC_INST *nrmac, const NR_sched_pucch_t *pucch, NR_UE_info_t* UE) { - nfapi_nr_ul_tti_request_t *future_ul_tti_req = - &nrmac->UL_tti_req_ahead[0][pucch->ul_slot]; + + nfapi_nr_ul_tti_request_t *future_ul_tti_req = &nrmac->UL_tti_req_ahead[0][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", @@ -55,6 +55,7 @@ static void nr_fill_nfapi_pucch(gNB_MAC_INST *nrmac, future_ul_tti_req->Slot, pucch->frame, pucch->ul_slot); + // n_pdus is number of pdus, so, in the array, it is the index of the next free element if (future_ul_tti_req->n_pdus >= sizeofArray(future_ul_tti_req->pdus_list) ) { LOG_E(NR_MAC,"future_ul_tti_req->n_pdus %d is full, slot: %d, sr flag %d dropping request\n", @@ -139,22 +140,19 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac, UE_iterator(nrmac->UE_info.list, UE) { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; - const int n = sizeof(sched_ctrl->sched_pucch) / sizeof(*sched_ctrl->sched_pucch); - for (int i = 0; i < n; i++) { + for (int i = 0; i < sched_ctrl->sched_pucch_size; i++) { NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[i]; const uint16_t O_ack = curr_pucch->dai_c; const uint16_t O_csi = curr_pucch->csi_bits; const uint8_t O_sr = curr_pucch->sr_flag; - if (O_ack + O_csi + O_sr == 0 - || frameP != curr_pucch->frame - || slotP != curr_pucch->ul_slot) - continue; - - if (O_csi > 0) - LOG_D(NR_MAC,"Scheduling PUCCH[%d] RX for UE %04x in %4d.%2d O_ack %d, O_sr %d, O_csi %d\n", - i,UE->rnti,curr_pucch->frame,curr_pucch->ul_slot,O_ack,O_sr,O_csi); - nr_fill_nfapi_pucch(nrmac, frameP, slotP, curr_pucch, UE); - memset(curr_pucch, 0, sizeof(*curr_pucch)); + if (curr_pucch->active == true && + frameP == curr_pucch->frame && + slotP == curr_pucch->ul_slot) { + LOG_D(NR_MAC,"Scheduling PUCCH[%d] RX for UE %04x in %4d.%2d O_ack %d, O_sr %d, O_csi %d\n", + i,UE->rnti,curr_pucch->frame,curr_pucch->ul_slot,O_ack,O_sr,O_csi); + nr_fill_nfapi_pucch(nrmac, frameP, slotP, curr_pucch, UE); + memset(curr_pucch, 0, sizeof(*curr_pucch)); + } } } } @@ -186,14 +184,16 @@ void nr_csi_meas_reporting(int Mod_idP, if(pucchcsires->uplinkBandwidthPartId != ul_bwp->bwp_id) continue; + // we schedule CSI reporting max_fb_time slots in advance int period, offset; csi_period_offset(csirep, NULL, &period, &offset); - const int sched_slot = (period + offset) % n_slots_frame; + const int sched_slot = (slot + ul_bwp->max_fb_time) % n_slots_frame; + const int sched_frame = (frame + ((slot + ul_bwp->max_fb_time) / n_slots_frame)) % 1024; // prepare to schedule csi measurement reception according to 5.2.1.4 in 38.214 - // preparation is done in first slot of tdd period - if (frame % (period / n_slots_frame) != offset / n_slots_frame) + if ((sched_frame*n_slots_frame + sched_slot - offset)%period != 0) continue; - LOG_D(NR_MAC, "CSI reporting in frame %d slot %d CSI report ID %ld\n", frame, sched_slot, csirep->reportConfigId); + + LOG_D(NR_MAC, "CSI reporting in frame %d slot %d CSI report ID %ld\n", sched_frame, sched_slot, csirep->reportConfigId); const NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[1]; // set with formats >1 const int n = pucchresset->resourceList.list.count; @@ -206,17 +206,21 @@ void nr_csi_meas_reporting(int Mod_idP, // find free PUCCH that is in order with possibly existing PUCCH // schedulings (other CSI, SR) - NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[1]; - AssertFatal(curr_pucch->csi_bits == 0 - && !curr_pucch->sr_flag - && curr_pucch->dai_c == 0, - "PUCCH not free at index 1 for UE %04x\n", + NR_sched_pucch_t *curr_pucch = NULL; + for (int i=0; isched_pucch_size; i++) { + curr_pucch = &sched_ctrl->sched_pucch[i]; + if (!curr_pucch->active) + break; // found an available pucch structure + } + AssertFatal(curr_pucch, + "PUCCH structure not found for UE %04x\n", UE->rnti); curr_pucch->r_pucch = -1; - curr_pucch->frame = frame; + curr_pucch->frame = sched_frame; curr_pucch->ul_slot = sched_slot; curr_pucch->resource_indicator = res_index; curr_pucch->csi_bits += nr_get_csi_bitlen(UE->csi_report_template, csi_report_id); + curr_pucch->active = true; int bwp_start = ul_bwp->BWPStart; @@ -235,7 +239,7 @@ void nr_csi_meas_reporting(int Mod_idP, len = pucchres->format.choice.format2->nrofPRBs; mask = SL_to_bitmap(pucchres->format.choice.format2->startingSymbolIndex, pucchres->format.choice.format2->nrofSymbols); curr_pucch->simultaneous_harqcsi = pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI; - LOG_D(NR_MAC,"%d.%d Allocating PUCCH format 2, startPRB %d, nPRB %d, simulHARQ %d, num_bits %d\n", frame, sched_slot,start,len,curr_pucch->simultaneous_harqcsi,curr_pucch->csi_bits); + LOG_D(NR_MAC,"%d.%d Allocating PUCCH format 2, startPRB %d, nPRB %d, simulHARQ %d, num_bits %d\n", sched_frame, sched_slot,start,len,curr_pucch->simultaneous_harqcsi,curr_pucch->csi_bits); break; case NR_PUCCH_Resource__format_PR_format3: len = pucchres->format.choice.format3->nrofPRBs; @@ -252,7 +256,7 @@ void nr_csi_meas_reporting(int Mod_idP, // verify resources are free for (int i = start; i < start + len; ++i) { if((vrb_map_UL[i+bwp_start] & mask) != 0) { - LOG_E(NR_MAC, "%4d.%2d VRB MAP in %4d.%2d not free. Can't schedule CSI reporting on PUCCH.\n", frame, slot, frame, sched_slot); + LOG_E(NR_MAC, "%4d.%2d VRB MAP in %4d.%2d not free. Can't schedule CSI reporting on PUCCH.\n", frame, slot, sched_frame, sched_slot); memset(curr_pucch, 0, sizeof(*curr_pucch)); } else @@ -993,26 +997,17 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, } } -bool test_acknack_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, - NR_sched_pucch_t *pucch, - uint16_t *vrb_map_UL, - const NR_ServingCellConfigCommon_t *scc, - NR_PUCCH_Config_t *pucch_Config, - int r_pucch, - int bwp_start, - int bwp_size) { +bool test_pucch0_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, + NR_sched_pucch_t *pucch, + uint16_t *vrb_map_UL, + const NR_ServingCellConfigCommon_t *scc, + NR_PUCCH_Config_t *pucch_Config, + int r_pucch, + int bwp_start, + int bwp_size) { // We assume initial cyclic shift is always 0 so different pucch resources can't overlap - NR_sched_pucch_t *csi_pucch = &sched_ctrl->sched_pucch[1]; - if (csi_pucch && - csi_pucch->csi_bits > 0 && - csi_pucch->frame == pucch->frame && - csi_pucch->ul_slot == pucch->ul_slot && - csi_pucch->simultaneous_harqcsi && - (csi_pucch->csi_bits + csi_pucch->dai_c) < 11) - return true; // available resources for csi_pucch already verified - if(r_pucch<0){ const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[0]; DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0); @@ -1049,15 +1044,15 @@ bool test_acknack_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, } // this function returns an index to NR_sched_pucch structure -// currently this structure contains PUCCH0 at index 0 and PUCCH2 at index 1 // if the function returns -1 it was not possible to schedule acknack -// when current pucch is ready to be scheduled nr_fill_nfapi_pucch is called int nr_acknack_scheduling(int mod_id, NR_UE_info_t *UE, frame_t frame, sub_frame_t slot, int r_pucch, - int is_common) { + int is_common) +{ + const int CC_id = 0; const int minfbtime = RC.nrmac[mod_id]->minRXTXTIMEpdsch; const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels[CC_id].ServingCellConfigCommon; @@ -1066,10 +1061,8 @@ int nr_acknack_scheduling(int mod_id, const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; AssertFatal(tdd || RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD, "Dynamic TDD not handled yet\n"); const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; - const int next_ul_slot = tdd ? tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period) : slot + minfbtime; const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; - /* for the moment, we consider: * * only pucch_sched[0] holds HARQ (and SR) * * we do not multiplex with CSI, which is always in pucch_sched[2] @@ -1082,247 +1075,110 @@ int nr_acknack_scheduling(int mod_id, int bwp_start = ul_bwp->BWPStart; int bwp_size = ul_bwp->BWPSize; - NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0]; - LOG_D(NR_MAC, "In %s: %4d.%2d Trying to allocate pucch, current DAI %d\n", __FUNCTION__, frame, slot, pucch->dai_c); - - pucch->r_pucch=r_pucch; - AssertFatal(pucch->csi_bits == 0, - "%s(): csi_bits %d in sched_pucch[0]\n", - __func__, - pucch->csi_bits); - - /* if the currently allocated PUCCH of this UE is full, allocate it */ - NR_sched_pucch_t *csi_pucch = &sched_ctrl->sched_pucch[1]; - if (pucch->dai_c == 2) { - /* advance the UL slot information in PUCCH by one so we won't schedule in - * the same slot again */ - const int f = pucch->frame; - const int s = pucch->ul_slot; - LOG_D(NR_MAC, "In %s: %4d.%2d DAI = 2 pucch currently in %4d.%2d, advancing by 1 slot\n", __FUNCTION__, frame, slot, f, s); - - if (!(csi_pucch - && csi_pucch->csi_bits > 0 - && csi_pucch->frame == f - && csi_pucch->ul_slot == s)) - nr_fill_nfapi_pucch(RC.nrmac[mod_id], frame, slot, pucch, UE); - - memset(pucch, 0, sizeof(*pucch)); - pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; - else - pucch->ul_slot = (s + 1) % n_slots_frame; - // we assume that only two indices over the array sched_pucch exist - // skip the CSI PUCCH if it is present and if in the next frame/slot - // and if we don't multiplex - csi_pucch->r_pucch=-1; - if (csi_pucch - && csi_pucch->csi_bits > 0 - && csi_pucch->frame == pucch->frame - && csi_pucch->ul_slot == pucch->ul_slot - && !csi_pucch->simultaneous_harqcsi) { - LOG_D(NR_MAC,"Cannot multiplex csi_pucch for %d.%d\n",csi_pucch->frame,csi_pucch->ul_slot); - nr_fill_nfapi_pucch(RC.nrmac[mod_id], frame, slot, csi_pucch, UE); - - memset(csi_pucch, 0, sizeof(*csi_pucch)); - pucch->frame = pucch->ul_slot == n_slots_frame - 1 ? (pucch->frame + 1) % 1024 : pucch->frame; - if(((pucch->ul_slot + 1)%nr_slots_period) == 0) - pucch->ul_slot = (pucch->ul_slot + 1 + first_ul_slot_period) % n_slots_frame; - else - pucch->ul_slot = (pucch->ul_slot + 1) % n_slots_frame; - } - } - - LOG_D(NR_MAC, "In %s: pucch_acknak 1. DL %4d.%2d, UL_ACK %4d.%2d, DAI_C %d\n", __FUNCTION__, frame, slot, pucch->frame, pucch->ul_slot, pucch->dai_c); - nr_dci_format_t dci_format = NR_DL_DCI_FORMAT_1_0; if(is_common == 0) dci_format = UE->current_DL_BWP.dci_format; uint8_t pdsch_to_harq_feedback[8]; - int max_fb_time = 0; - get_pdsch_to_harq_feedback(pucch_Config, dci_format, &max_fb_time, pdsch_to_harq_feedback); + get_pdsch_to_harq_feedback(pucch_Config, dci_format, pdsch_to_harq_feedback); - LOG_D(NR_MAC, "In %s: 1b. DL %4d.%2d, UL_ACK %4d.%2d, DAI_C %d\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c); - /* there is a HARQ. Check whether we can use it for this ACKNACK */ - if (pucch->dai_c > 0) { - /* this UE already has a PUCCH occasion */ - // Find the right timing_indicator value. - int i = 0; - while (i < 8) { - int diff = pucch->ul_slot - slot; - if (diff<0) - diff += n_slots_frame; - if (pdsch_to_harq_feedback[i] == diff && - pdsch_to_harq_feedback[i] >= minfbtime) - break; - ++i; - } - if (i >= 8) { - // we cannot reach this timing anymore, allocate and try again - const int f = pucch->frame; - const int s = pucch->ul_slot; - LOG_D(NR_MAC, "In %s: %4d.%2d DAI > 0, cannot reach timing for pucch in %4d.%2d, advancing slot by 1 and trying again\n", __FUNCTION__, frame, slot, f, s); - if (!(csi_pucch && - csi_pucch->csi_bits > 0 && - csi_pucch->frame == f && - csi_pucch->ul_slot == s)) - nr_fill_nfapi_pucch(RC.nrmac[mod_id], frame, slot, pucch, UE); - memset(pucch, 0, sizeof(*pucch)); - pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; - else - pucch->ul_slot = (s + 1) % n_slots_frame; - return nr_acknack_scheduling(mod_id, UE, frame, slot, r_pucch,is_common); - } + for (int f=0; f<8; f++) { + // can't schedule ACKNACK before minimum feedback time + if(pdsch_to_harq_feedback[f] < minfbtime) + continue; + const int pucch_slot = (slot + pdsch_to_harq_feedback[f]) % n_slots_frame; + // check if the slot is UL + if(pucch_slot%nr_slots_period < first_ul_slot_period) + continue; + const int pucch_frame = frame + ((slot + pdsch_to_harq_feedback[f]) / n_slots_frame); + int inactive_pucch = -1; + NR_sched_pucch_t *curr_pucch = NULL; + for (int i=0; isched_pucch_size; i++) { + curr_pucch = &sched_ctrl->sched_pucch[i]; + // if there is already an active pucch for this frame and slot + if (curr_pucch->active && + curr_pucch->frame == pucch_frame && + curr_pucch->ul_slot == pucch_slot) { + LOG_D(NR_MAC, "In %s: pucch_acknak DL %4d.%2d, UL_ACK %4d.%2d Bits already in current PUCCH: DAI_C %d CSI %d\n", + __FUNCTION__, frame, slot, pucch_frame, pucch_slot, curr_pucch->dai_c, curr_pucch->csi_bits); + // we can't schedule if short pucch is already full + if (curr_pucch->csi_bits == 0 && + curr_pucch->dai_c == 2) + continue; + // if there is CSI but simultaneous HARQ+CSI is disable we can't schedule + if(!curr_pucch->simultaneous_harqcsi && + curr_pucch->csi_bits>0) + continue; + // TODO we can't schedule more than 11 bits in PUCCH2 for now + if (curr_pucch->csi_bits + curr_pucch->dai_c >= 10) + continue; - pucch->timing_indicator = i; - pucch->dai_c++; - // if there is CSI in this slot update the HARQ information for that one too - if (csi_pucch && - csi_pucch->csi_bits > 0 && - csi_pucch->frame == pucch->frame && - csi_pucch->ul_slot == pucch->ul_slot) { - csi_pucch->timing_indicator = i; - csi_pucch->dai_c++; - } - // retain old resource indicator, and we are good - LOG_D(NR_MAC, "In %s: %4d.%2d. DAI > 0, pucch allocated for %4d.%2d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); - return 0; - } - - LOG_D(NR_MAC, "In %s: %4d.%2d DAI = 0, looking for new pucch occasion\n", __FUNCTION__, frame, slot); - /* we need to find a new PUCCH occasion */ - - /*(Re)Inizialization of timing information*/ - if ((pucch->frame == 0 && pucch->ul_slot == 0) || - ((pucch->frame*n_slots_frame + pucch->ul_slot) < - (frame*n_slots_frame + slot))) { - AssertFatal(pucch->sr_flag + pucch->dai_c == 0, - "expected no SR/AckNack for UE %04x in %4d.%2d, but has %d/%d for %4d.%2d\n", - UE->rnti, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); - const int s = next_ul_slot; - pucch->frame = s < n_slots_frame ? frame : (frame + 1) % 1024; - pucch->ul_slot = s % n_slots_frame; - } - - // Find the right timing_indicator value. - int ind_found = -1; - // while we are within the feedback limits - uint16_t *vrb_map_UL; - while ((n_slots_frame + pucch->ul_slot - slot) % n_slots_frame <= max_fb_time) { - // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available - vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE]; - bool ret = test_acknack_vrb_occupation(sched_ctrl, - pucch, - vrb_map_UL, - scc, - pucch_Config, - r_pucch, - bwp_start, - bwp_size); - if (ret) { - int i = 0; - while (i < 8) { - LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", - i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); - int diff = pucch->ul_slot - slot; - if (diff<0) - diff += n_slots_frame; - if (pdsch_to_harq_feedback[i] == diff && - pdsch_to_harq_feedback[i] >= minfbtime) { - ind_found = i; - break; - } - ++i; + // otherwise we can schedule in this active PUCCH + // no need to check VRB occupation because already done when PUCCH has been activated + curr_pucch->timing_indicator = f; + curr_pucch->dai_c++; + LOG_D(NR_MAC, "In %s: DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d CSI %d\n", + __FUNCTION__,frame,slot,curr_pucch->frame,curr_pucch->ul_slot,i,f,curr_pucch->dai_c,curr_pucch->csi_bits); + return i; // index of current PUCCH structure } - if (ind_found!=-1) - break; + else if (!curr_pucch->active) + inactive_pucch = i; } - // advance to the next ul slot - const int f = pucch->frame; - const int s = pucch->ul_slot; - pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; - else - pucch->ul_slot = (s + 1) % n_slots_frame; - } - if (ind_found==-1) { - LOG_D(NR_MAC, - "%4d.%2d could not find pdsch_to_harq_feedback for UE %04x: earliest " - "ack slot %d\n", - frame, - slot, - UE->rnti, - pucch->ul_slot); - return -1; - } + if (inactive_pucch>0) { + curr_pucch = &sched_ctrl->sched_pucch[inactive_pucch]; + // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available + uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch_slot * MAX_BWP_SIZE]; + bool ret = test_pucch0_vrb_occupation(sched_ctrl, + curr_pucch, + vrb_map_UL, + scc, + pucch_Config, + r_pucch, + bwp_start, + bwp_size); + if(!ret) { + LOG_D(NR_MAC, "In %s: DL %4d.%2d, UL_ACK %4d.%2d PRB resources for this occasion are already occupied, move to the following occasion\n", + __FUNCTION__,frame,slot,curr_pucch->frame,curr_pucch->ul_slot); + continue; + } + // allocating a new PUCCH structure for this occasion + curr_pucch->active = true; + curr_pucch->frame = pucch_frame; + curr_pucch->ul_slot = pucch_slot; + curr_pucch->timing_indicator = f; // index in the list of timing indicators + curr_pucch->dai_c++; + curr_pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources + curr_pucch->r_pucch=r_pucch; - if (csi_pucch && - csi_pucch->csi_bits > 0 && - csi_pucch->frame == pucch->frame && - csi_pucch->ul_slot == pucch->ul_slot) { - // skip the CSI PUCCH if it is present and if in the next frame/slot - // and if we don't multiplex - /* FIXME currently we support at most 11 bits in pucch2 so skip also in that case. - We need to set the limit to 10 because SR scheduling has been moved afterwards */ - if(!csi_pucch->simultaneous_harqcsi - || ((csi_pucch->csi_bits + csi_pucch->dai_c) >= 10)) { - LOG_D(NR_MAC,"Cannot multiplex csi_pucch %d +csi_pucch->dai_c %d for %d.%d\n",csi_pucch->csi_bits,csi_pucch->dai_c,csi_pucch->frame,csi_pucch->ul_slot); - nr_fill_nfapi_pucch(RC.nrmac[mod_id], frame, slot, csi_pucch, UE); - memset(csi_pucch, 0, sizeof(*csi_pucch)); - /* advance the UL slot information in PUCCH by one so we won't schedule in - * the same slot again */ - const int f = pucch->frame; - const int s = pucch->ul_slot; - memset(pucch, 0, sizeof(*pucch)); - pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f; - if(((s + 1)%nr_slots_period) == 0) - pucch->ul_slot = (s + 1 + first_ul_slot_period) % n_slots_frame; - else - pucch->ul_slot = (s + 1) % n_slots_frame; - return nr_acknack_scheduling(mod_id, UE, frame, slot, r_pucch,is_common); - } - // multiplexing harq and csi in a pucch - else { - csi_pucch->timing_indicator = ind_found; - csi_pucch->dai_c++; - memset(pucch,0,sizeof(*pucch)); + LOG_D(NR_MAC, "In %s: DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d\n", + __FUNCTION__,frame,slot,curr_pucch->frame,curr_pucch->ul_slot,inactive_pucch,f,curr_pucch->dai_c); - LOG_D(NR_MAC,"multiplexing csi_pucch %d +csi_pucch->dai_c %d for %d.%d\n",csi_pucch->csi_bits,csi_pucch->dai_c,csi_pucch->frame,csi_pucch->ul_slot); - return 1; + // blocking resources for current PUCCH in VRB map + for (int l=0; lnr_of_symb; l++) { + uint16_t symb = SL_to_bitmap(curr_pucch->start_symb+l, 1); + int prb; + if (l==1 && curr_pucch->second_hop_prb != 0) + prb = curr_pucch->second_hop_prb; + else + prb = curr_pucch->prb_start; + vrb_map_UL[bwp_start+prb] |= symb; + } + + return inactive_pucch; // index of current PUCCH structure } } - - pucch->timing_indicator = ind_found; // index in the list of timing indicators - - LOG_D(NR_MAC, "In %s: 2. DAI 0 DL %4d.%2d, UL_ACK %4d.%2d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator); - - pucch->dai_c++; - pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources - pucch->r_pucch=r_pucch; - - vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch->ul_slot * MAX_BWP_SIZE]; - for (int l=0; lnr_of_symb; l++) { - uint16_t symb = SL_to_bitmap(pucch->start_symb+l, 1); - int prb; - if (l==1 && pucch->second_hop_prb != 0) - prb = pucch->second_hop_prb; - else - prb = pucch->prb_start; - vrb_map_UL[bwp_start+prb] |= symb; - } - return 0; + LOG_D(NR_MAC, "In %s: DL %4d.%2d, Couldn't find scheduling occasion for this HARQ process\n", + __FUNCTION__, frame, slot); + return -1; } -void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) +void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot, int mod_id) { if (!is_xlsch_in_slot(nrmac->ulsch_slot_bitmap[slot / 64], slot)) return; - + int CC_id = 0; + const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; UE_iterator(nrmac->UE_info.list, UE) { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; @@ -1349,95 +1205,64 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) LOG_D(NR_MAC, "%4d.%2d Scheduling Request identified\n", SFN, slot); NR_PUCCH_ResourceId_t *PucchResourceId = SchedulingRequestResourceConfig->resource; - int found = -1; + int idx = -1; NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[0]; // set with formats 0,1 int n_list = pucchresset->resourceList.list.count; for (int i=0; iresourceList.list.array[i] == *PucchResourceId ) - found = i; + idx = i; } - AssertFatal(found>-1,"SR resource not found among PUCCH resources"); + AssertFatal(idx>-1,"SR resource not found among PUCCH resources"); - /* loop through nFAPI PUCCH messages: if the UEs is in there in this slot - * with the resource_indicator, it means we already allocated that PUCCH - * resource for AckNack (e.g., the UE has been scheduled often), and we - * just need to add the SR_flag. Otherwise, just allocate in the internal - * PUCCH resource, and nr_schedule_pucch() will handle the rest */ - NR_PUCCH_Resource_t *pucch_res = pucch_Config->resourceToAddModList->list.array[found]; - /* for the moment, can only handle SR on PUCCH Format 0 */ - DevAssert(pucch_res->format.present == NR_PUCCH_Resource__format_PR_format0); - nfapi_nr_ul_tti_request_t *ul_tti_req = &nrmac->UL_tti_req_ahead[0][slot]; - bool nfapi_allocated = false; - for (int i = 0; i < ul_tti_req->n_pdus; ++i) { - if (ul_tti_req->pdus_list[i].pdu_type != NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE) - continue; - nfapi_nr_pucch_pdu_t *pdu = &ul_tti_req->pdus_list[i].pucch_pdu; - /* check that it is our PUCCH F0. Assuming there can be only one */ - if (pdu->rnti == UE->rnti - && pdu->format_type == 0 // does not use NR_PUCCH_Resource__format_PR_format0 - && pdu->initial_cyclic_shift == pucch_res->format.choice.format0->initialCyclicShift - && pdu->nr_of_symbols == pucch_res->format.choice.format0->nrofSymbols - && pdu->start_symbol_index == pucch_res->format.choice.format0->startingSymbolIndex) { - LOG_D(NR_MAC,"%4d.%2d adding SR_flag 1 to PUCCH format 0 nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti); - pdu->sr_flag = 1; - nfapi_allocated = true; - break; - } else if (pdu->rnti == UE->rnti - && pdu->format_type == 2 // does not use NR_PUCCH_Resource__format_PR_format0 - && pdu->nr_of_symbols == pucch_res->format.choice.format2->nrofSymbols - && pdu->start_symbol_index == pucch_res->format.choice.format2->startingSymbolIndex) { - LOG_D(NR_MAC,"%4d.%2d adding SR_flag 1 to PUCCH format 2 nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti); - pdu->sr_flag = 1; - nfapi_allocated = true; - break; - } else if (pdu->rnti == UE->rnti - && pdu->format_type == 1 // does not use NR_PUCCH_Resource__format_PR_format0 - && pdu->nr_of_symbols == pucch_res->format.choice.format1->nrofSymbols - && pdu->start_symbol_index == pucch_res->format.choice.format1->startingSymbolIndex) { - LOG_D(NR_MAC,"%4d.%2d adding SR_flag 1 to PUCCH format 1 nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti); - pdu->sr_flag = 1; - nfapi_allocated = true; - break; - } else if (pdu->rnti == UE->rnti - && pdu->format_type == 3 // does not use NR_PUCCH_Resource__format_PR_format0 - && pdu->nr_of_symbols == pucch_res->format.choice.format3->nrofSymbols - && pdu->start_symbol_index == pucch_res->format.choice.format3->startingSymbolIndex) { - LOG_D(NR_MAC,"%4d.%2d adding SR_flag 1 to PUCCH format 3 nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti); - pdu->sr_flag = 1; - nfapi_allocated = true; - break; - } else if (pdu->rnti == UE->rnti - && pdu->format_type == 4 // does not use NR_PUCCH_Resource__format_PR_format0 - && pdu->nr_of_symbols == pucch_res->format.choice.format4->nrofSymbols - && pdu->start_symbol_index == pucch_res->format.choice.format4->startingSymbolIndex) { - LOG_D(NR_MAC,"%4d.%2d adding SR_flag 1 to PUCCH format 4 nFAPI SR for RNTI %04x\n", SFN, slot, pdu->rnti); - pdu->sr_flag = 1; - nfapi_allocated = true; + NR_sched_pucch_t *curr_pucch = NULL; + bool found = false; + int free_pucch = -1; + for (int i=0; isched_pucch_size; i++) { + curr_pucch = &sched_ctrl->sched_pucch[i]; + if (curr_pucch->active && + curr_pucch->frame == SFN && + curr_pucch->ul_slot == slot && + curr_pucch->resource_indicator == found) { + curr_pucch->sr_flag = true; + found = true; break; } + else if (!curr_pucch->active) + free_pucch = i; // found an available pucch structure } - - if (nfapi_allocated) // break scheduling resource loop, continue next UE - break; - - /* we did not find it: check if current PUCCH is for the current slot, in - * which case we add the SR to it; otherwise, allocate SR separately */ - NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[0]; - if (curr_pucch->frame == SFN && curr_pucch->ul_slot == slot) { - if (curr_pucch->resource_indicator != found) { - LOG_W(NR_MAC, "%4d.%2d expected PUCCH in this slot to have resource indicator of SR (%d), skipping SR\n", SFN, slot, found); + AssertFatal(found || free_pucch>0, "Coulnd't find an available PUCCH resource to schedule SR\n"); + if (!found) { + uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[slot * MAX_BWP_SIZE]; + int bwp_start = ul_bwp->BWPStart; + int bwp_size = ul_bwp->BWPSize; + NR_sched_pucch_t *sched_sr = &sched_ctrl->sched_pucch[free_pucch]; + bool ret = test_pucch0_vrb_occupation(sched_ctrl, + sched_sr, + vrb_map_UL, + scc, + pucch_Config, + -1, + bwp_start, + bwp_size); + if (!ret) { + LOG_E(NR_MAC,"Cannot schedule SR. PRBs not available\n"); continue; } - curr_pucch->sr_flag = true; - } else { - NR_sched_pucch_t sched_sr = { - .frame = SFN, - .ul_slot = slot, - .sr_flag = true, - .resource_indicator = found, - .r_pucch = -1 - }; - nr_fill_nfapi_pucch(nrmac, SFN, slot, &sched_sr, UE); + sched_sr->frame = SFN; + sched_sr->ul_slot = slot; + sched_sr->sr_flag = true; + sched_sr->resource_indicator = idx; + sched_sr->r_pucch = -1; + sched_sr->active = true; + for (int l=0; lnr_of_symb; l++) { + uint16_t symb = SL_to_bitmap(sched_sr->start_symb+l, 1); + int prb; + if (l==1 && sched_sr->second_hop_prb != 0) + prb = sched_sr->second_hop_prb; + else + prb = sched_sr->prb_start; + vrb_map_UL[bwp_start+prb] |= symb; + } } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 4497e89030..c7c44f95d7 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -218,7 +218,6 @@ int nr_acknack_scheduling(int Mod_idP, void get_pdsch_to_harq_feedback(NR_PUCCH_Config_t *pucch_Config, nr_dci_format_t dci_format, - int *max_fb_time, uint8_t *pdsch_to_harq_feedback); void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, @@ -466,6 +465,10 @@ uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx); uint8_t get_dl_nrOfLayers(const NR_UE_sched_ctrl_t *sched_ctrl, const nr_dci_format_t dci_format); +void set_sched_pucch_list(NR_UE_sched_ctrl_t *sched_ctrl, + NR_UE_UL_BWP_t *ul_bwp, + NR_ServingCellConfigCommon_t *scc); + const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot); const int get_ul_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot); @@ -490,7 +493,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options, void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid); -void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP); +void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP, int mod_id); size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset_rsrp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 4d65de8403..a74dafa29c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -123,6 +123,7 @@ typedef struct NR_UE_UL_BWP { uint8_t transform_precoding; uint8_t mcs_table; nr_dci_format_t dci_format; + int max_fb_time; } NR_UE_UL_BWP_t; typedef enum { @@ -354,6 +355,7 @@ typedef struct UE_info { } NR_UE_mac_ce_ctrl_t; typedef struct NR_sched_pucch { + bool active; int frame; int ul_slot; bool sr_flag; @@ -560,9 +562,11 @@ typedef struct { /// corresponding to the sched_pusch/sched_pdsch structures below int cce_index; uint8_t aggregation_level; + /// PUCCH scheduling information. Array of two: HARQ+SR in the first field, /// CSI in second. This order is important for nr_acknack_scheduling()! - NR_sched_pucch_t sched_pucch[2]; + NR_sched_pucch_t *sched_pucch; + int sched_pucch_size; /// Sched PUSCH: scheduling decisions, copied into HARQ and cleared every TTI NR_sched_pusch_t sched_pusch; From ef701be83df59e91952c903aeda2b26ba73a783d Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 25 Aug 2022 18:51:28 +0200 Subject: [PATCH 03/49] bugfixes for SR --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 1 + openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 66f431946d..14214b75d6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1166,6 +1166,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu, break; case NR_PUCCH_Resource__format_PR_format2 : pucch_pdu->format_type = 2; + pucch_pdu->sr_flag = O_sr; pucch_pdu->nr_of_symbols = pucchres->format.choice.format2->nrofSymbols; pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex; pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 2c4166f261..4d692baad6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1222,7 +1222,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot, int mod if (curr_pucch->active && curr_pucch->frame == SFN && curr_pucch->ul_slot == slot && - curr_pucch->resource_indicator == found) { + curr_pucch->resource_indicator == idx) { curr_pucch->sr_flag = true; found = true; break; @@ -1230,7 +1230,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot, int mod else if (!curr_pucch->active) free_pucch = i; // found an available pucch structure } - AssertFatal(found || free_pucch>0, "Coulnd't find an available PUCCH resource to schedule SR\n"); + AssertFatal(found || free_pucch>-1, "Coulnd't find an available PUCCH resource to schedule SR\n"); if (!found) { uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[slot * MAX_BWP_SIZE]; int bwp_start = ul_bwp->BWPStart; From 8c5cf09826eb38bce000a613e25c0565d979d477 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 29 Sep 2022 16:54:33 +0200 Subject: [PATCH 04/49] addressing review --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 27 +++++++++---------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 2 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 4 +-- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index ac9b86e5c9..84f90d48ae 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -236,7 +236,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_ue_spec(module_idP, frame, slot); stop_meas(&gNB->schedule_dlsch); - nr_sr_reporting(RC.nrmac[module_idP], frame, slot, module_idP); + nr_sr_reporting(RC.nrmac[module_idP], frame, slot); nr_schedule_pucch(RC.nrmac[module_idP], frame, slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 4d692baad6..6ece1ef4f1 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1099,8 +1099,8 @@ int nr_acknack_scheduling(int mod_id, if (curr_pucch->active && curr_pucch->frame == pucch_frame && curr_pucch->ul_slot == pucch_slot) { - LOG_D(NR_MAC, "In %s: pucch_acknak DL %4d.%2d, UL_ACK %4d.%2d Bits already in current PUCCH: DAI_C %d CSI %d\n", - __FUNCTION__, frame, slot, pucch_frame, pucch_slot, curr_pucch->dai_c, curr_pucch->csi_bits); + LOG_D(NR_MAC, "pucch_acknak DL %4d.%2d, UL_ACK %4d.%2d Bits already in current PUCCH: DAI_C %d CSI %d\n", + frame, slot, pucch_frame, pucch_slot, curr_pucch->dai_c, curr_pucch->csi_bits); // we can't schedule if short pucch is already full if (curr_pucch->csi_bits == 0 && curr_pucch->dai_c == 2) @@ -1117,8 +1117,8 @@ int nr_acknack_scheduling(int mod_id, // no need to check VRB occupation because already done when PUCCH has been activated curr_pucch->timing_indicator = f; curr_pucch->dai_c++; - LOG_D(NR_MAC, "In %s: DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d CSI %d\n", - __FUNCTION__,frame,slot,curr_pucch->frame,curr_pucch->ul_slot,i,f,curr_pucch->dai_c,curr_pucch->csi_bits); + LOG_D(NR_MAC, "DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d CSI %d\n", + frame,slot,curr_pucch->frame,curr_pucch->ul_slot,i,f,curr_pucch->dai_c,curr_pucch->csi_bits); return i; // index of current PUCCH structure } else if (!curr_pucch->active) @@ -1137,8 +1137,8 @@ int nr_acknack_scheduling(int mod_id, bwp_start, bwp_size); if(!ret) { - LOG_D(NR_MAC, "In %s: DL %4d.%2d, UL_ACK %4d.%2d PRB resources for this occasion are already occupied, move to the following occasion\n", - __FUNCTION__,frame,slot,curr_pucch->frame,curr_pucch->ul_slot); + LOG_D(NR_MAC, "DL %4d.%2d, UL_ACK %4d.%2d PRB resources for this occasion are already occupied, move to the following occasion\n", + frame,slot,curr_pucch->frame,curr_pucch->ul_slot); continue; } // allocating a new PUCCH structure for this occasion @@ -1150,30 +1150,27 @@ int nr_acknack_scheduling(int mod_id, curr_pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources curr_pucch->r_pucch=r_pucch; - LOG_D(NR_MAC, "In %s: DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d\n", - __FUNCTION__,frame,slot,curr_pucch->frame,curr_pucch->ul_slot,inactive_pucch,f,curr_pucch->dai_c); + LOG_D(NR_MAC, "DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d\n", + frame,slot,curr_pucch->frame,curr_pucch->ul_slot,inactive_pucch,f,curr_pucch->dai_c); // blocking resources for current PUCCH in VRB map for (int l=0; lnr_of_symb; l++) { uint16_t symb = SL_to_bitmap(curr_pucch->start_symb+l, 1); - int prb; + int prb = curr_pucch->prb_start; if (l==1 && curr_pucch->second_hop_prb != 0) prb = curr_pucch->second_hop_prb; - else - prb = curr_pucch->prb_start; vrb_map_UL[bwp_start+prb] |= symb; } return inactive_pucch; // index of current PUCCH structure } } - LOG_D(NR_MAC, "In %s: DL %4d.%2d, Couldn't find scheduling occasion for this HARQ process\n", - __FUNCTION__, frame, slot); + LOG_D(NR_MAC, "DL %4d.%2d, Couldn't find scheduling occasion for this HARQ process\n", frame, slot); return -1; } -void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot, int mod_id) +void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) { if (!is_xlsch_in_slot(nrmac->ulsch_slot_bitmap[slot / 64], slot)) return; @@ -1232,7 +1229,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot, int mod } AssertFatal(found || free_pucch>-1, "Coulnd't find an available PUCCH resource to schedule SR\n"); if (!found) { - uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[slot * MAX_BWP_SIZE]; + uint16_t *vrb_map_UL = &nrmac->common_channels[CC_id].vrb_map_UL[slot * MAX_BWP_SIZE]; int bwp_start = ul_bwp->BWPStart; int bwp_size = ul_bwp->BWPSize; NR_sched_pucch_t *sched_sr = &sched_ctrl->sched_pucch[free_pucch]; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index c7c44f95d7..2e3ccf4ba6 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -493,7 +493,7 @@ int get_mcs_from_bler(const NR_bler_options_t *bler_options, void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCommon_t *scc, int n, int CCid); -void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP, int mod_id); +void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP); size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset_rsrp); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index a74dafa29c..17f0504e15 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -563,8 +563,8 @@ typedef struct { int cce_index; uint8_t aggregation_level; - /// PUCCH scheduling information. Array of two: HARQ+SR in the first field, - /// CSI in second. This order is important for nr_acknack_scheduling()! + /// Array of PUCCH scheduling information. + /// Its size depends on TDD configuration and max feedback time NR_sched_pucch_t *sched_pucch; int sched_pucch_size; From 44ee11be8ecd3c122ed61f5f40e41e2bfcb6997f Mon Sep 17 00:00:00 2001 From: francescomani Date: Sun, 16 Oct 2022 10:22:37 +0200 Subject: [PATCH 05/49] cleanup NR UE dead code --- CMakeLists.txt | 1 - .../utils/telnetsrv/telnetsrv_cpumeasur_def.h | 5 - .../nfapi/public_inc/fapi_nr_ue_interface.h | 435 +--------- openair1/PHY/INIT/nr_init_ue.c | 18 - openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c | 2 +- openair1/PHY/NR_TRANSPORT/nr_prach_common.c | 1 - openair1/PHY/NR_UE_TRANSPORT/dci_nr.h | 120 --- openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c | 95 --- .../nr_dlsch_llr_computation.c | 152 ---- .../PHY/NR_UE_TRANSPORT/nr_initial_sync.c | 11 - .../NR_UE_TRANSPORT/nr_transport_proto_ue.h | 770 +----------------- openair1/PHY/defs_nr_UE.h | 225 ----- openair1/PHY/phy_vars_nr_ue.h | 3 - openair1/SCHED_NR_UE/defs.h | 223 ----- openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 315 ------- openair1/SCHED_NR_UE/pucch_uci_ue_nr.c | 3 - openair2/LAYER2/NR_MAC_UE/mac_defs.h | 79 -- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 10 - openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 1 - 19 files changed, 20 insertions(+), 2449 deletions(-) delete mode 100644 openair1/PHY/NR_UE_TRANSPORT/dci_nr.h delete mode 100644 openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 95667e42e9..3e4b48b332 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1683,7 +1683,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/ ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_prach.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_nr.c - ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_tools_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/pucch_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/csi_rx.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_uci_tools_common.c diff --git a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h index 5905732df8..a3f60a5bec 100644 --- a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h +++ b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h @@ -134,11 +134,6 @@ {"dlsch_tc_intl1_stats", &(UE->dlsch_tc_intl1_stats),0,1},\ {"dlsch_tc_intl2_stats", &(UE->dlsch_tc_intl2_stats),0,1},\ {"tx_prach", &(UE->tx_prach),0,1},\ - {"dlsch_encoding_SIC_stats", &(UE->dlsch_encoding_SIC_stats),0,1},\ - {"dlsch_scrambling_SIC_stats", &(UE->dlsch_scrambling_SIC_stats),0,1},\ - {"dlsch_modulation_SIC_stats", &(UE->dlsch_modulation_SIC_stats),0,1},\ - {"dlsch...ping_unit_SIC_stats", &(UE->dlsch_llr_stripping_unit_SIC_stats),0,1},\ - {"dlsch_unscrambling_SIC_stats", &(UE->dlsch_unscrambling_SIC_stats),0,1},\ {"ue_front_end_stat", &(UE->ue_front_end_stat),0,1},\ {"ue_front_end_per_slot_stat", &(UE->ue_front_end_per_slot_stat[0]),0,LTE_SLOTS_PER_SUBFRAME},\ {"pdcch_procedures_stat", &(UE->pdcch_procedures_stat),0,1},\ diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index 7c91b06962..656399df97 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -92,7 +92,6 @@ typedef struct { int N_CCE; uint8_t payloadSize; uint8_t payloadBits[16] __attribute__((aligned(16))); // will be cast as uint64 - //fapi_nr_dci_pdu_rel15_t dci; } fapi_nr_dci_indication_pdu_t; @@ -423,7 +422,7 @@ typedef struct{ } fapi_nr_dl_srs_config_t; typedef enum{vrb_to_prb_mapping_non_interleaved = 0, vrb_to_prb_mapping_interleaved = 1} vrb_to_prb_mapping_t; -//typedef fapi_nr_dci_pdu_rel15_t fapi_nr_dl_config_dlsch_pdu_rel15_t; + typedef struct { uint16_t BWPSize; uint16_t BWPStart; @@ -542,438 +541,6 @@ typedef struct { fapi_nr_dl_config_request_pdu_t dl_config_list[FAPI_NR_DL_CONFIG_LIST_NUM]; } fapi_nr_dl_config_request_t; - -// -// P5 -// - - - -typedef struct { - fapi_nr_coreset_t coreset; - - uint8_t monitoring_slot_peridicity; - uint8_t monitoring_slot_offset; - uint16_t duration; - uint16_t monitoring_symbols_within_slot; - uint8_t number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 - - uint8_t dci_2_0_number_of_candidates[5]; // aggregation level 1, 2, 4, 8, 16 - uint8_t dci_2_3_monitorying_periodicity; - uint8_t dci_2_3_number_of_candidates; - -} fapi_nr_search_space_t; - -typedef struct { - fapi_nr_search_space_t search_space_sib1; - fapi_nr_search_space_t search_space_others_sib; - fapi_nr_search_space_t search_space_paging; - //fapi_nr_coreset_t coreset_ra; // common coreset - fapi_nr_search_space_t search_space_ra; -} fapi_nr_pdcch_config_common_t; - -typedef struct { - uint8_t k0; - uint8_t mapping_type; - uint8_t symbol_starting; - uint8_t symbol_length; -} fapi_nr_pdsch_time_domain_resource_allocation_t; - -typedef struct { - fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS]; -} fapi_nr_pdsch_config_common_t; - -typedef struct { - uint8_t prach_configuration_index; - uint8_t msg1_fdm; - uint8_t msg1_frequency_start; - uint8_t zero_correlation_zone_config; - uint8_t preamble_received_target_power; - uint8_t preamble_transmission_max; - uint8_t power_ramping_step; - uint8_t ra_window_size; - - uint8_t total_number_of_preamble; - uint8_t ssb_occasion_per_rach; - uint8_t cb_preamble_per_ssb; - - uint8_t group_a_msg3_size; - uint8_t group_a_number_of_preamble; - uint8_t group_b_power_offset; - uint8_t contention_resolution_timer; - uint8_t rsrp_threshold_ssb; - uint8_t rsrp_threshold_ssb_sul; - uint8_t prach_length; // l839, l139 - uint8_t prach_root_sequence_index; // 0 - 837 for l839, 0 - 137 for l139 - uint8_t msg1_subcarrier_spacing; - uint8_t restrictedset_config; - uint8_t msg3_transform_precoding; -} fapi_nr_rach_config_common_t; - -typedef struct { - uint8_t k2; - uint8_t mapping_type; - uint8_t symbol_starting; - uint8_t symbol_length; -} fapi_nr_pusch_time_domain_resource_allocation_t; - -typedef struct { - uint8_t group_hopping_enabled_transform_precoding; - fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS]; - uint8_t msg3_delta_preamble; - uint8_t p0_nominal_with_grant; -} fapi_nr_pusch_config_common_t; - -typedef struct { - uint8_t pucch_resource_common; - uint8_t pucch_group_hopping; - uint8_t hopping_id; - uint8_t p0_nominal; -} fapi_nr_pucch_config_common_t; - -typedef struct { - - fapi_nr_pdcch_config_common_t pdcch_config_common; - fapi_nr_pdsch_config_common_t pdsch_config_common; - -} fapi_nr_dl_bwp_common_config_t; - - - -typedef struct { - uint16_t int_rnti; - uint8_t time_frequency_set; - uint8_t dci_payload_size; - uint8_t serving_cell_id[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell - uint8_t position_in_dci[FAPI_NR_MAX_NUM_SERVING_CELLS]; // interrupt configuration per serving cell -} fapi_nr_downlink_preemption_t; - -typedef struct { - uint8_t tpc_index; - uint8_t tpc_index_sul; - uint8_t target_cell; -} fapi_nr_pusch_tpc_command_config_t; - -typedef struct { - uint8_t tpc_index_pcell; - uint8_t tpc_index_pucch_scell; -} fapi_nr_pucch_tpc_command_config_t; - -typedef struct { - uint8_t starting_bit_of_format_2_3; - uint8_t feild_type_format_2_3; -} fapi_nr_srs_tpc_command_config_t; - -typedef struct { - fapi_nr_downlink_preemption_t downlink_preemption; - fapi_nr_pusch_tpc_command_config_t tpc_pusch; - fapi_nr_pucch_tpc_command_config_t tpc_pucch; - fapi_nr_srs_tpc_command_config_t tpc_srs; -} fapi_nr_pdcch_config_dedicated_t; - -typedef struct { - uint8_t dmrs_type; - uint8_t dmrs_addition_position; - uint8_t max_length; - uint16_t scrambling_id0; - uint16_t scrambling_id1; - uint8_t ptrs_frequency_density[2]; // phase tracking rs - uint8_t ptrs_time_density[3]; // phase tracking rs - uint8_t ptrs_epre_ratio; // phase tracking rs - uint8_t ptrs_resource_element_offset; // phase tracking rs -} fapi_nr_dmrs_downlink_config_t; - -typedef struct { - uint8_t bwp_or_cell_level; - uint8_t pattern_type; - uint32_t resource_blocks[9]; // bitmaps type 275 bits - uint8_t slot_type; // bitmaps type one/two slot(s) - uint32_t symbols_in_resouece_block; // bitmaps type 14/28 bits - uint8_t periodic; // bitmaps type - uint32_t pattern[2]; // bitmaps type 2/4/5/8/10/20/40 bits - - fapi_nr_coreset_t coreset; // coreset - - uint8_t subcarrier_spacing; - uint8_t mode; -} fapi_nr_rate_matching_pattern_group_t; - -typedef struct { - // resource mapping - uint8_t row; // row1/row2/row4/other - uint16_t frequency_domain_allocation; // 4/12/3/6 bits - uint8_t number_of_ports; - uint8_t first_ofdm_symbol_in_time_domain; - uint8_t first_ofdm_symbol_in_time_domain2; - uint8_t cdm_type; - uint8_t density; // .5/1/3 - uint8_t density_dot5_type; // even/odd PRBs - - uint8_t frequency_band_starting_rb; // freqBand - uint8_t frequency_band_number_of_rb; // freqBand - - // periodicityAndOffset - uint8_t periodicity; // slot4/5/8/10/16/20/32/40/64/80/160/320/640 - uint32_t offset; // 0..639 bits -} fapi_nr_zp_csi_rs_resource_t; - -typedef struct { - uint16_t data_scrambling_id_pdsch; - fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_a; - fapi_nr_dmrs_downlink_config_t dmrs_dl_for_pdsch_mapping_type_b; - uint8_t vrb_to_prb_interleaver; - uint8_t resource_allocation; - fapi_nr_pdsch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_DL_ALLOCATIONS]; - uint8_t pdsch_aggregation_factor; - fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group1; - fapi_nr_rate_matching_pattern_group_t rate_matching_pattern_group2; - uint8_t rbg_size; - uint8_t mcs_table; - uint8_t max_num_of_code_word_scheduled_by_dci; - uint8_t bundle_size; // prb_bundling static - uint8_t bundle_size_set1; // prb_bundling dynamic - uint8_t bundle_size_set2; // prb_bundling dynamic - fapi_nr_zp_csi_rs_resource_t periodically_zp_csi_rs_resource_set[FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET]; -} fapi_nr_pdsch_config_dedicated_t; - -typedef struct { - uint16_t starting_prb; - uint8_t intra_slot_frequency_hopping; - uint16_t second_hop_prb; - uint8_t format; // pucch format 0..4 - uint8_t initial_cyclic_shift; - uint8_t number_of_symbols; - uint8_t starting_symbol_index; - uint8_t time_domain_occ; - uint8_t number_of_prbs; - uint8_t occ_length; - uint8_t occ_index; -} fapi_nr_pucch_resource_t; - -typedef struct { - uint8_t periodicity; - uint8_t number_of_harq_process; - fapi_nr_pucch_resource_t n1_pucch_an; -} fapi_nr_sps_config_t; - -typedef struct { - uint8_t beam_failure_instance_max_count; - uint8_t beam_failure_detection_timer; -} fapi_nr_radio_link_monitoring_config_t; - -typedef struct { - fapi_nr_pdcch_config_dedicated_t pdcch_config_dedicated; - fapi_nr_pdsch_config_dedicated_t pdsch_config_dedicated; - fapi_nr_sps_config_t sps_config; - fapi_nr_radio_link_monitoring_config_t radio_link_monitoring_config; - -} fapi_nr_dl_bwp_dedicated_config_t; - -typedef struct { - fapi_nr_rach_config_common_t rach_config_common; - fapi_nr_pusch_config_common_t pusch_config_common; - fapi_nr_pucch_config_common_t pucch_config_common; - -} fapi_nr_ul_bwp_common_config_t; - -typedef struct { - uint8_t inter_slot_frequency_hopping; - uint8_t additional_dmrs; - uint8_t max_code_rate; - uint8_t number_of_slots; - uint8_t pi2bpsk; - uint8_t simultaneous_harq_ack_csi; -} fapi_nr_pucch_format_config_t; - -typedef struct { - fapi_nr_pucch_format_config_t format1; - fapi_nr_pucch_format_config_t format2; - fapi_nr_pucch_format_config_t format3; - fapi_nr_pucch_format_config_t format4; - fapi_nr_pucch_resource_t multi_csi_pucch_resources[2]; - uint8_t dl_data_to_ul_ack[8]; - // pucch power control - uint8_t deltaF_pucch_f0; - uint8_t deltaF_pucch_f1; - uint8_t deltaF_pucch_f2; - uint8_t deltaF_pucch_f3; - uint8_t deltaF_pucch_f4; - uint8_t two_pucch_pc_adjusment_states; -} fapi_nr_pucch_config_dedicated_t; - -typedef struct { - uint8_t dmrs_type; - uint8_t dmrs_addition_position; - uint8_t ptrs_uplink_config; // to indicate if PTRS Uplink is configured of not - uint8_t ptrs_type; //cp-OFDM, dft-S-OFDM - uint16_t ptrs_frequency_density[2]; - uint8_t ptrs_time_density[3]; - uint8_t ptrs_max_number_of_ports; - uint8_t ptrs_resource_element_offset; - uint8_t ptrs_power; - uint16_t ptrs_sample_density[5]; - uint8_t ptrs_time_density_transform_precoding; - - uint8_t max_length; - uint16_t scrambling_id0; - uint16_t scrambling_id1; - uint8_t npusch_identity; - uint8_t disable_sequence_group_hopping; - uint8_t sequence_hopping_enable; -} fapi_nr_dmrs_uplink_config_t; - -typedef struct { - uint8_t tpc_accmulation; - uint8_t msg3_alpha; - uint8_t p0_nominal_with_grant; - uint8_t two_pusch_pc_adjustments_states; - uint8_t delta_mcs; -} fapi_nr_pusch_power_control_t; - -typedef enum {tx_config_codebook = 1, tx_config_nonCodebook = 2} tx_config_t; -typedef enum {transform_precoder_enabled = 0, transform_precoder_disabled = 1} transform_precoder_t; -typedef enum { - codebook_subset_fullyAndPartialAndNonCoherent = 1, - codebook_subset_partialAndNonCoherent = 2, - codebook_subset_nonCoherent = 3} codebook_subset_t; -typedef struct { - uint16_t data_scrambling_identity; - tx_config_t tx_config; - fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_a; - fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_b; - fapi_nr_pusch_power_control_t pusch_power_control; - uint8_t frequency_hopping; - uint16_t frequency_hopping_offset_lists[4]; - uint8_t resource_allocation; - fapi_nr_pusch_time_domain_resource_allocation_t allocation_list[FAPI_NR_MAX_NUM_UL_ALLOCATIONS]; - uint8_t pusch_aggregation_factor; - uint8_t mcs_table; - uint8_t mcs_table_transform_precoder; - transform_precoder_t transform_precoder; - codebook_subset_t codebook_subset; - uint8_t max_rank; - uint8_t rbg_size; - - //uci-OnPUSCH - uint8_t uci_on_pusch_type; //dynamic, semi-static - uint8_t beta_offset_ack_index1[4]; - uint8_t beta_offset_ack_index2[4]; - uint8_t beta_offset_ack_index3[4]; - uint8_t beta_offset_csi_part1_index1[4]; - uint8_t beta_offset_csi_part1_index2[4]; - uint8_t beta_offset_csi_part2_index1[4]; - uint8_t beta_offset_csi_part2_index2[4]; - - uint8_t tp_pi2BPSK; -} fapi_nr_pusch_config_dedicated_t; - -typedef struct { - uint8_t frequency_hopping; - fapi_nr_dmrs_uplink_config_t cg_dmrs_configuration; - uint8_t mcs_table; - uint8_t mcs_table_transform_precoder; - - //uci-OnPUSCH - uint8_t uci_on_pusch_type; //dynamic, semi-static - uint8_t beta_offset_ack_index1[4]; - uint8_t beta_offset_ack_index2[4]; - uint8_t beta_offset_ack_index3[4]; - uint8_t beta_offset_csi_part1_index1[4]; - uint8_t beta_offset_csi_part1_index2[4]; - uint8_t beta_offset_csi_part2_index1[4]; - uint8_t beta_offset_csi_part2_index2[4]; - - uint8_t resource_allocation; - // rgb-Size structure missing in spec. - uint8_t power_control_loop_to_use; - // p0-PUSCH-Alpha - uint8_t p0; - uint8_t alpha; - - uint8_t transform_precoder; - uint8_t number_of_harq_process; - uint8_t rep_k; - uint8_t rep_k_rv; - uint8_t periodicity; - uint8_t configured_grant_timer; - // rrc-ConfiguredUplinkGrant - uint16_t time_domain_offset; - uint8_t time_domain_allocation; - uint32_t frequency_domain_allocation; - uint8_t antenna_ports; - uint8_t dmrs_seq_initialization; - uint8_t precoding_and_number_of_layers; - uint8_t srs_resource_indicator; - uint8_t mcs_and_tbs; - uint8_t frequency_hopping_offset; - uint8_t path_loss_reference_index; - -} fapi_nr_configured_grant_config_t; - -typedef struct { - uint8_t qcl_type1_serving_cell_index; - uint8_t qcl_type1_bwp_id; - uint8_t qcl_type1_rs_type; // csi-rs or ssb - uint8_t qcl_type1_nzp_csi_rs_resource_id; - uint8_t qcl_type1_ssb_index; - uint8_t qcl_type1_type; - - uint8_t qcl_type2_serving_cell_index; - uint8_t qcl_type2_bwp_id; - uint8_t qcl_type2_rs_type; // csi-rs or ssb - uint8_t qcl_type2_nzp_csi_rs_resource_id; - uint8_t qcl_type2_ssb_index; - uint8_t qcl_type2_type; - -} fapi_nr_tci_state_t; - -typedef struct { - uint8_t root_sequence_index; - // rach genertic - uint8_t prach_configuration_index; - uint8_t msg1_fdm; - uint8_t msg1_frequency_start; - uint8_t zero_correlation_zone_config; - uint8_t preamble_received_target_power; - uint8_t preamble_transmission_max; - uint8_t power_ramping_step; - uint8_t ra_window_size; - - uint8_t rsrp_threshold_ssb; - // PRACH-ResourceDedicatedBFR - uint8_t bfr_ssb_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - uint8_t bfr_ssb_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - // NZP-CSI-RS-Resource - uint8_t bfr_csi_rs_nzp_resource_mapping[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - uint8_t bfr_csi_rs_power_control_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - uint8_t bfr_csi_rs_power_control_offset_ss[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - uint16_t bfr_csi_rs_scrambling_id[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - uint8_t bfr_csi_rs_resource_periodicity[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - uint16_t bfr_csi_rs_resource_offset[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - fapi_nr_tci_state_t qcl_infomation_periodic_csi_rs[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - - uint8_t bfr_csirs_ra_occasions[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS]; - uint8_t bfr_csirs_ra_preamble_index[FAPI_NR_MAX_NUM_CANDIDATE_BEAMS][FAPI_NR_MAX_RA_OCCASION_PER_CSIRS]; - - uint8_t ssb_per_rach_occasion; - uint8_t ra_ssb_occasion_mask_index; - fapi_nr_search_space_t recovery_search_space; - // RA-Prioritization - uint8_t power_ramping_step_high_priority; - uint8_t scaling_factor_bi; - uint8_t beam_failure_recovery_timer; -} fapi_nr_beam_failure_recovery_config_t; - -typedef struct { - fapi_nr_pucch_config_dedicated_t pucch_config_dedicated; - fapi_nr_pusch_config_dedicated_t pusch_config_dedicated; - fapi_nr_configured_grant_config_t configured_grant_config; - // SRS-Config - uint8_t srs_tpc_accumulation; - fapi_nr_beam_failure_recovery_config_t beam_failure_recovery_config; - -} fapi_nr_ul_bwp_dedicated_config_t; - #define FAPI_NR_CONFIG_REQUEST_MASK_PBCH 0x01 #define FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_COMMON 0x02 #define FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_COMMON 0x04 diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 77502dfc12..cfac3a77f8 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -498,15 +498,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) } - ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) ); ue->init_averaging = 1; - // default value until overwritten by RRCConnectionReconfiguration - if (fp->nb_antenna_ports_gNB==2) - ue->pdsch_config_dedicated->p_a = dBm3; - else - ue->pdsch_config_dedicated->p_a = dB0; - // enable MIB/SIB decoding by default ue->decode_MIB = 1; ue->decode_SIB = 1; @@ -632,7 +625,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) free_and_zero(ue->prs_vars[idx]); } - free_and_zero(ue->sinr_CQI_dB); } void term_nr_ue_transport(PHY_VARS_NR_UE *ue) @@ -668,7 +660,6 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,ue->max_ldpc_iterations,ue->frame_parms.N_RB_DL); ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,ue->max_ldpc_iterations,ue->frame_parms.N_RB_DL); - ue->transmission_mode[i] = ue->frame_parms.nb_antenna_ports_gNB==1 ? 1 : 2; } //ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1; @@ -726,15 +717,6 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) { load_dftslib(); init_context_synchro_nr(frame_parms); generate_ul_reference_signal_sequences(SHRT_MAX); - // Polar encoder init for PBCH - //lte_sync_time_init(frame_parms); - //generate_ul_ref_sigs(); - //generate_ul_ref_sigs_rx(); - //generate_64qam_table(); - //generate_16qam_table(); - //generate_RIV_tables(); - //init_unscrambling_lut(); - //set_taus_seed(1328); } void phy_term_nr_top(void) diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c index c3c4c7a2ee..43373475a4 100644 --- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c +++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c @@ -230,7 +230,7 @@ void generate_ul_reference_signal_sequences(unsigned int scaling) if (already_called) return; already_called = true; - unsigned int u,v,Msc_RS; + unsigned int u,v,Msc_RS; #if 0 diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach_common.c b/openair1/PHY/NR_TRANSPORT/nr_prach_common.c index 84118e8267..c155721eae 100644 --- a/openair1/PHY/NR_TRANSPORT/nr_prach_common.c +++ b/openair1/PHY/NR_TRANSPORT/nr_prach_common.c @@ -113,7 +113,6 @@ void compute_nr_prach_seq(uint8_t short_sequence, LOG_D(PHY,"compute_prach_seq: prach short sequence %x, num_sequences %d, rootSequenceIndex %d\n", short_sequence, num_sequences, rootSequenceIndex); N_ZC = (short_sequence) ? 139 : 839; - //init_prach_tables(N_ZC); //moved to phy_init_lte_ue/eNB, since it takes to long in real-time init_nr_prach_tables(N_ZC); diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.h b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.h deleted file mode 100644 index 7bbc59ede2..0000000000 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file PHY/LTE_TRANSPORT/dci_nr.h -* \brief typedefs for NR DCI structures from 38-212. -* \author R. Knopp, A. Mico Pereperez -* \date 2018 -* \version 0.1 -* \company Eurecom -* \email: knopp@eurecom.fr -* \note -* \warning -*/ - -#ifndef __PHY_NR_UE_TRANSPORT_DCI_NR__H__ -#define __PHY_NR_UE_TRANSPORT_DCI_NR__H__ - -#include - -#define MAX_DCI_SIZE_BITS 45 - - -#define NR_PDCCH_DCI_H -#ifdef NR_PDCCH_DCI_H - -struct NR_DCI_INFO_EXTRACTED { - uint8_t identifier_dci_formats ; // 0 IDENTIFIER_DCI_FORMATS: - uint8_t carrier_ind ; // 1 CARRIER_IND: 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213] - uint8_t sul_ind_0_1 ; // 2 SUL_IND_0_1: - uint8_t slot_format_ind ; // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213] - uint8_t pre_emption_ind ; // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits - uint8_t block_number ; // 5 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3 - uint8_t close_loop_ind ; // 6 CLOSE_LOOP_IND: - uint8_t bandwidth_part_ind ; // 7 BANDWIDTH_PART_IND: - uint8_t short_message_ind ; // 8 SHORT_MESSAGE_IND: - uint8_t short_messages ; // 9 SHORT_MESSAGES: - uint16_t freq_dom_resource_assignment_UL; // 10 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered - // (NOTE 1) If DCI format 0_0 is monitored in common search space - // and if the number of information bits in the DCI format 0_0 prior to padding - // is larger than the payload size of the DCI format 1_0 monitored in common search space - // the bitwidth of the frequency domain resource allocation field in the DCI format 0_0 - // is reduced such that the size of DCI format 0_0 equals to the size of the DCI format 1_0 - uint16_t freq_dom_resource_assignment_DL; // 11 FREQ_DOM_RESOURCE_ASSIGNMENT_DL: - uint8_t time_dom_resource_assignment ; // 12 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits, - // where I the number of entries in the higher layer parameter pusch-AllocationList - uint8_t vrb_to_prb_mapping ; // 13 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0 - uint8_t prb_bundling_size_ind ; // 14 PRB_BUNDLING_SIZE_IND:0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214] - uint8_t rate_matching_ind ; // 15 RATE_MATCHING_IND: 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set - uint8_t zp_csi_rs_trigger ; // 16 ZP_CSI_RS_TRIGGER: - uint8_t freq_hopping_flag ; // 17 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0 - uint8_t tb1_mcs ; // 18 TB1_MCS: - uint8_t tb1_ndi ; // 19 TB1_NDI: - uint8_t tb1_rv ; // 20 TB1_RV: - uint8_t tb2_mcs ; // 21 TB2_MCS: - uint8_t tb2_ndi ; // 22 TB2_NDI: - uint8_t tb2_rv ; // 23 TB2_RV: - uint8_t mcs ; // 24 MCS: - uint8_t ndi ; // 25 NDI: - uint8_t rv ; // 26 RV: - uint8_t harq_process_number ; // 27 HARQ_PROCESS_NUMBER: - uint8_t dai ; // 28 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI - // 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI - // 0 otherwise - uint8_t first_dai ; // 29 FIRST_DAI: (1 or 2 bits) 1 bit for semi-static HARQ-ACK - uint8_t second_dai ; // 30 SECOND_DAI: (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks - uint8_t tb_scaling ; // 31 TB_SCALING: - uint8_t tpc_pusch ; // 32 TPC_PUSCH: - uint8_t tpc_pucch ; // 33 TPC_PUCCH: - uint8_t pucch_resource_ind ; // 34 PUCCH_RESOURCE_IND: - uint8_t pdsch_to_harq_feedback_time_ind ; // 35 PDSCH_TO_HARQ_FEEDBACK_TIME_IND: - uint8_t srs_resource_ind ; // 36 SRS_RESOURCE_IND: - uint8_t precod_nbr_layers ; // 37 PRECOD_NBR_LAYERS: - uint8_t antenna_ports ; // 38 ANTENNA_PORTS: - uint8_t tci ; // 39 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits - uint8_t srs_request ; // 40 SRS_REQUEST: - uint8_t tpc_cmd ; // 41 TPC_CMD: - uint8_t csi_request ; // 42 CSI_REQUEST: - uint8_t cbgti ; // 43 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH - uint8_t cbgfi ; // 44 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator - uint8_t ptrs_dmrs ; // 45 PTRS_DMRS: - uint8_t beta_offset_ind ; // 46 BETA_OFFSET_IND: - uint8_t dmrs_seq_ini ; // 47 DMRS_SEQ_INI: 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding - // is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise - uint8_t ul_sch_ind ; // 48 UL_SCH_IND: value of "1" indicates UL-SCH shall be transmitted on the PUSCH and a value of "0" indicates UL-SCH shall not be transmitted on the PUSCH - uint16_t padding_nr_dci ; // 49 PADDING_NR_DCI: (Note 2) If DCI format 0_0 is monitored in common search space - // and if the number of information bits in the DCI format 0_0 prior to padding - // is less than the payload size of the DCI format 1_0 monitored in common search space - // zeros shall be appended to the DCI format 0_0 - // until the payload size equals that of the DCI format 1_0 - uint8_t sul_ind_0_0 ; // 50 SUL_IND_0_0: - uint8_t ra_preamble_index ; // 51 RA_PREAMBLE_INDEX: - uint8_t sul_ind_1_0 ; // 52 SUL_IND_1_0: - uint8_t ss_pbch_index ; // 53 SS_PBCH_INDEX - uint8_t prach_mask_index ; // 54 PRACH_MASK_INDEX - uint8_t reserved_nr_dci ; // 55 RESERVED_NR_DCI -}; -typedef struct NR_DCI_INFO_EXTRACTED NR_DCI_INFO_EXTRACTED_t; - - -#endif -#endif - diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c deleted file mode 100644 index 8a4cafc6d7..0000000000 --- a/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -/*! \file PHY/LTE_TRANSPORT/dci_tools_nr.c - * \brief PHY Support routines (eNB/UE) for filling PDSCH/PUSCH/DLSCH/ULSCH data structures based on DCI PDUs generated by eNB MAC scheduler. - * \author R. Knopp, A. Mico Pereperez - * \date 2018 - * \version 0.1 - * \company Eurecom - * \email: knopp@eurecom.fr - * \note - * \warning - */ -//#include "PHY/defs.h" -#include -#include "PHY/defs_nr_UE.h" -//#include "PHY/NR_TRANSPORT/nr_dci.h" -//#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h" -//#include "PHY/extern.h" -//#include "SCHED/defs.h" -#ifdef DEBUG_DCI_TOOLS - #include "PHY/vars.h" -#endif -#include "assertions.h" - -#include "SCHED_NR_UE/harq_nr.h" - -//#define DEBUG_HARQ - -//#define DEBUG_DCI -#define NR_PDCCH_DCI_TOOLS -//#define NR_PDCCH_DCI_TOOLS_DEBUG - - - - - - -uint8_t nr_subframe2harq_pid(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t slot) { - /* - #ifdef DEBUG_DCI - if (frame_parms->frame_type == TDD) - printf("dci_tools.c: subframe2_harq_pid, subframe %d for TDD configuration %d\n",subframe,frame_parms->tdd_config); - else - printf("dci_tools.c: subframe2_harq_pid, subframe %d for FDD \n",subframe); - #endif - */ - uint8_t ret = 255; - uint8_t subframe = slot / frame_parms->slots_per_subframe; - - AssertFatal(1==0,"Not ready for this ...\n"); - if (frame_parms->frame_type == FDD) { - ret = (((frame<<1)+slot)&7); - } else { - - } - - - if (ret == 255) { - LOG_E(PHY, "invalid harq_pid(%d) at SFN/SF = %d/%d\n", ret, frame, subframe); - //mac_xface->macphy_exit("invalid harq_pid"); - } - - return ret; -} - -uint8_t nr_pdcch_alloc2ul_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t n) { - - AssertFatal(1==0,"Not ready for this\n"); - -} - -uint32_t nr_pdcch_alloc2ul_frame(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n) { - - AssertFatal(1==0,"Not ready for this\n"); - -} diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c index 97efa04932..6f8ec17f58 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_llr_computation.c @@ -910,158 +910,6 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, #endif } -//#if 0 -void nr_dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **sic_buffer, //Q15 - int32_t **rho_i, - int16_t *dlsch_llr, - uint8_t num_pdcch_symbols, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint16_t nb_rb, - uint8_t subframe, - uint16_t mod_order_0, - uint32_t rb_alloc) -{ - int16_t rho_amp_x0[2*frame_parms->N_RB_DL*12]; - int16_t rho_rho_amp_x0[2*frame_parms->N_RB_DL*12]; - uint16_t amp_tmp; - uint16_t *llr32=(uint16_t*)dlsch_llr; - int i, len, nsymb, len2; - uint8_t symbol, symbol_mod; - int len_acc=0; - uint16_t *sic_data; - uint16_t pbch_pss_sss_adjust; - unsigned char len_mod4=0; - uint16_t *llr2; - __m128i *ch_mag,*ch_magb; - - nsymb = (frame_parms->Ncp==0) ? 14:12; - - for (symbol=num_pdcch_symbols; symbolN_RB_DL*12)]); - int16_t *rho_1=(int16_t*)(&rho_i[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]); - ch_mag = (__m128i*)(&dl_ch_mag[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]); - ch_magb = (__m128i*)(&dl_ch_magb[0][((int16_t)symbol*frame_parms->N_RB_DL*12)]); - sic_data = (uint16_t*)(&sic_buffer[0][((int16_t)len_acc)]); - - symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; - - pbch_pss_sss_adjust=adjust_G2(frame_parms->Ncp,frame_parms->frame_type, frame_parms->N_RB_DL,&rb_alloc,6,subframe,symbol); - - if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) { - amp_tmp = 0x1fff;//dlsch0->sqrt_rho_b; already taken into account - if (frame_parms->nb_antenna_ports_gNB!=1) - len = nb_rb*8 - (2*pbch_pss_sss_adjust/3); - else - len = nb_rb*10 - (5*pbch_pss_sss_adjust/6); - } else { - amp_tmp = 0x1fff; //dlsch0->sqrt_rho_a; already taken into account - len = nb_rb*12 - pbch_pss_sss_adjust; - } - - if (mod_order_0==6) - amp_tmp=amp_tmp<<1; // to compensate for >> 1 shift in modulation - - len_acc+=len; - - multadd_complex_vector_real_scalar((int16_t *)sic_data, - amp_tmp, - (int16_t *)rho_amp_x0, //this is in Q13 - 1, - len); - - mult_cpx_vector((int16_t *)rho_1, //Q15 - (int16_t *)rho_amp_x0, //Q13 - (int16_t*)rho_rho_amp_x0, - len, - 13); - - sub_cpx_vector16((int16_t *)rxF, - (int16_t *)rho_rho_amp_x0, - //(int16_t *)clean_x1, - (int16_t *)rxF, - len*2); - - llr2 = llr32; - llr32 += (len*6); - - len_mod4 =len&3; - len2=len>>2; // length in quad words (4 REs) - len2+=(len_mod4?0:1); - - - - for (i=0; i %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n", - ue->Mod_id, - ue->proc.proc_rxtx[0].frame_rx, - duplex_string[fp->frame_type], - prefix_string[fp->Ncp], - fp->Nid_cell, - fp->N_RB_DL, - fp->phich_config_common.phich_duration, - phich_string[fp->phich_config_common.phich_resource], - fp->nb_antenna_ports_gNB);*/ - #if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", ue->Mod_id, diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h index d0ecc50fe1..48426a1774 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h @@ -36,6 +36,7 @@ #include "PHY/NR_TRANSPORT/nr_transport_common_proto.h" #include #include "nfapi_interface.h" +#include #define NR_PUSCH_x 2 // UCI placeholder bit TS 38.212 V15.4.0 subclause 5.3.3.1 #define NR_PUSCH_y 3 // UCI placeholder bit @@ -99,7 +100,7 @@ int32_t nr_dlsch_qpsk_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t **rho_i, int16_t *dlsch_llr, uint8_t symbol, - uint32_t len, + uint32_t len, uint8_t first_symbol_flag, uint16_t nb_rb, uint16_t pbch_pss_sss_adj, @@ -475,8 +476,8 @@ int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t *rxdataF_comp, int16_t *dlsch_llr, uint8_t symbol, - uint32_t len, - uint8_t first_symbol_flag, + uint32_t len, + uint8_t first_symbol_flag, uint16_t nb_rb, uint8_t beamforming_mode); @@ -494,17 +495,6 @@ int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms, @param beamforming_mode beamforming mode */ -int32_t nr_dlsch_qpsk_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, - int **rxdataF_comp, - int32_t **sic_buffer, - int **rho_i, - short *dlsch_llr, - uint8_t num_pdcch_symbols, - uint16_t nb_rb, - uint8_t subframe, - uint16_t mod_order_0, - uint32_t rb_alloc); - void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t *rxdataF_comp, int16_t *dlsch_llr, @@ -527,30 +517,6 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms, @param pbch_pss_sss_adjust PBCH/PSS/SSS RE adjustment (in REs) @param beamforming_mode beamforming mode */ -void nr_dlsch_16qam_llr_SIC (NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **sic_buffer, //Q15 - int32_t **rho_i, - int16_t *dlsch_llr, - uint8_t num_pdcch_symbols, - int32_t **dl_ch_mag, - uint16_t nb_rb, - uint8_t subframe, - uint16_t mod_order_0, - uint32_t rb_alloc); - -void dlsch_64qam_llr_SIC(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **sic_buffer, //Q15 - int32_t **rho_i, - int16_t *dlsch_llr, - uint8_t num_pdcch_symbols, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint16_t nb_rb, - uint8_t subframe, - uint16_t mod_order_0, - uint32_t rb_alloc); void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms, int32_t *rxdataF_comp, @@ -575,110 +541,6 @@ void nr_dlsch_256qam_llr(NR_DL_FRAME_PARMS *frame_parms, uint16_t nb_rb, uint8_t beamforming_mode); -/** \fn dlsch_siso(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - uint8_t l, - uint16_t nb_rb) - \brief This function does the first stage of llr computation for SISO, by just extracting the pilots, PBCH and primary/secondary synchronization sequences. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param rxdataF_comp_i Compensated channel output for interference - @param l symbol in sub-frame - @param nb_rb Number of RBs in this allocation -*/ - -void dlsch_siso(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - uint8_t l, - uint16_t nb_rb); - -/** \fn dlsch_alamouti(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb) - \brief This function does Alamouti combining on RX and prepares LLR inputs by skipping pilots, PBCH and primary/secondary synchronization signals. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param symbol Symbol in sub-frame - @param nb_rb Number of RBs in this allocation -*/ -void dlsch_alamouti(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb); - -/** \fn dlsch_antcyc(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb) - \brief This function does antenna selection (based on antenna cycling pattern) on RX and prepares LLR inputs by skipping pilots, PBCH and primary/secondary synchronization signals. Note that this is not LTE, it is just included for comparison purposes. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param symbol Symbol in sub-frame - @param nb_rb Number of RBs in this allocation -*/ -void dlsch_antcyc(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb); - -/** \fn dlsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - int32_t **rho, - int32_t **rho_i, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - uint8_t symbol, - uint16_t nb_rb, - uint8_t dual_stream_UE) - - \brief This function does maximal-ratio combining for dual-antenna receivers. - @param frame_parms Frame descriptor structure - @param rxdataF_comp Compensated channel output - @param rxdataF_comp_i Compensated channel output for interference - @param rho Cross correlation between spatial channels - @param rho_i Cross correlation between signal and inteference channels - @param dl_ch_mag First squared-magnitude of channel (16QAM and 64QAM) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param dl_ch_magb Second squared-magnitude of channel (64QAM only) for LLR computation. Alamouti combining should be performed on this as well. Result is stored in first antenna position - @param symbol Symbol in sub-frame - @param nb_rb Number of RBs in this allocation - @param dual_stream_UE Flag to indicate dual-stream detection -*/ -void dlsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, - int32_t **rxdataF_comp, - int32_t **rxdataF_comp_i, - int32_t **rho, - int32_t **rho_i, - int32_t **dl_ch_mag, - int32_t **dl_ch_magb, - int32_t **dl_ch_mag_i, - int32_t **dl_ch_magb_i, - uint8_t symbol, - uint16_t nb_rb, - uint8_t dual_stream_UE); - -void dlsch_detection_mrc_TM34(NR_DL_FRAME_PARMS *frame_parms, - NR_UE_PDSCH *lte_ue_pdsch_vars, - int harq_pid, - int round, - unsigned char symbol, - unsigned short nb_rb, - unsigned char dual_stream_UE); /** \fn dlsch_extract_rbs(int32_t **rxdataF, int32_t **dl_ch_estimates, @@ -719,36 +581,6 @@ void nr_dlsch_extract_rbs(int **rxdataF, uint16_t dlDmrsSymbPos, int chest_time_type); -/** \fn dlsch_extract_rbs_TM7(int32_t **rxdataF, - int32_t **dl_bf_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_bf_ch_estimates_ext, - uint32_t *rb_alloc, - uint8_t symbol, - uint8_t subframe, - uint32_t high_speed_flag, - NR_DL_FRAME_PARMS *frame_parms) - \brief This function extracts the received resource blocks, both channel estimates and data symbols, - for the current allocation and for single antenna eNB transmission. - @param rxdataF Raw FFT output of received signal - @param dl_bf_ch_estimates Beamforming channel estimates of current slot - @param rxdataF_ext FFT output for RBs in this allocation - @param dl_bf_ch_estimates_ext Beamforming channel estimates for RBs in this allocation - @param rb_alloc RB allocation vector - @param symbol Symbol to extract - @param subframe Subframe number - @param high_speed_flag - @param frame_parms Pointer to frame descriptor -*/ -uint16_t dlsch_extract_rbs_TM7(int32_t **rxdataF, - int32_t **dl_bf_ch_estimates, - int32_t **rxdataF_ext, - int32_t **dl_bf_ch_estimates_ext, - uint32_t *rb_alloc, - uint8_t symbol, - uint8_t subframe, - uint32_t high_speed_flag, - NR_DL_FRAME_PARMS *frame_parms); /** \brief This function performs channel compensation (matched filtering) on the received RBs for this allocation. In addition, it computes the squared-magnitude of the channel with weightings for 16QAM/64QAM detection as well as dual-stream detection (cross-correlation) @param rxdataF_ext Frequency-domain received signal in RBs to be demodulated @@ -802,35 +634,6 @@ void nr_dlsch_deinterleaving(uint8_t symbol, uint16_t *llr_deint, uint16_t nb_rb_pdsch); -//This function is used to compute multiplications in Hhermitian * H matrix -void conjch0_mult_ch1(int *ch0, - int *ch1, - int32_t *ch0conj_ch1, - unsigned short nb_rb, - unsigned char output_shift0); - -void construct_HhH_elements(int *ch0conj_ch0, - int *ch1conj_ch1, - int *ch2conj_ch2, - int *ch3conj_ch3, - int *ch0conj_ch1, - int *ch1conj_ch0, - int *ch2conj_ch3, - int *ch3conj_ch2, - int32_t *after_mf_00, - int32_t *after_mf_01, - int32_t *after_mf_10, - int32_t *after_mf_11, - unsigned short nb_rb); - -void dlsch_channel_level_TM34_meas(int *ch00, - int *ch01, - int *ch10, - int *ch11, - int *avg_0, - int *avg_1, - unsigned short nb_rb); - void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext, int32_t *median, int n_tx, @@ -859,42 +662,6 @@ void nr_a_sum_b(__m128i *input_x, __m128i *input_y, unsigned short nb_rb); -uint8_t rank_estimation_tm3_tm4(int *dl_ch_estimates_00, - int *dl_ch_estimates_01, - int *dl_ch_estimates_10, - int *dl_ch_estimates_11, - unsigned short nb_rb); - -void dlsch_channel_compensation_TM56(int **rxdataF_ext, - int **dl_ch_estimates_ext, - int **dl_ch_mag, - int **dl_ch_magb, - int **rxdataF_comp, - unsigned char *pmi_ext, - NR_DL_FRAME_PARMS *frame_parms, - PHY_NR_MEASUREMENTS *phy_measurements, - int eNB_id, - unsigned char symbol, - unsigned char mod_order, - unsigned short nb_rb, - unsigned char output_shift, - unsigned char dl_power_off); - - -void dlsch_channel_compensation_TM34(NR_DL_FRAME_PARMS *frame_parms, - NR_UE_PDSCH *lte_ue_pdsch_vars, - PHY_NR_MEASUREMENTS *phy_measurements, - int eNB_id, - unsigned char symbol, - unsigned char mod_order0, - unsigned char mod_order1, - int harq_pid, - int round, - MIMO_mode_t mimo_mode, - unsigned short nb_rb, - unsigned char output_shift0, - unsigned char output_shift1); - /** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal @param dl_ch_estimates_ext Channel estimates in allocated RBs @@ -908,33 +675,10 @@ void nr_dlsch_channel_level(int **dl_ch_estimates_ext, uint8_t n_tx, int32_t *avg, uint8_t symbol, - uint32_t len, + uint32_t len, unsigned short nb_rb); -void dlsch_channel_level_TM34(int **dl_ch_estimates_ext, - NR_DL_FRAME_PARMS *frame_parms, - unsigned char *pmi_ext, - int *avg_0, - int *avg_1, - uint8_t symbol, - unsigned short nb_rb, - MIMO_mode_t mimo_mode); - - -void dlsch_channel_level_TM56(int32_t **dl_ch_estimates_ext, - NR_DL_FRAME_PARMS *frame_parms, - unsigned char *pmi_ext, - int32_t *avg, - uint8_t symbol_mod, - uint16_t nb_rb); - -void dlsch_channel_level_TM7(int32_t **dl_bf_ch_estimates_ext, - NR_DL_FRAME_PARMS *frame_parms, - int32_t *avg, - uint8_t pilots_flag, - uint16_t nb_rb); - void nr_dlsch_scale_channel(int32_t **dl_ch_estimates_ext, NR_DL_FRAME_PARMS *frame_parms, uint8_t n_tx, @@ -1020,22 +764,12 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE, NR_DL_FRAME_PARMS *frame_parms, uint8_t Nl); -void *nr_dlsch_decoding_2thread0(void *arg); - -void *nr_dlsch_decoding_2thread1(void *arg); - - void nr_dlsch_unscrambling(int16_t* llr, uint32_t size, uint8_t q, uint32_t Nid, uint32_t n_RNTI); -uint32_t dlsch_decoding_emul(PHY_VARS_NR_UE *phy_vars_ue, - uint8_t subframe, - PDSCH_t dlsch_id, - uint8_t eNB_id); - int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t pdcch_est_size, @@ -1044,35 +778,6 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15); -/*! \brief Extract PSS and SSS resource elements - @param phy_vars_ue Pointer to UE variables - @param[out] pss_ext contain the PSS signals after the extraction - @param[out] sss_ext contain the SSS signals after the extraction - @returns 0 on success -*/ -int pss_sss_extract(PHY_VARS_NR_UE *phy_vars_ue, - int32_t pss_ext[4][72], - int32_t sss_ext[4][72], - uint8_t subframe); - -/*! \brief Extract only PSS resource elements - @param phy_vars_ue Pointer to UE variables - @param[out] pss_ext contain the PSS signals after the extraction - @returns 0 on success -*/ -int pss_only_extract(PHY_VARS_NR_UE *phy_vars_ue, - int32_t pss_ext[4][72], - uint8_t subframe); - -/*! \brief Extract only SSS resource elements - @param phy_vars_ue Pointer to UE variables - @param[out] sss_ext contain the SSS signals after the extraction - @returns 0 on success -*/ -int sss_only_extract(PHY_VARS_NR_UE *phy_vars_ue, - int32_t sss_ext[4][72], - uint8_t subframe); - /*! \brief Performs detection of SSS to find cell ID and other framing parameters (FDD/TDD, normal/extended prefix) @param phy_vars_ue Pointer to UE variables @param tot_metric Pointer to variable containing maximum metric under framing hypothesis (to be compared to other hypotheses @@ -1086,273 +791,30 @@ int rx_sss(PHY_VARS_NR_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uin /*! \brief receiver for the PBCH \returns number of tx antennas or -1 if error */ -int nr_rx_pbch( PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, - const int estimateSz, - struct complex16 dl_ch_estimates[][estimateSz], - NR_UE_PBCH *nr_ue_pbch_vars, - NR_DL_FRAME_PARMS *frame_parms, - uint8_t eNB_id, - uint8_t i_ssb, - MIMO_mode_t mimo_mode, - NR_UE_PDCCH_CONFIG *phy_pdcch_config, - fapiPbch_t* result); +int nr_rx_pbch(PHY_VARS_NR_UE *ue, + UE_nr_rxtx_proc_t *proc, + const int estimateSz, + struct complex16 dl_ch_estimates[][estimateSz], + NR_UE_PBCH *nr_ue_pbch_vars, + NR_DL_FRAME_PARMS *frame_parms, + uint8_t eNB_id, + uint8_t i_ssb, + MIMO_mode_t mimo_mode, + NR_UE_PDCCH_CONFIG *phy_pdcch_config, + fapiPbch_t* result); int nr_pbch_detection(UE_nr_rxtx_proc_t *proc, - PHY_VARS_NR_UE *ue, + PHY_VARS_NR_UE *ue, int pbch_initial_symbol, NR_UE_PDCCH_CONFIG *phy_pdcch_config); -uint16_t rx_pbch_emul(PHY_VARS_NR_UE *phy_vars_ue, - uint8_t eNB_id, - uint8_t pbch_phase); - - -/*! \brief PBCH unscrambling - This is similar to pbch_scrabling with the difference that inputs are signed s16s (llr values) and instead of flipping bits we change signs. - \param frame_parms Pointer to frame descriptor - \param llr Output of the demodulator - \param length Length of the sequence - \param frame_mod4 Frame number modulo 4*/ -void pbch_unscrambling(NR_DL_FRAME_PARMS *frame_parms, - int8_t* llr, - uint32_t length, - uint8_t frame_mod4); - - -void generate_64qam_table(void); -void generate_16qam_table(void); -void generate_qpsk_table(void); - -uint16_t extract_crc(uint8_t *dci,uint8_t DCI_LENGTH); - -/*! \brief LLR from two streams. This function takes two streams (qpsk modulated) and calculates the LLR, considering one stream as interference. - \param stream0_in pointer to first stream0 - \param stream1_in pointer to first stream1 - \param stream0_out pointer to output stream - \param rho01 pointer to correlation matrix - \param length*/ -void qpsk_qpsk_TM3456(short *stream0_in, - short *stream1_in, - short *stream0_out, - short *rho01, - int length - ); - -/** \brief Attempt decoding of a particular DCI with given length and format. - @param DCI_LENGTH length of DCI in bits - @param DCI_FMT Format of DCI - @param e e-sequence (soft bits) - @param decoded_output Output of Viterbi decoder -*/ -void dci_decoding(uint8_t DCI_LENGTH, - uint8_t DCI_FMT, - int8_t *e, - uint8_t *decoded_output); - -/** \brief Do 36.213 DCI decoding procedure by searching different RNTI options and aggregation levels. Currently does - not employ the complexity reducing procedure based on RNTI. - @param phy_vars_ue UE variables - @param dci_alloc Pointer to DCI_ALLOC_t array to store results for DLSCH/ULSCH programming - @param do_common If 1 perform search in common search-space else ue-specific search-space - @param eNB_id eNB Index on which to act - @param subframe Index of subframe - @returns bitmap of occupied CCE positions (i.e. those detected) -*/ -uint16_t dci_decoding_procedure(PHY_VARS_NR_UE *phy_vars_ue, - DCI_ALLOC_t *dci_alloc, - int do_common, - int16_t eNB_id, - uint8_t subframe); - -uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_NR_UE *ue, - DCI_ALLOC_t *dci_alloc, - uint8_t DCIFormat, - uint8_t agregationLevel, - int16_t eNB_id, - uint8_t subframe); - -uint16_t dci_decoding_procedure_emul(NR_UE_PDCCH **lte_ue_pdcch_vars, - uint8_t num_ue_spec_dci, - uint8_t num_common_dci, - DCI_ALLOC_t *dci_alloc_tx, - DCI_ALLOC_t *dci_alloc_rx, - int16_t eNB_id); - -/** \brief Compute I_TBS (transport-block size) based on I_MCS for PDSCH. Implements table 7.1.7.1-1 from 36.213. - @param I_MCS */ -uint8_t get_I_TBS(uint8_t I_MCS); - -/** \brief Compute I_TBS (transport-block size) based on I_MCS for PUSCH. Implements table 8.6.1-1 from 36.213. - @param I_MCS */ -unsigned char get_I_TBS_UL(unsigned char I_MCS); - -/** \brief Compute Q (modulation order) based on downlink I_MCS. Implements table 7.1.7.1-1 from 36.213. - @param I_MCS - @param nb_rb - @return Transport block size */ -uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb); - -/** \brief Compute Q (modulation order) based on uplink I_MCS. Implements table 7.1.7.1-1 from 36.213. - @param I_MCS - @param nb_rb - @return Transport block size */ -uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb); - -/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type - @param N_RB_DL number of PRB on DL - @param indicator for even/odd slot - @param vrb vrb index - @param Ngap Gap indicator -*/ -uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap); - -/* \brief Return prb for a given vrb index - @param vrb_type VRB type (0=localized,1=distributed) - @param rb_alloc_dci rballoc field from DCI -*/ -uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci); - - -/* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type - @returns Transmission mode (1-7) -*/ -uint8_t get_transmission_mode(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti); - - -/* \brief - @param ra_header Header of resource allocation (0,1) (See sections 7.1.6.1/7.1.6.2 of 36.213 Rel8.6) - @param rb_alloc Bitmap allocation from DCI (format 1,2) - @returns number of physical resource blocks -*/ -uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL); - -//int adjust_G(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe); -//int adjust_G2(NR_DL_FRAME_PARMS *frame_parms,uint32_t *rb_alloc,uint8_t mod_order,uint8_t subframe,uint8_t symbol); - #ifndef modOrder #define modOrder(I_MCS,I_TBS) ((I_MCS-I_TBS)*2+2) // Find modulation order from I_TBS and I_MCS #endif -/** \fn uint8_t I_TBS2I_MCS(uint8_t I_TBS); - \brief This function maps I_tbs to I_mcs according to Table 7.1.7.1-1 in 3GPP TS 36.213 V8.6.0. Where there is two supported modulation orders for the same I_TBS then either high or low modulation is chosen by changing the equality of the two first comparisons in the if-else statement. - \param I_TBS Index of Transport Block Size - \return I_MCS given I_TBS -*/ -uint8_t I_TBS2I_MCS(uint8_t I_TBS); - -/** \fn uint8_t SE2I_TBS(float SE, - uint8_t N_PRB, - uint8_t symbPerRB); - \brief This function maps a requested throughput in number of bits to I_tbs. The throughput is calculated as a function of modulation order, RB allocation and number of symbols per RB. The mapping orginates in the "Transport block size table" (Table 7.1.7.2.1-1 in 3GPP TS 36.213 V8.6.0) - \param SE Spectral Efficiency (before casting to integer, multiply by 1024, remember to divide result by 1024!) - \param N_PRB Number of PhysicalResourceBlocks allocated \sa lte_frame_parms->N_RB_DL - \param symbPerRB Number of symbols per resource block allocated to this channel - \return I_TBS given an SE and an N_PRB -*/ -uint8_t SE2I_TBS(float SE, - uint8_t N_PRB, - uint8_t symbPerRB); - - -/*! - \brief This function is similar to generate_srs_tx but generates a conjugate sequence for channel estimation. If IFFT_FPGA is defined, the SRS is quantized to a QPSK sequence. - @param phy_vars_ue Pointer to PHY_VARS structure - @param eNB_id Index of destination eNB for this SRS - @param amp Linear amplitude of SRS - @param subframe Index of subframe on which to act - @returns 0 on success, -1 on error with message -*/ - -int32_t generate_srs_tx(PHY_VARS_NR_UE *phy_vars_ue, - uint8_t eNB_id, - int16_t amp, - uint32_t subframe); - -/*! - \brief This function generates the downlink reference signal for the PUSCH according to 36.211 v8.6.0. The DRS occuies the RS defined by rb_alloc and the symbols 2 and 8 for extended CP and 3 and 10 for normal CP. -*/ - -int32_t generate_drs_pusch(PHY_VARS_NR_UE *phy_vars_ue, - UE_nr_rxtx_proc_t *proc, - uint8_t eNB_id, - int16_t amp, - uint32_t subframe, - uint32_t first_rb, - uint32_t nb_rb, - uint8_t ant); - -/*! - \brief This function implements the initialization of paging parameters for UE (See Section 7, 36.304).It must be called after setting IMSImod1024 during UE startup and after receiving SIB2 - @param ue Pointer to UE context - @param defaultPagingCycle T from 36.304 (0=32,1=64,2=128,3=256) - @param nB nB from 36.304 (0=4T,1=2T,2=T,3=T/2,4=T/4,5=T/8,6=T/16,7=T/32*/ -int init_ue_paging_info(PHY_VARS_NR_UE *ue, long defaultPagingCycle, long nB); - -int32_t compareints (const void * a, const void * b); - - -void ulsch_modulation(int32_t **txdataF, - int16_t amp, - frame_t frame, - uint32_t subframe, - NR_DL_FRAME_PARMS *frame_parms, - NR_UE_ULSCH_t *ulsch); - - -uint8_t allowed_ulsch_re_in_dmrs_symbol(uint16_t k, - uint16_t start_sc, - uint8_t numDmrsCdmGrpsNoData, - uint8_t dmrs_type); - - -int generate_ue_dlsch_params_from_dci(int frame, - uint8_t subframe, - void *dci_pdu, - rnti_t rnti, - DCI_format_t dci_format, - NR_UE_PDCCH *pdcch_vars, - NR_UE_PDSCH *pdsch_vars, - NR_UE_DLSCH_t **dlsch, - NR_DL_FRAME_PARMS *frame_parms, - PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, - uint16_t si_rnti, - uint16_t ra_rnti, - uint16_t p_rnti, - uint8_t beamforming_mode, - uint16_t tc_rnti); - - -int generate_ue_ulsch_params_from_dci(void *dci_pdu, - rnti_t rnti, - uint8_t subframe, - DCI_format_t dci_format, - PHY_VARS_NR_UE *phy_vars_ue, - UE_nr_rxtx_proc_t *proc, - uint16_t si_rnti, - uint16_t ra_rnti, - uint16_t p_rnti, - uint16_t cba_rnti, - uint8_t eNB_id, - uint8_t use_srs); - -int32_t generate_ue_ulsch_params_from_rar(PHY_VARS_NR_UE *phy_vars_ue, - UE_nr_rxtx_proc_t *proc, - uint8_t eNB_id); -double sinr_eff_cqi_calc(PHY_VARS_NR_UE *phy_vars_ue, - uint8_t eNB_id, - uint8_t subframe); - -uint8_t sinr2cqi(double sinr,uint8_t trans_mode); - - int dump_ue_stats(PHY_VARS_NR_UE *phy_vars_ue, UE_nr_rxtx_proc_t *proc, char* buffer, int length, runmode_t mode, int input_level_dBm); -void init_transport_channels(uint8_t); - -void generate_RIV_tables(void); - /*! \brief This function performs the initial cell search procedure - PSS detection, SSS detection and PBCH detection. At the end, the basic frame parameters are known (Frame configuration - TDD/FDD and cyclic prefix length, @@ -1393,208 +855,12 @@ void nr_rf_card_config_freq(openair0_config_t *openair0_cfg, uint64_t dl_Carrier, int freq_offset); - -void print_CQI(void *o,UCI_format_t uci_format,uint8_t eNB_id,int N_RB_DL); - -void fill_CQI(NR_UE_ULSCH_t *ulsch,PHY_NR_MEASUREMENTS *meas,uint8_t eNB_id, uint8_t harq_pid,int N_RB_DL, rnti_t rnti, uint8_t trans_mode,double sinr_eff); - -void reset_cba_uci(void *o); - -/** \brief This routine computes the subband PMI bitmap based on measurements (0,1,2,3 for rank 0 and 0,1 for rank 1) in the format needed for UCI - @param meas pointer to measurements - @param eNB_id eNB_id - @param nb_subbands number of subbands - @returns subband PMI bitmap -*/ -uint16_t quantize_subband_pmi(PHY_NR_MEASUREMENTS *meas,uint8_t eNB_id,int nb_subbands); - -int32_t pmi_convert_rank1_from_rank2(uint16_t pmi_alloc, int tpmi, int nb_rb); - -uint16_t quantize_subband_pmi2(PHY_NR_MEASUREMENTS *meas,uint8_t eNB_id,uint8_t a_id,int nb_subbands); - - - -uint64_t cqi2hex(uint32_t cqi); - -uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs); - -int get_nCCE_offset_l1(int *CCE_table, - const unsigned char L, - const int nCCE, - const int common_dci, - const unsigned short rnti, - const unsigned char subframe); - - -//uint8_t get_mi(NR_DL_FRAME_PARMS *frame,uint8_t subframe); - -uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe); - void nr_pdcch_unscrambling(int16_t *z, uint16_t scrambling_RNTI, uint32_t length, uint16_t pdcch_DMRS_scrambling_id, int16_t *z2); -void dlsch_unscrambling(NR_DL_FRAME_PARMS *frame_parms, - int mbsfn_flag, - NR_UE_DLSCH_t *dlsch, - int G, - int16_t* llr, - uint8_t q, - uint8_t Ns); - - -void generate_pucch1x(int32_t **txdataF, - NR_DL_FRAME_PARMS *frame_parms, - uint8_t ncs_cell[20][7], - PUCCH_FMT_t fmt, - PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, - uint16_t n1_pucch, - uint8_t shortened_format, - uint8_t *payload, - int16_t amp, - uint8_t subframe); - -void generate_pucch2x(int32_t **txdataF, - NR_DL_FRAME_PARMS *fp, - uint8_t ncs_cell[20][7], - PUCCH_FMT_t fmt, - PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, - uint16_t n2_pucch, - uint8_t *payload, - int A, - int B2, - int16_t amp, - uint8_t subframe, - uint16_t rnti); - -void generate_pucch3x(int32_t **txdataF, - NR_DL_FRAME_PARMS *frame_parms, - uint8_t ncs_cell[20][7], - PUCCH_FMT_t fmt, - PUCCH_CONFIG_DEDICATED *pucch_config_dedicated, - uint16_t n3_pucch, - uint8_t shortened_format, - uint8_t *payload, - int16_t amp, - uint8_t subframe, - uint16_t rnti); - - -void init_ulsch_power_LUT(void); - -/*! - \brief Check for PRACH TXop in subframe - @param frame_parms Pointer to NR_DL_FRAME_PARMS - @param frame frame index to check - @param subframe subframe index to check - @returns 0 on success -*/ -//int is_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe); - -/*! - \brief Generate PRACH waveform - @param phy_vars_ue Pointer to ue top-level descriptor - @param eNB_id Index of destination eNB - @param subframe subframe index to operate on - @param index of preamble (0-63) - @param Nf System frame number - @returns 0 on success - -*/ -int32_t generate_prach(PHY_VARS_NR_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe,uint16_t Nf); - - -/*! - \brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index - @param frame_parms Pointer to NR_DL_FRAME_PARMS structure - @returns 0-5 depending on number of available prach -*/ -uint8_t get_num_prach_tdd(module_id_t Mod_id); - -/*! - \brief Return the PRACH format as a function of the Configuration Index and Frame type. - @param prach_ConfigIndex PRACH Configuration Index - @param frame_type 0-FDD, 1-TDD - @returns 0-1 accordingly -*/ -uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,frame_type_t frame_type); - -/*! - \brief Helper for MAC, returns frequency index of PRACH resource in TDD for a particular configuration index - @param frame_parms Pointer to NR_DL_FRAME_PARMS structure - @returns 0-5 depending on number of available prach -*/ -uint8_t get_fid_prach_tdd(module_id_t Mod_id,uint8_t tdd_map_index); - -/*! - \brief Comp ute DFT of PRACH ZC sequences. Used for generation of prach in UE and reception of PRACH in eNB. - @param rootSequenceIndex PRACH root sequence - #param prach_ConfigIndex PRACH Configuration Index - @param zeroCorrelationZoneConfig PRACH ncs_config - @param highSpeedFlat PRACH High-Speed Flag - @param frame_type TDD/FDD flag - @param Xu DFT output -*/ -void compute_prach_seq(uint16_t rootSequenceIndex, - uint8_t prach_ConfigIndex, - uint8_t zeroCorrelationZoneConfig, - uint8_t highSpeedFlag, - frame_type_t frame_type, - uint32_t X_u[64][839]); - - -void init_prach_tables(int N_ZC); - -void init_unscrambling_lut(void); -void init_scrambling_lut(void); - -/*! - \brief Return the status of MBSFN in this frame/subframe - @param frame Frame index - @param subframe Subframe index - @param frame_parms Pointer to frame parameters - @returns 1 if subframe is for MBSFN -*/ -uint8_t is_not_pilot(uint8_t pilots, uint8_t re, uint8_t nushift, uint8_t use2ndpilots); - -uint8_t is_not_UEspecRS(int8_t lprime, uint8_t re, uint8_t nushift, uint8_t Ncp, uint8_t beamforming_mode); - -uint32_t dlsch_decoding_abstraction(double *dlsch_MIPB, - NR_DL_FRAME_PARMS *lte_frame_parms, - NR_UE_DLSCH_t *dlsch, - uint8_t subframe, - uint8_t num_pdcch_symbols); - -// DL power control functions -double get_pa_dB(uint8_t pa); - - -double computeRhoA_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, - NR_UE_DLSCH_t *dlsch_ue, - uint8_t dl_power_off, - uint8_t n_antenna_port); - -double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, - PDSCH_CONFIG_COMMON *pdsch_config_common, - uint8_t n_antenna_port, - NR_UE_DLSCH_t *dlsch_ue, - uint8_t dl_power_off); - -/*void compute_sqrt_RhoAoRhoB(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated, - PDSCH_CONFIG_COMMON *pdsch_config_common, - uint8_t n_antenna_port, - NR_UE_DLSCH_t *dlsch_ue); -*/ - -uint8_t get_prach_prb_offset(NR_DL_FRAME_PARMS *frame_parms, - uint8_t prach_ConfigIndex, - uint8_t n_ra_prboffset, - uint8_t tdd_mapindex, uint16_t Nf); - -#include - uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int16_t *pdcch_e_rx, @@ -1632,7 +898,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, unsigned char first_symbol_flag, RX_type_t rx_type, unsigned char i_mod, - unsigned char harq_pid); + unsigned char harq_pid); int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot); diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index bbe2a1dfcd..477e7e2260 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -102,7 +102,6 @@ #include "PHY/NR_REFSIG/ss_pbch_nr.h" #endif -#include "PHY/NR_UE_TRANSPORT/dci_nr.h" #include #include "sdr/COMMON/common_lib.h" #include "NR_IF_Module.h" @@ -398,152 +397,7 @@ typedef enum { /* see 38.321 Table 7.1-2 RNTI usage * _tpc_srs_rnti = _TPC_SRS_RNTI_ } crc_scrambled_t; -typedef enum {bundle_n2=2,bundle_n3=3,bundle_n6=6} NR_UE_CORESET_REG_bundlesize_t; -typedef enum {interleave_n2=2,interleave_n3=3,interleave_n6=6} NR_UE_CORESET_interleaversize_t; - -typedef struct { - //Corresponds to L1 parameter 'CORESET-REG-bundle-size' (see 38.211, section FFS_Section) - NR_UE_CORESET_REG_bundlesize_t reg_bundlesize; - //Corresponds to L1 parameter 'CORESET-interleaver-size' (see 38.211, 38.213, section FFS_Section) - NR_UE_CORESET_interleaversize_t interleaversize; - //Corresponds to L1 parameter 'CORESET-shift-index' (see 38.211, section 7.3.2.2) - int shiftIndex; -} NR_UE_CORESET_CCE_REG_MAPPING_t; - -typedef enum {allContiguousRBs=0,sameAsREGbundle=1} NR_UE_CORESET_precoder_granularity_t; -typedef enum {tciPresentInDCI_enabled = 1} tciPresentInDCI_t; -typedef struct { - /* - * define CORESET structure according to 38.331 - * - * controlResourceSetId: Corresponds to L1 parameter 'CORESET-ID' - * Value 0 identifies the common CORESET configured in MIB and in ServingCellConfigCommon - * Values 1..maxNrofControlResourceSets-1 identify CORESETs configured by dedicated signalling - * frequencyDomainResources: BIT STRING (SIZE (45)) - * Corresponds to L1 parameter 'CORESET-freq-dom'(see 38.211, section 7.3.2.2) - * Frequency domain resources for the CORESET. Each bit corresponds a group of 6 RBs, with grouping starting from PRB 0, - * which is fully contained in the bandwidth part within which the CORESET is configured. - * duration: INTEGER (1..maxCoReSetDuration) - * Corresponds to L1 parameter 'CORESET-time-duration' (see 38.211, section 7.3.2.2FFS_Section) - * Contiguous time duration of the CORESET in number of symbols - * cce-REG-MappingType: interleaved - * reg-BundleSize: ENUMERATED {n2, n3, n6} - * interleaverSize: ENUMERATED {n2, n3, n6} - * shiftIndex: INTEGER - * nonInterleaved NULL - * precoderGranularity: ENUMERATED {sameAsREG-bundle, allContiguousRBs} - * Corresponds to L1 parameter 'CORESET-precoder-granuality' (see 38.211, sections 7.3.2.2 and 7.4.1.3.2) - * tci-StatesPDCCH: SEQUENCE(SIZE (1..maxNrofTCI-StatesPDCCH)) OF TCI-StateId OPTIONAL - * A subset of the TCI states defined in TCI-States used for providing QCL relationships between the DL RS(s) - * in one RS Set (TCI-State) and the PDCCH DMRS ports. - * Corresponds to L1 parameter 'TCI-StatesPDCCH' (see 38.214, section FFS_Section) - * tci-PresentInDCI: ENUMERATED {enabled} OPTIONAL - * Corresponds to L1 parameter 'TCI-PresentInDCI' (see 38,213, section 5.1.5) - * pdcch-DMRS-ScramblingID: BIT STRING (SIZE (16)) OPTIONAL - * PDCCH DMRS scrambling initalization. - * Corresponds to L1 parameter 'PDCCH-DMRS-Scrambling-ID' (see 38.214, section 5.1) - * When the field is absent the UE applies the value '0'. - */ - int controlResourceSetId; - uint64_t frequencyDomainResources; - int duration; - NR_UE_CORESET_CCE_REG_MAPPING_t cce_reg_mappingType; - NR_UE_CORESET_precoder_granularity_t precoderGranularity; - int tciStatesPDCCH; - tciPresentInDCI_t tciPresentInDCI; - uint16_t pdcchDMRSScramblingID; - uint16_t rb_offset; -} NR_UE_PDCCH_CORESET; - -// Slots for PDCCH Monitoring configured as periodicity and offset -typedef enum {nr_sl1=1,nr_sl2=2,nr_sl4=4,nr_sl5=5,nr_sl8=8,nr_sl10=10,nr_sl16=16,nr_sl20=20,nr_sl40=40,nr_sl80=80,nr_sl160=160,nr_sl320=320,nr_sl640=640,nr_sl1280=1280,nr_sl2560=2560} NR_UE_SLOT_PERIOD_OFFSET_t; -typedef enum {nc0=0,nc1=1,nc2=2,nc3=3,nc4=4,nc5=5,nc6=6,nc8=8} NR_UE_SEARCHSPACE_nbrCAND_t; -typedef enum {nsfi1=1,nsfi2=2} NR_UE_SEARCHSPACE_nbrCAND_SFI_t; -typedef enum {n2_3_1=1,n2_3_2=2} NR_UE_SEARCHSPACE_nbrCAND_2_3_t; -typedef enum {cformat0_0_and_1_0=0,cformat2_0=2,cformat2_1=3,cformat2_2=4,cformat2_3=5} NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t; -typedef enum {uformat0_0_and_1_0=0,uformat0_1_and_1_1=1} NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t; -// Monitoring periodicity of SRS PDCCH in number of slots for DCI format 2-3 -// Corresponds to L1 parameter 'SRS-Num-PDCCH-cand' (see 38.212, 38.213, section 7.3.1, 11.3) -typedef enum {mp1=1,mp2=2,mp4=4,mp5=5,mp8=8,mp10=10,mp16=16,mp20=20} NR_UE_SEARCHSPACE_MON_PERIOD_t; -//typedef enum {n1=1,n2=2} NR_UE_SEARCHSPACE_nbrCAND_2_3_t; -// The number of PDCCH candidates for DCI format 2-3 for the configured aggregation level. -// Corresponds to L1 parameter 'SRS-Num-PDCCH-cand' (see 38.212, 38.213, section 7.3.1, 11.3) -typedef enum {common=0,ue_specific=1} NR_SEARCHSPACE_TYPE_t; - -typedef struct { - - /* - * searchSpaceType: Indicates whether this is a common search space (present) or a UE specific search space (CHOICE) - * as well as DCI formats to monitor for (description in struct NR_UE_PDCCH_SEARCHSPACE_TYPE - * common: Configures this search space as common search space (CSS) and DCI formats to monitor - * ue-Specific: Configures this search space as UE specific search space (USS) - * The UE monitors the DCI format with CRC scrambled by - * C-RNTI, CS-RNTI (if configured), TC-RNTI (if a certain condition is met), - * and SP-CSI-RNTI (if configured) - */ - - NR_SEARCHSPACE_TYPE_t type; - NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t common_dci_formats; - //NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_SFI_aggr_level[5]; // FIXME! A table of five enum elements - NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel1; - NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel2; - NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel4; - NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel8; - NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel16; - NR_UE_SEARCHSPACE_MON_PERIOD_t srs_monitoringPeriodicity2_3; - NR_UE_SEARCHSPACE_nbrCAND_2_3_t srs_nrofCandidates; - NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t ue_specific_dci_formats; - -} NR_UE_PDCCH_SEARCHSPACE_TYPE; - -typedef struct { - /* - * define SearchSpace structure according to 38.331 - * - * searchSpaceId: Identity of the search space. SearchSpaceId = 0 identifies the SearchSpace configured via PBCH (MIB) - * The searchSpaceId is unique among the BWPs of a Serving Cell - * controlResourceSetId: CORESET applicable for this SearchSpace - * 0 identifies the common CORESET configured in MIB - * 1..maxNrofControlResourceSets-1 identify CORESETs configured by dedicated signalling - * monitoringSlotPeriodicityAndOffset: - * Slots for PDCCH Monitoring configured as periodicity and offset. - * Corresponds to L1 parameters 'Montoring-periodicity-PDCCH-slot' and - * 'Montoring-offset-PDCCH-slot' (see 38.213, section 10) - * monitoringSymbolsWithinSlot: - * Symbols for PDCCH monitoring in the slots configured for PDCCH monitoring - * The most significant (left) bit represents the first OFDM in a slot - * - * nrofCandidates: Number of PDCCH candidates per aggregation level - * - * searchSpaceType: Indicates whether this is a common search space (present) or a UE specific search space - * as well as DCI formats to monitor for (description in struct NR_UE_PDCCH_SEARCHSPACE_TYPE - * common: Configures this search space as common search space (CSS) and DCI formats to monitor - * ue-Specific: Configures this search space as UE specific search space (USS) - * The UE monitors the DCI format with CRC scrambled by - * C-RNTI, CS-RNTI (if configured), TC-RNTI (if a certain condition is met), - * and SP-CSI-RNTI (if configured) - */ - // INTEGER (0..maxNrofSearchSpaces-1) (0..40-1) - int searchSpaceId; - int controlResourceSetId; - NR_UE_SLOT_PERIOD_OFFSET_t monitoringSlotPeriodicityAndOffset; - uint16_t monitoringSlotPeriodicityAndOffset_offset; - // duration is number of consecutive slots that a SearchSpace lasts in every occasion, i.e., upon every period as given in the periodicityAndOffset - // if the field is absent, the UE applies the value 1 slot - // the maximum valid duration is peridicity-1 (periodicity as given in the monitoringSlotPeriodicityAndOffset) - uint16_t duration; - // bit string size 14. Bitmap to indicate symbols within slot where PDCCH has to be monitored - // the MSB (left) bit represents first OFDM in slot - uint16_t monitoringSymbolWithinSlot; - NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel1; - NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel2; - NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel4; - NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel8; - NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel16; - NR_UE_PDCCH_SEARCHSPACE_TYPE searchSpaceType; - -} NR_UE_PDCCH_SEARCHSPACE; #endif typedef struct { int nb_search_space; @@ -552,28 +406,6 @@ typedef struct { fapi_nr_dl_config_dci_dl_pdu_rel15_t pdcch_config[FAPI_NR_MAX_SS]; } NR_UE_PDCCH_CONFIG; -typedef struct { - /// Total number of PDU received - uint32_t dci_received; - /// Total number of DCI False detection (diagnostic mode) - uint32_t dci_false; - /// Total number of DCI missed (diagnostic mode) - uint32_t dci_missed; - - /* -#ifdef NR_PDCCH_DEFS_NR_UE - int nb_searchSpaces; - // CORESET structure, where maximum number of CORESETs to be handled is 3 (according to 38.331 V15.1.0) - NR_UE_PDCCH_CORESET coreset[NR_NBR_CORESET_ACT_BWP]; - // SEARCHSPACE structure, where maximum number of SEARCHSPACEs to be handled is 10 (according to 38.331 V15.1.0) - // Each SearchSpace is associated with one ControlResourceSet - NR_UE_PDCCH_SEARCHSPACE searchSpace[NR_NBR_SEARCHSPACE_ACT_BWP]; - - int n_RB_BWP[NR_NBR_SEARCHSPACE_ACT_BWP]; - uint32_t nb_search_space; - #endif*/ -} NR_UE_PDCCH; - #define PBCH_A 24 typedef struct { @@ -617,16 +449,6 @@ typedef struct NR_UE_SSB { struct NR_UE_SSB *next_ssb; } NR_UE_SSB; -/*typedef enum { - /// do not detect any DCIs in the current subframe - NO_DCI = 0x0, - /// detect only downlink DCIs in the current subframe - UL_DCI = 0x1, - /// detect only uplink DCIs in the current subframe - DL_DCI = 0x2, - /// detect both uplink and downlink DCIs in the current subframe - UL_DL_DCI = 0x3} nr_dci_detect_mode_t;*/ - typedef struct UE_NR_SCAN_INFO_s { /// 10 best amplitudes (linear) for each pss signals int32_t amp[3][10]; @@ -730,11 +552,6 @@ typedef struct { uint32_t PF; uint32_t PO; - // For abstraction-purposes only - uint8_t sr[10]; - uint8_t pucch_sel[10]; - uint8_t pucch_payload[22]; - UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_gNB_MAX]; /// cell-specific reference symbols //uint32_t lte_gold_table[7][20][2][14]; @@ -781,10 +598,7 @@ typedef struct { UE_NR_SCAN_INFO_t scan_info[NB_BANDS_MAX]; - char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_gNB_MAX]; - NR_PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_gNB_MAX]; - int turbo_iterations, turbo_cntl_iterations; /// \brief ?. /// - first index: gNB [0..NUMBER_OF_CONNECTED_gNB_MAX[ (hard coded) uint32_t total_TBS[NUMBER_OF_CONNECTED_gNB_MAX]; @@ -854,10 +668,6 @@ typedef struct { /// - first index: ? [0..12*N_RB_DL[ double *sinr_dB; - /// \brief sinr for all subcarriers of first symbol for the CQI Calculation. - /// - first index: ? [0..12*N_RB_DL[ - double *sinr_CQI_dB; - /// sinr_effective used for CQI calulcation double sinr_eff; @@ -866,15 +676,6 @@ typedef struct { uint8_t max_ldpc_iterations; - /// PDSCH Varaibles - PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_gNB_MAX]; - - /// PUSCH Varaibles - PUSCH_CONFIG_DEDICATED pusch_config_dedicated[NUMBER_OF_CONNECTED_gNB_MAX]; - - /// PUSCH contention-based access vars - PUSCH_CA_CONFIG_DEDICATED pusch_ca_config_dedicated[NUMBER_OF_eNB_MAX]; // lola - /// SRS variables nr_srs_info_t *nr_srs_info; @@ -886,33 +687,12 @@ typedef struct { SystemInformationBlockType1_nr_t systemInformationBlockType1_nr; #endif - uint8_t ncs_cell[20][7]; - - /// UL-POWER-Control - UL_POWER_CONTROL_DEDICATED ul_power_control_dedicated[NUMBER_OF_CONNECTED_gNB_MAX]; - - /// TPC - TPC_PDCCH_CONFIG tpc_pdcch_config_pucch[NUMBER_OF_CONNECTED_gNB_MAX]; - TPC_PDCCH_CONFIG tpc_pdcch_config_pusch[NUMBER_OF_CONNECTED_gNB_MAX]; - - /// CQI reporting - CQI_REPORT_CONFIG cqi_report_config[NUMBER_OF_CONNECTED_gNB_MAX]; - - /// SRS Variables - SOUNDINGRS_UL_CONFIG_DEDICATED soundingrs_ul_config_dedicated[NUMBER_OF_CONNECTED_gNB_MAX]; - - /// Scheduling Request Config - SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_CONNECTED_gNB_MAX]; - //#if defined(UPGRADE_RAT_NR) #if 1 scheduling_request_config_t scheduling_request_config_nr[NUMBER_OF_CONNECTED_gNB_MAX]; #endif - /// Transmission mode per gNB - uint8_t transmission_mode[NUMBER_OF_CONNECTED_gNB_MAX]; - time_stats_t phy_proc; time_stats_t phy_proc_tx; time_stats_t phy_proc_rx; @@ -967,11 +747,6 @@ typedef struct { /// RF and Interface devices per CC openair0_device rfdevice; - time_stats_t dlsch_encoding_SIC_stats; - time_stats_t dlsch_scrambling_SIC_stats; - time_stats_t dlsch_modulation_SIC_stats; - time_stats_t dlsch_llr_stripping_unit_SIC_stats; - time_stats_t dlsch_unscrambling_SIC_stats; #if ENABLE_RAL hash_table_t *ral_thresholds_timed; diff --git a/openair1/PHY/phy_vars_nr_ue.h b/openair1/PHY/phy_vars_nr_ue.h index 550a2f0394..87f350d179 100644 --- a/openair1/PHY/phy_vars_nr_ue.h +++ b/openair1/PHY/phy_vars_nr_ue.h @@ -125,7 +125,4 @@ int16_t unscrambling_lut[65536*16] __attribute__((aligned(32))); /// lookup table for scrambling in TX uint8_t scrambling_lut[65536*16] __attribute__((aligned(32))); -uint8_t max_ldpc_iterations=4; -uint8_t max_turbo_iterations=4; - #endif diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h index 57fde873e9..9ba3ac74b1 100644 --- a/openair1/SCHED_NR_UE/defs.h +++ b/openair1/SCHED_NR_UE/defs.h @@ -91,23 +91,6 @@ typedef struct { * @{ */ - -/*! \brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe. - @param phy_vars_ue Pointer to UE variables on which to act - @param eNB_id ID of eNB on which to act - @param abstraction_flag Indicator of PHY abstraction - @param mode calibration/debug mode - @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying - @param *phy_vars_rn pointer to RN variables -*/ -void phy_procedures_UE_lte(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type); -/*! \brief Top-level entry routine for relay node procedures actinf as UE. This proc will make us of the existing UE procs. - @param last_slot Index of last slot (0-19) - @param next_slot Index of next_slot (0-19) - @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying -*/ -int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, relaying_type_t r_type); - /*! \brief Scheduling for UE TX procedures in normal subframes. @param ue Pointer to UE variables on which to act @param proc Pointer to RXn-TXnp4 proc information @@ -133,89 +116,6 @@ int phy_procedures_slot_parallelization_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_p void processSlotTX(void *arg); -#ifdef UE_SLOT_PARALLELISATION - void *UE_thread_slot1_dl_processing(void *arg); -#endif - -/*! \brief Scheduling for UE TX procedures in TDD S-subframes. - @param phy_vars_ue Pointer to UE variables on which to act - @param eNB_id Local id of eNB on which to act - @param abstraction_flag Indicator of PHY abstraction - @param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying -*/ - -/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. - @param frame_parms Pointer to DL frame parameter descriptor - @param subframe Subframe index - @returns Subframe type (DL,UL,S) -*/ - - -//nr_subframe_t nr_subframe_select(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe); - - -/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. Same as nr_subframe_select, except that it uses the Mod_id and is provided as a service to the MAC scheduler. - @param Mod_id Index of eNB - @param CC_id Component Carrier Index - @param subframe Subframe index - @returns Subframe type (DL,UL,S) -*/ -nr_subframe_t nr_get_subframe_direction(uint8_t Mod_id, uint8_t CC_id,uint8_t subframe); - -/*! \brief Function to compute timing of Msg3 transmission on UL-SCH (first UE transmission in RA procedure). This implements the timing in paragraph a) from Section 6.1.1 in 36.213 (p. 17 in version 8.6). Used by eNB upon transmission of random-access response (RA_RNTI) to program corresponding ULSCH reception procedure. Used by UE upon reception of random-access response (RA_RNTI) to program corresponding ULSCH transmission procedure. This does not support the UL_delay field in RAR (always assumed to be 0). - @param frame_parms Pointer to DL frame parameter descriptor - @param current_subframe Index of subframe where RA_RNTI was received - @param current_frame Index of frame where RA_RNTI was received - @param frame Frame index where Msg3 is to be transmitted (n+6 mod 10 for FDD, different for TDD) - @param subframe subframe index where Msg3 is to be transmitted (n, n+1 or n+2) -*/ -void nr_get_Msg3_alloc(NR_DL_FRAME_PARMS *frame_parms, - uint8_t current_subframe, - uint32_t current_frame, - uint32_t *frame, - uint8_t *subframe); - -/*! \brief Function to compute timing of Msg3 retransmission on UL-SCH (first UE transmission in RA procedure). - @param frame_parms Pointer to DL frame parameter descriptor - @param current_subframe Index of subframe where RA_RNTI was received - @param current_frame Index of frame where RA_RNTI was received - @param frame Frame index where Msg3 is to be transmitted (n+6 mod 10 for FDD, different for TDD) - @param subframe subframe index where Msg3 is to be transmitted (n, n+1 or n+2) -*/ -void nr_get_Msg3_alloc_ret(NR_DL_FRAME_PARMS *frame_parms, - uint8_t current_subframe, - uint32_t current_frame, - uint32_t *frame, - uint8_t *subframe); - -/*! \brief Get ULSCH harq_pid for Msg3 from RAR subframe. This returns n+k mod 10 (k>6) and corresponds to the rule in Section 6.1.1 from 36.213 - @param frame_parms Pointer to DL Frame Parameters - @param frame Frame index - @param current_subframe subframe of RAR transmission - @returns harq_pid (0 ... 7) - */ -uint8_t nr_get_Msg3_harq_pid(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t current_subframe); - -/*! \brief Get ULSCH harq_pid from PHICH subframe - @param frame_parms Pointer to DL Frame Parameters - @param subframe subframe of PHICH - @returns harq_pid (0 ... 7) - */ - -/*! \brief Function to indicate failure of contention resolution or RA procedure. It places the UE back in PRACH mode. - @param Mod_id Instance index of UE - @param CC_id Component Carrier Index - @param eNB_index Index of eNB - */ -void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index); - -/*! \brief Function to indicate success of contention resolution or RA procedure. - @param Mod_id Instance index of UE - @param CC_id Component Carrier Index - @param eNB_index Index of eNB - */ -void ra_succeeded(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index); - /*! \brief UE PRACH procedures. @param @param @@ -223,74 +123,6 @@ void ra_succeeded(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index); */ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id); -int is_nr_prach_subframe(NR_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t subframe); - -#if 0 -/*! \brief Compute ACK/NACK information for PUSCH/PUCCH for UE transmission in subframe n. This function implements table 10.1-1 of 36.213, p. 69. - @param frame_parms Pointer to DL frame parameter descriptor - @param harq_ack Pointer to dlsch_ue harq_ack status descriptor - @param subframe Subframe for UE transmission (n in 36.213) - @param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH - @returns status indicator for PUCCH/PUSCH transmission -*/ -uint8_t nr_get_ack(NR_DL_FRAME_PARMS *frame_parms,nr_harq_status_t *harq_ack,uint8_t subframe_tx,uint8_t subframe_rx,uint8_t *o_ACK, uint8_t cw_idx); - -/*! \brief Reset ACK/NACK information - @param frame_parms Pointer to DL frame parameter descriptor - @param harq_ack Pointer to dlsch_ue harq_ack status descriptor - @param subframe Subframe for UE transmission (n in 36.213) - @param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH - @returns status indicator for PUCCH/PUSCH transmission -*/ -uint8_t nr_reset_ack(NR_DL_FRAME_PARMS *frame_parms, - nr_harq_status_t *harq_ack, - unsigned char subframe_tx, - unsigned char subframe_rx, - unsigned char *o_ACK, - uint8_t *pN_bundled, - uint8_t cw_idx); - -/*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6) - @param frame_parms Pointer to DL frame parameter descriptor - @param subframe Subframe for UE transmission (n in 36.213) - @param ACK_index TTI bundling index (0,1) - @returns Subframe index for corresponding DL transmission -*/ -uint8_t nr_ul_ACK_subframe2_dl_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe,uint8_t ACK_index); - -/*! \brief Computes number of DL subframes represented by a particular ACK received on UL (M from Table 10.1-1 in 36.213, p. 69 in version 8.6) - @param frame_parms Pointer to DL frame parameter descriptor - @param subframe Subframe for UE transmission (n in 36.213) - @returns Number of DL subframes (M) -*/ -uint8_t nr_ul_ACK_subframe2_M(NR_DL_FRAME_PARMS *frame_parms,unsigned char subframe); - -/*! \brief Indicates the SR TXOp in current subframe. Implements Table 10.1-5 from 36.213. - @param phy_vars_ue Pointer to UE variables - @param proc Pointer to RXn_TXnp4 thread context - @param eNB_id ID of eNB which is to receive the SR - @returns 1 if TXOp is active. -*/ -#endif -uint8_t nr_is_SR_TXOp(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id); - -/*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n - @param frame_parms Pointer to DL frame parameters - @param proc Pointer to RXn-TXnp4 proc information - @param n subframe of PDCCH - @returns UL subframe corresponding to pdcch order -*/ -uint8_t nr_pdcch_alloc2ul_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t n); - -/*! \brief Gives the UL frame corresponding to a PDDCH order in subframe n - @param frame_parms Pointer to DL frame parameters - @param frame Frame of received PDCCH - @param n subframe of PDCCH - @returns UL frame corresponding to pdcch order -*/ -uint32_t nr_pdcch_alloc2ul_frame(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n); - - int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); /*! \brief UL time alignment procedures for TA application @@ -302,61 +134,6 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx); unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb); -void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index); - -#if 0 -/*! \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in -subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For -TDD, this routine computes the complex procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2) -@param phy_vars_ue Pointer to UE variables -@param proc Pointer to RXn-TXnp4 proc information -@param harq_ack Pointer to dlsch_ue harq_ack status descriptor -@param eNB_id Index of eNB -@param b Pointer to PUCCH payload (b[0],b[1]) -@param SR 1 means there's a positive SR in parallel to ACK/NAK -@returns n1_pucch -*/ -uint16_t nr_get_n1_pucch(PHY_VARS_NR_UE *phy_vars_ue, - UE_nr_rxtx_proc_t *proc, - nr_harq_status_t *harq_ack, - uint8_t eNB_id, - uint8_t *b, - uint8_t SR); - -#endif - -/*! \brief This function retrieves the PHY UE mode. It is used as a helper function for the UE MAC. - @param Mod_id Local UE index on which to act - @param CC_id Component Carrier Index - @param gNB_index ID of gNB - @returns UE mode -*/ -UE_MODE_t get_nrUE_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t gNB_index); - -/*! \brief This function implements the power control mechanism for PUCCH from 36.213. - @param phy_vars_ue PHY variables - @param proc Pointer to proc descriptor - @param eNB_id Index of eNB - @param pucch_fmt Format of PUCCH that is being transmitted - @returns Transmit power - */ -int16_t nr_pucch_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t subframe,uint8_t eNB_id,PUCCH_FMT_t pucch_fmt); - -/*! \brief This function implements the power control mechanism for PUCCH from 36.213. - @param phy_vars_ue PHY variables - @param proc Pointer to proc descriptor - @param eNB_id Index of eNB - @param j index of type of PUSCH (SPS, Normal, Msg3) - @returns Transmit power - */ -void nr_pusch_power_cntl(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t j, uint8_t abstraction_flag); - -void nr_get_cqipmiri_params(PHY_VARS_NR_UE *ue,uint8_t eNB_id); - -void nr_dump_dlsch(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid); -void nr_dump_dlsch_SI(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe); -void nr_dump_dlsch_ra(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe); - void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx); int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index e131bcef2a..697638f6cf 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -227,10 +227,6 @@ int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL){ return (amp_x_100); } -UE_MODE_t get_nrUE_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t gNB_id){ - return(PHY_vars_UE_g[Mod_id][CC_id]->UE_mode[gNB_id]); -} - // convert time factor "16 * 64 * T_c / (2^mu)" in N_TA calculation in TS38.213 section 4.2 to samples by multiplying with samples per second // 16 * 64 * T_c / (2^mu) * samples_per_second // = 16 * T_s / (2^mu) * samples_per_second @@ -1042,273 +1038,6 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, } -/*! - * \brief This is the UE synchronize thread. - * It performs band scanning and synchonization. - * \param arg is a pointer to a \ref PHY_VARS_NR_UE structure. - * \returns a pointer to an int. The storage is not on the heap and must not be freed. - */ -#ifdef UE_SLOT_PARALLELISATION -#define FIFO_PRIORITY 40 -void *UE_thread_slot1_dl_processing(void *arg) { - - static __thread int UE_dl_slot1_processing_retval; - struct rx_tx_thread_data *rtd = arg; - UE_nr_rxtx_proc_t *proc = rtd->proc; - PHY_VARS_NR_UE *ue = rtd->UE; - - uint8_t pilot1; - - proc->instance_cnt_slot1_dl_processing=-1; - proc->nr_slot_rx = proc->sub_frame_start * ue->frame_parms.slots_per_subframe; - - char threadname[256]; - sprintf(threadname,"UE_thread_slot1_dl_processing_%d", proc->sub_frame_start); - - cpu_set_t cpuset; - CPU_ZERO(&cpuset); - if ( (proc->sub_frame_start+1)%RX_NB_TH == 0 && threads.slot1_proc_one != -1 ) - CPU_SET(threads.slot1_proc_one, &cpuset); - if ( RX_NB_TH > 1 && (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.slot1_proc_two != -1 ) - CPU_SET(threads.slot1_proc_two, &cpuset); - if ( RX_NB_TH > 2 && (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.slot1_proc_three != -1 ) - CPU_SET(threads.slot1_proc_three, &cpuset); - - init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, - threadname); - - while (!oai_exit) { - if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { - LOG_E( PHY, "[SCHED][UE] error locking mutex for UE slot1 dl processing\n" ); - exit_fun("nothing to add"); - } - while (proc->instance_cnt_slot1_dl_processing < 0) { - // most of the time, the thread is waiting here - pthread_cond_wait( &proc->cond_slot1_dl_processing, &proc->mutex_slot1_dl_processing ); - } - if (pthread_mutex_unlock(&proc->mutex_slot1_dl_processing) != 0) { - LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE slot1 dl processing \n" ); - exit_fun("nothing to add"); - } - - int frame_rx = proc->frame_rx; - uint8_t subframe_rx = proc->nr_slot_rx / ue->frame_parms.slots_per_subframe; - uint8_t next_subframe_rx = (1 + subframe_rx) % NR_NUMBER_OF_SUBFRAMES_PER_FRAME; - uint8_t next_subframe_slot0 = next_subframe_rx * ue->frame_parms.slots_per_subframe; - - uint8_t slot1 = proc->nr_slot_rx + 1; - uint8_t pilot0 = 0; - - //printf("AbsSubframe %d.%d execute dl slot1 processing \n", frame_rx, nr_slot_rx); - - if (ue->frame_parms.Ncp == 0) { // normal prefix - pilot1 = 4; - } else { // extended prefix - pilot1 = 3; - } - - /**** Slot1 FE Processing ****/ - - start_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); - - // I- start dl slot1 processing - // do first symbol of next downlink nr_slot_rx for channel estimation - /* - // 1- perform FFT for pilot ofdm symbols first (ofdmSym0 next nr_slot_rx ofdmSym11) - if (nr_subframe_select(&ue->frame_parms,next_nr_slot_rx) != SF_UL) - { - front_end_fft(ue, - pilot0, - next_subframe_slot0, - 0, - 0); - } - - front_end_fft(ue, - pilot1, - slot1, - 0, - 0); - */ - // 1- perform FFT - for (int l=1; lframe_parms.symbols_per_slot>>1; l++) - { - //if( (l != pilot0) && (l != pilot1)) - { - - start_meas(&ue->ofdm_demod_stats); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN); - //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,nr_slot_rx,slot1,l); - front_end_fft(ue, - l, - slot1, - 0, - 0); - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); - stop_meas(&ue->ofdm_demod_stats); - } - } // for l=1..l2 - - if (nr_subframe_select(&ue->frame_parms,next_nr_slot_rx) != SF_UL) - { - //printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,nr_slot_rx,next_subframe_slot0,pilot0); - front_end_fft(ue, - pilot0, - next_subframe_slot0, - 0, - 0); - } - - // 2- perform Channel Estimation for slot1 - for (int l=1; lframe_parms.symbols_per_slot>>1; l++) - { - if(l == pilot1) - { - //wait until channel estimation for pilot0/slot1 is available - uint32_t wait = 0; - while(proc->chan_est_pilot0_slot1_available == 0) - { - usleep(1); - wait++; - } - //printf("[slot1 dl processing] ChanEst symbol %d slot %d wait%d\n",l,slot1,wait); - } - //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,nr_slot_rx,slot1,l); - front_end_chanEst(ue, - l, - slot1, - 0); - ue_measurement_procedures(l-1,ue,proc,0,slot1,0,ue->mode); - } - //printf("AbsSubframe %d.%d ChanEst slot %d, symbol %d\n", frame_rx,nr_slot_rx,next_subframe_slot0,pilot0); - front_end_chanEst(ue, - pilot0, - next_subframe_slot0, - 0); - - if ( (nr_slot_rx == 0) && (ue->decode_MIB == 1)) - { - ue_pbch_procedures(0,ue,proc,0); - } - - proc->chan_est_slot1_available = 1; - //printf("Set available slot 1channelEst to 1 AbsSubframe %d.%d \n",frame_rx,nr_slot_rx); - //printf(" [slot1 dl processing] ==> FFT/CHanEst Done for AbsSubframe %d.%d \n", proc->frame_rx, proc->nr_slot_rx); - - //printf(" [slot1 dl processing] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d \n", proc->frame_rx, proc->nr_slot_rx); - - - - stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]); - if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); - - //wait until pdcch is decoded - uint32_t wait = 0; - while(proc->dci_slot0_available == 0) - { - usleep(1); - wait++; - } - //printf("[slot1 dl processing] AbsSubframe %d.%d LLR Computation Start wait DCI %d\n",frame_rx,nr_slot_rx,wait); - - /**** Pdsch Procedure Slot1 ****/ - // start slot1 thread for Pdsch Procedure (slot1) - // do procedures for C-RNTI - //printf("AbsSubframe %d.%d Pdsch Procedure (slot1)\n",frame_rx,nr_slot_rx); - - - start_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]); - - // start slave thread for Pdsch Procedure (slot1) - // do procedures for C-RNTI - uint8_t gNB_id = 0; - - if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) { - //wait until first ofdm symbol is processed - //wait = 0; - //while(proc->first_symbol_available == 0) - //{ - // usleep(1); - // wait++; - //} - //printf("[slot1 dl processing] AbsSubframe %d.%d LLR Computation Start wait First Ofdm Sym %d\n",frame_rx,nr_slot_rx,wait); - - //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN); - ue_pdsch_procedures(ue, - proc, - gNB_id, - PDSCH, - ue->dlsch[proc->thread_id][gNB_id][0], - NULL, - (ue->frame_parms.symbols_per_slot>>1), - ue->frame_parms.symbols_per_slot-1, - abstraction_flag); - LOG_D(PHY," ------ end PDSCH ChannelComp/LLR slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_slot_rx); - LOG_D(PHY," ------ --> PDSCH Turbo Decoder slot 0/1: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_slot_rx); - } - - // do procedures for SI-RNTI - if ((ue->dlsch_SI[gNB_id]) && (ue->dlsch_SI[gNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - gNB_id, - SI_PDSCH, - ue->dlsch_SI[gNB_id], - NULL, - (ue->frame_parms.symbols_per_slot>>1), - ue->frame_parms.symbols_per_slot-1, - abstraction_flag); - } - - // do procedures for P-RNTI - if ((ue->dlsch_p[gNB_id]) && (ue->dlsch_p[gNB_id]->active == 1)) { - ue_pdsch_procedures(ue, - proc, - gNB_id, - P_PDSCH, - ue->dlsch_p[gNB_id], - NULL, - (ue->frame_parms.symbols_per_slot>>1), - ue->frame_parms.symbols_per_slot-1, - abstraction_flag); - } - // do procedures for RA-RNTI - if ((ue->dlsch_ra[gNB_id]) && (ue->dlsch_ra[gNB_id]->active == 1) && (UE_mode != PUSCH)) { - ue_pdsch_procedures(ue, - proc, - gNB_id, - RA_PDSCH, - ue->dlsch_ra[gNB_id], - NULL, - (ue->frame_parms.symbols_per_slot>>1), - ue->frame_parms.symbols_per_slot-1, - abstraction_flag); - } - - proc->llr_slot1_available=1; - //printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,nr_slot_rx); - - stop_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]); - if (cpumeas(CPUMEAS_GETSTATE)) - LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0)); - - if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) { - LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); - exit_fun("noting to add"); - } - proc->instance_cnt_slot1_dl_processing--; - if (pthread_mutex_unlock(&proc->mutex_slot1_dl_processing) != 0) { - LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE FEP Slo1\n" ); - exit_fun("noting to add"); - } - } - // thread finished - free(arg); - return &UE_dl_slot1_processing_retval; -} -#endif - int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, @@ -1717,50 +1446,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, } -uint8_t nr_is_cqi_TXOp(PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, - uint8_t gNB_id) -{ - int subframe = proc->nr_slot_tx / ue->frame_parms.slots_per_subframe; - int frame = proc->frame_tx; - CQI_REPORTPERIODIC *cqirep = &ue->cqi_report_config[gNB_id].CQI_ReportPeriodic; - - //LOG_I(PHY,"[UE %d][CRNTI %x] AbsSubFrame %d.%d Checking for CQI TXOp (cqi_ConfigIndex %d) isCQIOp %d\n", - // ue->Mod_id,ue->pdcch_vars[gNB_id]->crnti,frame,subframe, - // cqirep->cqi_PMI_ConfigIndex, - // (((10*frame + subframe) % cqirep->Npd) == cqirep->N_OFFSET_CQI)); - - if (cqirep->cqi_PMI_ConfigIndex==-1) - return(0); - else if (((10*frame + subframe) % cqirep->Npd) == cqirep->N_OFFSET_CQI) - return(1); - else - return(0); -} - - -uint8_t nr_is_ri_TXOp(PHY_VARS_NR_UE *ue, - UE_nr_rxtx_proc_t *proc, - uint8_t gNB_id) -{ - int subframe = proc->nr_slot_tx / ue->frame_parms.slots_per_subframe; - int frame = proc->frame_tx; - CQI_REPORTPERIODIC *cqirep = &ue->cqi_report_config[gNB_id].CQI_ReportPeriodic; - int log2Mri = cqirep->ri_ConfigIndex/161; - int N_OFFSET_RI = cqirep->ri_ConfigIndex % 161; - - //LOG_I(PHY,"[UE %d][CRNTI %x] AbsSubFrame %d.%d Checking for RI TXOp (ri_ConfigIndex %d) isRIOp %d\n", - // ue->Mod_id,ue->pdcch_vars[gNB_id]->crnti,frame,subframe, - // cqirep->ri_ConfigIndex, - // (((10*frame + subframe + cqirep->N_OFFSET_CQI - N_OFFSET_RI) % (cqirep->Npd<ri_ConfigIndex==-1) - return(0); - else if (((10*frame + subframe + cqirep->N_OFFSET_CQI - N_OFFSET_RI) % (cqirep->Npd< Date: Mon, 15 Aug 2022 14:51:00 +0200 Subject: [PATCH 06/49] fixes in CSI UE reception and reporting for multiple BWPs --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 15 ++++++++++----- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 76f43eab58..040997a8a4 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2484,6 +2484,11 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, NR_CSI_ReportConfig_t *csirep = csi_measconfig->csi_ReportConfigToAddModList->list.array[csi_report_id]; if(csirep->reportConfigType.present == NR_CSI_ReportConfig__reportConfigType_PR_periodic){ + + const NR_PUCCH_CSI_Resource_t *pucchcsires = csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list.array[0]; + if(pucchcsires->uplinkBandwidthPartId != bwp_id) + continue; + int period, offset; csi_period_offset(csirep, NULL, &period, &offset); @@ -2532,7 +2537,7 @@ uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, } AssertFatal(found != -1, "CSI resource not found among PUCCH resources\n"); - + LOG_D(NR_MAC, "CSI reporting in frame %d slot %d CSI report ID %ld\n", frame, slot, csirep->reportConfigId); pucch->resource_indicator = found; csi_bits += nr_get_csi_payload(mac, pucch, csi_report_id, csi_measconfig); } @@ -2683,9 +2688,9 @@ uint8_t get_csirs_RI_PMI_CQI_payload(NR_UE_MAC_INST_t *mac, if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_idx]->nzp_CSI_ResourceSetId == *(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) { - nr_csi_report_t *csi_report = &mac->csi_report_template[csi_reportconfig->reportConfigId]; + nr_csi_report_t *csi_report = &mac->csi_report_template[csi_idx]; compute_csi_bitlen(csi_MeasConfig, mac->csi_report_template); - n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_reportconfig->reportConfigId); + n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_idx); int cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen; int ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen; @@ -2740,9 +2745,9 @@ uint8_t get_csirs_RSRP_payload(NR_UE_MAC_INST_t *mac, if (csi_MeasConfig->nzp_CSI_RS_ResourceSetToAddModList->list.array[csi_idx]->nzp_CSI_ResourceSetId == *(csi_resourceconfig->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0])) { - nr_csi_report_t *csi_report = &mac->csi_report_template[csi_reportconfig->reportConfigId]; + nr_csi_report_t *csi_report = &mac->csi_report_template[csi_idx]; compute_csi_bitlen(csi_MeasConfig, mac->csi_report_template); - n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_reportconfig->reportConfigId); + n_bits = nr_get_csi_bitlen(mac->csi_report_template, csi_idx); int cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen; int rsrp_bitlen = csi_report->CSI_report_bitlen.rsrp_bitlen; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index cac302980c..7f6da1b915 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2512,8 +2512,25 @@ void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); + // looking for the correct CSI-RS resource in current BWP + NR_NZP_CSI_RS_ResourceSetId_t *nzp = NULL; + for (int csi_list=0; csi_listcsi_ResourceConfigToAddModList->list.count; csi_list++) { + NR_CSI_ResourceConfig_t *csires = csi_measconfig->csi_ResourceConfigToAddModList->list.array[csi_list]; + if(csires->bwp_Id == dl_bwp_id && + csires->csi_RS_ResourceSetList.present == NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB && + csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList) { + nzp = csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list.array[0]; + } + } + + if (nzp == NULL) + return; // no resource associated to current BWP + for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; + // reception of CSI-RS only for current BWP + if (nzpcsi->nzp_CSI_RS_ResourceId != *nzp) + continue; csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset); if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0) continue; From 705c6b76d2c633908b6be6c707fc436e1995c2b7 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 17 Oct 2022 11:58:51 +0100 Subject: [PATCH 07/49] gNB MAC PDU decoding improvements when there are issues in UL TB payload (MAC subPDU overlap) --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 55ddf388a7..b20403b1a4 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -225,7 +225,11 @@ int nr_process_mac_pdu(instance_t module_idP, break; case UL_SCH_LCID_SINGLE_ENTRY_PHR: - AssertFatal(harq_pid>-1,"Invalid HARQ PID %d\n",harq_pid); + if (harq_pid < 0) { + LOG_E(NR_MAC, "Invalid HARQ PID %d\n", harq_pid); + done = 1; + break; + } NR_sched_pusch_t *sched_pusch = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch;; //38.321 section 6.1.3.8 //fixed length @@ -258,18 +262,20 @@ int nr_process_mac_pdu(instance_t module_idP, break; case UL_SCH_LCID_MULTI_ENTRY_PHR_1_OCT: + LOG_E(NR_MAC, "Multi entry PHR not supported\n"); + done = 1; //38.321 section 6.1.3.9 - // varialbe length - AssertFatal(1==0,"Multi entry PHR not supported\n"); + // variable length if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) return 0; /* Extract MULTI ENTRY PHR elements from single octet bitmap for PHR calculation */ break; case UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT: + LOG_E(NR_MAC, "Multi entry PHR not supported\n"); + done = 1; //38.321 section 6.1.3.9 - // varialbe length - AssertFatal(1==0,"Multi entry PHR not supported\n"); + // variable length if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len)) return 0; /* Extract MULTI ENTRY PHR elements from four octets bitmap for PHR calculation */ From 408e7abd2fb4b80cd4ef0c577f329ed47fa27c19 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Thu, 20 Oct 2022 14:39:17 +0100 Subject: [PATCH 08/49] Generate SRS sequence for every received SRS signal --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 68eb160c15..2938c991ee 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -875,11 +875,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { int8_t snr_per_rb[srs_pdu->bwp_size]; int8_t snr; - // At least currently, the configuration is constant, so it is enough to generate the sequence just once. - if (gNB->nr_srs_info[i]->srs_generated_signal_bits == 0) { - generate_srs_nr(srs_pdu, frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, 0, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx); - } - + generate_srs_nr(srs_pdu, frame_parms, gNB->nr_srs_info[i]->srs_generated_signal, 0, gNB->nr_srs_info[i], AMP, frame_rx, slot_rx); int srs_est = nr_get_srs_signal(gNB, frame_rx, slot_rx, srs_pdu, gNB->nr_srs_info[i], srs_received_signal); if (srs_est >= 0) { From d18813b867c26c7c79849a0db440d701255da49b Mon Sep 17 00:00:00 2001 From: Sakthivel Velumani Date: Fri, 21 Oct 2022 18:47:58 -0400 Subject: [PATCH 09/49] Native AVX intrensic call as macro --- CMakeLists.txt | 2 +- cmake_targets/tools/build_helper | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8101f9f6e1..6da0d206cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,7 +289,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb2 -Wl,-rpath -Wl,${C # set a flag for changes in the source code # these changes are related to hardcoded path to include .h files set(debugOpt "-ggdb2 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks") -set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -Og") +set(CMAKE_C_FLAGS_DEBUG "${debugOpt} -O0") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${debugOpt} -O2") set(CMAKE_C_FLAGS_RELEASE "-O3") diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 423389aadc..6a308deaaa 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -926,23 +926,17 @@ install_simde_from_source(){ $SUDO patch /usr/include/simde/x86/avx.h << FIN --- /usr/include/simde/x86/avx.h.old 2022-10-03 19:17:39.828223432 +0200 +++ /usr/include/simde/x86/avx.h 2022-10-05 16:19:55.086019445 +0200 -@@ -3636,12 +3636,16 @@ - SIMDE_FUNCTION_ATTRIBUTES - simde__m256i simde_mm256_insertf128_si256(simde__m256i a, simde__m128i b, int imm8) - SIMDE_REQUIRE_CONSTANT_RANGE(imm8, 0, 1) { -+#if defined(SIMDE_X86_AVX_NATIVE) -+ return _mm256_insertf128_si256(a, b, imm8); -+#else - simde__m256i_private a_ = simde__m256i_to_private(a); - simde__m128i_private b_ = simde__m128i_to_private(b); - - a_.m128i_private[imm8] = b_; - +@@ -3643,6 +3643,9 @@ + simde__m256i simde_mm256_insertf128_si256(simde__m256i a, simde__m128i b, int im + return simde__m256i_from_private(a_); -+#endif } ++#if defined(SIMDE_X86_AVX_NATIVE) ++ #define simde_mm256_insertf128_si256(a, b, imm8) _mm256_insertf128_si256(a, b, imm8) ++#endif #if defined(SIMDE_X86_AVX_ENABLE_NATIVE_ALIASES) #undef _mm256_insertf128_si256 + #define _mm256_insertf128_si256(a, b, imm8) simde_mm256_insertf128_si256(a, b, imm8) FIN } From 55d13bd19a04591ba7bb4700d33490e03e6ef16a Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 24 Oct 2022 12:37:38 +0200 Subject: [PATCH 10/49] Log pod build statistics --- ci-scripts/cls_cluster.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 1d44e7799b..fc46e665a1 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -360,6 +360,7 @@ class Cluster: grep_exp = "\|".join(attemptedImages) mySSH.command(f'oc get images | grep -e \'{grep_exp}\' > cmake_targets/log/image_registry.log', '\$', 10); + mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc get pod $pod -o json >> cmake_targets/log/build_pod_summary.log; done', '\$', 60) build_log_name = f'build_log_{self.testCase_id}' cls_containerize.CopyLogsToExecutor(mySSH, lSourcePath, build_log_name, lIpAddr, 'oaicicd', CONST.CI_NO_PASSWORD) From a3aead9d9f7046a7d0e99c9b8850d65119b76dbe Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 24 Oct 2022 15:16:29 +0200 Subject: [PATCH 11/49] Assign ran-build and oai-physim build jobs to different nodes --- openshift/oai-physim-bc.yaml | 2 ++ openshift/ran-build-bc.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/openshift/oai-physim-bc.yaml b/openshift/oai-physim-bc.yaml index e013a20fd3..b158c569ad 100644 --- a/openshift/oai-physim-bc.yaml +++ b/openshift/oai-physim-bc.yaml @@ -26,6 +26,8 @@ metadata: name: "oai-physim" spec: runPolicy: "Serial" + nodeSelector: + kubernetes.io/hostname: dedale source: type: "Binary" strategy: diff --git a/openshift/ran-build-bc.yaml b/openshift/ran-build-bc.yaml index 84b0f9e589..1b93973dfd 100644 --- a/openshift/ran-build-bc.yaml +++ b/openshift/ran-build-bc.yaml @@ -26,6 +26,8 @@ metadata: name: "ran-build" spec: runPolicy: "Serial" + nodeSelector: + kubernetes.io/hostname: acamas source: type: "Binary" strategy: From 0df6dfba94285d4015ce492e8bf317386e5d4612 Mon Sep 17 00:00:00 2001 From: francescomani Date: Tue, 11 Oct 2022 15:10:32 +0200 Subject: [PATCH 12/49] fixing the new PUCCH procedures --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 25 ++- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 155 +++++++++--------- 2 files changed, 87 insertions(+), 93 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 14214b75d6..36ba747e72 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2376,18 +2376,6 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, else UL_BWP->pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup; - UL_BWP->max_fb_time = 0; - if(DL_BWP->dci_format != NR_DL_DCI_FORMAT_1_0 && - UL_BWP->pucch_Config) { - for (int i=0; ipucch_Config->dl_DataToUL_ACK->list.count; i++) { - if(*UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i] > UL_BWP->max_fb_time) - UL_BWP->max_fb_time = *UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i]; - } - } - else - UL_BWP->max_fb_time = 8; // default value - - if(UE) { // setting PDCCH related structures for sched_ctrl sched_ctrl->search_space = get_searchspace(scc, @@ -2422,8 +2410,18 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, if (UL_BWP->csi_MeasConfig) compute_csi_bitlen (UL_BWP->csi_MeasConfig, UE->csi_report_template); - set_sched_pucch_list(sched_ctrl, UL_BWP, scc); + UL_BWP->max_fb_time = 0; + if(DL_BWP->dci_format != NR_DL_DCI_FORMAT_1_0 && + UL_BWP->pucch_Config) { + for (int i=0; ipucch_Config->dl_DataToUL_ACK->list.count; i++) { + if(*UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i] > UL_BWP->max_fb_time) + UL_BWP->max_fb_time = *UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i]; + } + } + else + UL_BWP->max_fb_time = 8; // default value + set_sched_pucch_list(sched_ctrl, UL_BWP, scc); } if(ra) { @@ -2576,7 +2574,6 @@ void set_sched_pucch_list(NR_UE_sched_ctrl_t *sched_ctrl, const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs]; const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; - const int list_size = n_ul_slots_period << (ul_bwp->max_fb_time/nr_slots_period); if(!sched_ctrl->sched_pucch) { sched_ctrl->sched_pucch = malloc(list_size * sizeof(*sched_ctrl->sched_pucch)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 6ece1ef4f1..f718c6703c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -70,7 +70,7 @@ static void nr_fill_nfapi_pucch(gNB_MAC_INST *nrmac, LOG_D(NR_MAC, "%s %4d.%2d Scheduling pucch reception in %4d.%2d: bits SR %d, DAI %d, CSI %d on res %d\n", - pucch->dai_c>0 ? "pucch_acknak" : "", + pucch->dai_c>0 ? "pucch_acknack" : "", frame, slot, pucch->frame, @@ -204,17 +204,15 @@ void nr_csi_meas_reporting(int Mod_idP, AssertFatal(res_index < n, "CSI pucch resource %ld not found among PUCCH resources\n", pucchcsires->pucch_Resource); - // find free PUCCH that is in order with possibly existing PUCCH - // schedulings (other CSI, SR) - NR_sched_pucch_t *curr_pucch = NULL; - for (int i=0; isched_pucch_size; i++) { - curr_pucch = &sched_ctrl->sched_pucch[i]; - if (!curr_pucch->active) - break; // found an available pucch structure - } - AssertFatal(curr_pucch, - "PUCCH structure not found for UE %04x\n", - UE->rnti); + const NR_ServingCellConfigCommon_t *scc = RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + AssertFatal(tdd || RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD, "Dynamic TDD not handled yet\n"); + const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; + const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; + const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; + const int pucch_index = ((sched_slot % nr_slots_period) - first_ul_slot_period + (sched_slot / nr_slots_period) * n_ul_slots_period) % sched_ctrl->sched_pucch_size; + NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[pucch_index]; + AssertFatal(curr_pucch->active == false, "CSI structure is scheduled in advance. It should be free!\n"); curr_pucch->r_pucch = -1; curr_pucch->frame = sched_frame; curr_pucch->ul_slot = sched_slot; @@ -1062,6 +1060,7 @@ int nr_acknack_scheduling(int mod_id, AssertFatal(tdd || RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD, "Dynamic TDD not handled yet\n"); const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; + const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; /* for the moment, we consider: * * only pucch_sched[0] holds HARQ (and SR) @@ -1090,42 +1089,40 @@ int nr_acknack_scheduling(int mod_id, // check if the slot is UL if(pucch_slot%nr_slots_period < first_ul_slot_period) continue; - const int pucch_frame = frame + ((slot + pdsch_to_harq_feedback[f]) / n_slots_frame); - int inactive_pucch = -1; - NR_sched_pucch_t *curr_pucch = NULL; - for (int i=0; isched_pucch_size; i++) { - curr_pucch = &sched_ctrl->sched_pucch[i]; - // if there is already an active pucch for this frame and slot - if (curr_pucch->active && - curr_pucch->frame == pucch_frame && - curr_pucch->ul_slot == pucch_slot) { - LOG_D(NR_MAC, "pucch_acknak DL %4d.%2d, UL_ACK %4d.%2d Bits already in current PUCCH: DAI_C %d CSI %d\n", - frame, slot, pucch_frame, pucch_slot, curr_pucch->dai_c, curr_pucch->csi_bits); - // we can't schedule if short pucch is already full - if (curr_pucch->csi_bits == 0 && - curr_pucch->dai_c == 2) - continue; - // if there is CSI but simultaneous HARQ+CSI is disable we can't schedule - if(!curr_pucch->simultaneous_harqcsi && - curr_pucch->csi_bits>0) - continue; - // TODO we can't schedule more than 11 bits in PUCCH2 for now - if (curr_pucch->csi_bits + curr_pucch->dai_c >= 10) - continue; + const int pucch_frame = (frame + ((slot + pdsch_to_harq_feedback[f]) / n_slots_frame)) & 1023; + const int pucch_index = ((pucch_slot % nr_slots_period) - first_ul_slot_period + (pucch_slot / nr_slots_period) * n_ul_slots_period) % sched_ctrl->sched_pucch_size; + NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[pucch_index]; + if (curr_pucch->active && + curr_pucch->frame == pucch_frame && + curr_pucch->ul_slot == pucch_slot) { // if there is already a PUCCH in given frame and slot + LOG_D(NR_MAC, "pucch_acknack DL %4d.%2d, UL_ACK %4d.%2d Bits already in current PUCCH: DAI_C %d CSI %d\n", + frame, slot, pucch_frame, pucch_slot, curr_pucch->dai_c, curr_pucch->csi_bits); + // we can't schedule if short pucch is already full + if (curr_pucch->csi_bits == 0 && + curr_pucch->dai_c == 2) + continue; + // if there is CSI but simultaneous HARQ+CSI is disable we can't schedule + if(!curr_pucch->simultaneous_harqcsi && + curr_pucch->csi_bits>0) + continue; + // TODO we can't schedule more than 11 bits in PUCCH2 for now + if (curr_pucch->csi_bits + curr_pucch->dai_c >= 10) + continue; - // otherwise we can schedule in this active PUCCH - // no need to check VRB occupation because already done when PUCCH has been activated - curr_pucch->timing_indicator = f; - curr_pucch->dai_c++; - LOG_D(NR_MAC, "DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d CSI %d\n", - frame,slot,curr_pucch->frame,curr_pucch->ul_slot,i,f,curr_pucch->dai_c,curr_pucch->csi_bits); - return i; // index of current PUCCH structure - } - else if (!curr_pucch->active) - inactive_pucch = i; + // otherwise we can schedule in this active PUCCH + // no need to check VRB occupation because already done when PUCCH has been activated + curr_pucch->timing_indicator = f; + curr_pucch->dai_c++; + LOG_D(NR_MAC, "DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d CSI %d\n", + frame,slot,curr_pucch->frame,curr_pucch->ul_slot,pucch_index,f,curr_pucch->dai_c,curr_pucch->csi_bits); + return pucch_index; // index of current PUCCH structure } - if (inactive_pucch>0) { - curr_pucch = &sched_ctrl->sched_pucch[inactive_pucch]; + else if (curr_pucch->active) { + LOG_E(NR_MAC, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n", + curr_pucch->frame, curr_pucch->ul_slot, pucch_frame, pucch_slot); + continue; + } + else { // unoccupied occasion // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch_slot * MAX_BWP_SIZE]; bool ret = test_pucch0_vrb_occupation(sched_ctrl, @@ -1151,7 +1148,7 @@ int nr_acknack_scheduling(int mod_id, curr_pucch->r_pucch=r_pucch; LOG_D(NR_MAC, "DL %4d.%2d, UL_ACK %4d.%2d Scheduling ACK/NACK in PUCCH %d with timing indicator %d DAI %d\n", - frame,slot,curr_pucch->frame,curr_pucch->ul_slot,inactive_pucch,f,curr_pucch->dai_c); + frame,slot,curr_pucch->frame,curr_pucch->ul_slot,pucch_index,f,curr_pucch->dai_c); // blocking resources for current PUCCH in VRB map for (int l=0; lnr_of_symb; l++) { @@ -1162,7 +1159,7 @@ int nr_acknack_scheduling(int mod_id, vrb_map_UL[bwp_start+prb] |= symb; } - return inactive_pucch; // index of current PUCCH structure + return pucch_index; // index of current PUCCH structure } } LOG_D(NR_MAC, "DL %4d.%2d, Couldn't find scheduling occasion for this HARQ process\n", frame, slot); @@ -1175,7 +1172,6 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) if (!is_xlsch_in_slot(nrmac->ulsch_slot_bitmap[slot / 64], slot)) return; int CC_id = 0; - const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; UE_iterator(nrmac->UE_info.list, UE) { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; @@ -1211,30 +1207,31 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) } AssertFatal(idx>-1,"SR resource not found among PUCCH resources"); - NR_sched_pucch_t *curr_pucch = NULL; - bool found = false; - int free_pucch = -1; - for (int i=0; isched_pucch_size; i++) { - curr_pucch = &sched_ctrl->sched_pucch[i]; - if (curr_pucch->active && - curr_pucch->frame == SFN && - curr_pucch->ul_slot == slot && - curr_pucch->resource_indicator == idx) { - curr_pucch->sr_flag = true; - found = true; - break; - } - else if (!curr_pucch->active) - free_pucch = i; // found an available pucch structure + const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + AssertFatal(tdd || nrmac->common_channels[CC_id].frame_type == FDD, "Dynamic TDD not handled yet\n"); + const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; + const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; + const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; + const int pucch_index = ((slot % nr_slots_period) - first_ul_slot_period + (slot / nr_slots_period) * n_ul_slots_period) % sched_ctrl->sched_pucch_size; + NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[pucch_index]; + + if (curr_pucch->active && + curr_pucch->frame == SFN && + curr_pucch->ul_slot == slot && + curr_pucch->resource_indicator == idx) + curr_pucch->sr_flag = true; + else if (curr_pucch->active) { + LOG_E(NR_MAC, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with SR function frame.slot %d.%d\n", + curr_pucch->frame, curr_pucch->ul_slot, SFN, slot); + continue; } - AssertFatal(found || free_pucch>-1, "Coulnd't find an available PUCCH resource to schedule SR\n"); - if (!found) { + else { uint16_t *vrb_map_UL = &nrmac->common_channels[CC_id].vrb_map_UL[slot * MAX_BWP_SIZE]; int bwp_start = ul_bwp->BWPStart; int bwp_size = ul_bwp->BWPSize; - NR_sched_pucch_t *sched_sr = &sched_ctrl->sched_pucch[free_pucch]; bool ret = test_pucch0_vrb_occupation(sched_ctrl, - sched_sr, + curr_pucch, vrb_map_UL, scc, pucch_Config, @@ -1245,19 +1242,19 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) LOG_E(NR_MAC,"Cannot schedule SR. PRBs not available\n"); continue; } - sched_sr->frame = SFN; - sched_sr->ul_slot = slot; - sched_sr->sr_flag = true; - sched_sr->resource_indicator = idx; - sched_sr->r_pucch = -1; - sched_sr->active = true; - for (int l=0; lnr_of_symb; l++) { - uint16_t symb = SL_to_bitmap(sched_sr->start_symb+l, 1); + curr_pucch->frame = SFN; + curr_pucch->ul_slot = slot; + curr_pucch->sr_flag = true; + curr_pucch->resource_indicator = idx; + curr_pucch->r_pucch = -1; + curr_pucch->active = true; + for (int l=0; lnr_of_symb; l++) { + uint16_t symb = SL_to_bitmap(curr_pucch->start_symb+l, 1); int prb; - if (l==1 && sched_sr->second_hop_prb != 0) - prb = sched_sr->second_hop_prb; + if (l==1 && curr_pucch->second_hop_prb != 0) + prb = curr_pucch->second_hop_prb; else - prb = sched_sr->prb_start; + prb = curr_pucch->prb_start; vrb_map_UL[bwp_start+prb] |= symb; } } From 2f28b5795fd48bca91a592b39e0d6994205fad4f Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 24 Oct 2022 15:18:22 +0200 Subject: [PATCH 13/49] Collect cluster pod metrics during build --- ci-scripts/cls_cluster.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index fc46e665a1..9677fe2891 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -291,6 +291,7 @@ class Cluster: status = status and wait mySSH.command(f'oc logs {ranbuild_job} > cmake_targets/log/ran-build.log', '\$', 10) mySSH.command(f'oc logs {physim_job} > cmake_targets/log/oai-physim.log', '\$', 10) + mySSH.command('oc get pods.metrics.k8s.io > cmake_targets/log/build-metrics.log', '\$', 10) if status: self._recreate_is_tag(mySSH, 'oai-enb', imageTag, 'openshift/oai-enb-is.yaml') @@ -342,6 +343,7 @@ class Cluster: # recover logs mySSH.command(f'oc logs {lteue_job} > cmake_targets/log/oai-lte-ue.log', '\$', 10) mySSH.command(f'oc logs {nrue_job} > cmake_targets/log/oai-nr-ue.log', '\$', 10) + mySSH.command('oc get pods.metrics.k8s.io >> cmake_targets/log/build-metrics.log', '\$', 10) # split and analyze logs imageSize = {} From 1ed52cb4d2fbe9c0aaa6aea4cb689c692a644441 Mon Sep 17 00:00:00 2001 From: Sagar Arora Date: Tue, 25 Oct 2022 14:09:51 +0200 Subject: [PATCH 14/49] Changing the cluster node name --- ci-scripts/cls_cluster.py | 18 +++++++++--------- openshift/oai-physim-bc.yaml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 9677fe2891..68895a04d6 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -262,7 +262,7 @@ class Cluster: attemptedImages += ['ran-base'] status = ranbase_job is not None and self._wait_build_end(mySSH, [ranbase_job], 600) if not status: logging.error('failure during build of ran-base') - mySSH.command(f'oc logs {ranbase_job} > cmake_targets/log/ran-base.log', '\$', 10) + mySSH.command(f'oc logs {ranbase_job} &> cmake_targets/log/ran-base.log', '\$', 10) # recover logs by mounting image self._retag_image_statement(mySSH, 'ran-base', 'ran-base', baseTag, 'openshift/ran-base-log-retrieval.yaml') pod = self._deploy_pod(mySSH, 'openshift/ran-base-log-retrieval.yaml') @@ -289,8 +289,8 @@ class Cluster: wait = ranbuild_job is not None and physim_job is not None and self._wait_build_end(mySSH, [ranbuild_job, physim_job], 1200) if not wait: logging.error('error during build of ranbuild_job or physim_job') status = status and wait - mySSH.command(f'oc logs {ranbuild_job} > cmake_targets/log/ran-build.log', '\$', 10) - mySSH.command(f'oc logs {physim_job} > cmake_targets/log/oai-physim.log', '\$', 10) + mySSH.command(f'oc logs {ranbuild_job} &> cmake_targets/log/ran-build.log', '\$', 10) + mySSH.command(f'oc logs {physim_job} &> cmake_targets/log/oai-physim.log', '\$', 10) mySSH.command('oc get pods.metrics.k8s.io > cmake_targets/log/build-metrics.log', '\$', 10) if status: @@ -319,9 +319,9 @@ class Cluster: if not wait: logging.error('error during build of eNB/gNB') status = status and wait # recover logs - mySSH.command(f'oc logs {enb_job} > cmake_targets/log/oai-enb.log', '\$', 10) - mySSH.command(f'oc logs {gnb_job} > cmake_targets/log/oai-gnb.log', '\$', 10) - mySSH.command(f'oc logs {gnb_aw2s_job} > cmake_targets/log/oai-gnb-aw2s.log', '\$', 10) + mySSH.command(f'oc logs {enb_job} &> cmake_targets/log/oai-enb.log', '\$', 10) + mySSH.command(f'oc logs {gnb_job} &> cmake_targets/log/oai-gnb.log', '\$', 10) + mySSH.command(f'oc logs {gnb_aw2s_job} &> cmake_targets/log/oai-gnb-aw2s.log', '\$', 10) self._recreate_is_tag(mySSH, 'oai-lte-ue', imageTag, 'openshift/oai-lte-ue-is.yaml') self._recreate_bc(mySSH, 'oai-lte-ue', imageTag, 'openshift/oai-lte-ue-bc.yaml') @@ -341,8 +341,8 @@ class Cluster: if not wait: logging.error('error during build of lteUE/nrUE') status = status and wait # recover logs - mySSH.command(f'oc logs {lteue_job} > cmake_targets/log/oai-lte-ue.log', '\$', 10) - mySSH.command(f'oc logs {nrue_job} > cmake_targets/log/oai-nr-ue.log', '\$', 10) + mySSH.command(f'oc logs {lteue_job} &> cmake_targets/log/oai-lte-ue.log', '\$', 10) + mySSH.command(f'oc logs {nrue_job} &> cmake_targets/log/oai-nr-ue.log', '\$', 10) mySSH.command('oc get pods.metrics.k8s.io >> cmake_targets/log/build-metrics.log', '\$', 10) # split and analyze logs @@ -361,7 +361,7 @@ class Cluster: logging.info(f'\u001B[1m{image} size is {imageSize[image]}\u001B[0m') grep_exp = "\|".join(attemptedImages) - mySSH.command(f'oc get images | grep -e \'{grep_exp}\' > cmake_targets/log/image_registry.log', '\$', 10); + mySSH.command(f'oc get images | grep -e \'{grep_exp}\' &> cmake_targets/log/image_registry.log', '\$', 10); mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc get pod $pod -o json >> cmake_targets/log/build_pod_summary.log; done', '\$', 60) build_log_name = f'build_log_{self.testCase_id}' diff --git a/openshift/oai-physim-bc.yaml b/openshift/oai-physim-bc.yaml index b158c569ad..3aa6397811 100644 --- a/openshift/oai-physim-bc.yaml +++ b/openshift/oai-physim-bc.yaml @@ -27,7 +27,7 @@ metadata: spec: runPolicy: "Serial" nodeSelector: - kubernetes.io/hostname: dedale + kubernetes.io/hostname: theseus source: type: "Binary" strategy: From c64c3e61826bd45bc3620a7fa0eb7ddc7f141219 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Fri, 21 Oct 2022 18:47:52 +0100 Subject: [PATCH 15/49] Tutorials: minor updates and improvements --- doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md index 7cd277eea4..d0eab6c53a 100644 --- a/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md +++ b/doc/NR_SA_CN5G_gNB_USRP_COTS_UE_Tutorial.md @@ -21,7 +21,7 @@ In this tutorial we describe how to configure and run a 5G end-to-end setup with Minimum hardware requirements: - Laptop/Desktop/Server for OAI CN5G and OAI gNB - - Operating System: [Ubuntu 20.04.4 LTS](https://releases.ubuntu.com/20.04.4/ubuntu-20.04.4-desktop-amd64.iso) + - Operating System: [Ubuntu 20.04.5 LTS](https://releases.ubuntu.com/20.04/ubuntu-20.04.5-desktop-amd64.iso) - CPU: 8 cores x86_64 @ 3.5 GHz - RAM: 32 GB - Laptop for UE @@ -88,11 +88,12 @@ docker image tag oaisoftwarealliance/trf-gen-cn5g:latest trf-gen-cn5g:latest ## 2.3 OAI CN5G Configuration files Download and copy configuration files: - Copy [docker-compose-basic-nrf.yaml](tutorial_resources/docker-compose-basic-nrf.yaml) to `~/oai-cn5g-fed/docker-compose` -- Copy [oai_db.sql](tutorial_resources/oai_db.sql) to `~/oai-cn5g-fed/docker-compose/database` - -Change permissions on oai_db.sql to prevent mysql permission denied error: ```bash -chmod 644 ~/oai-cn5g-fed/docker-compose/database/oai_db.sql +wget -O ~/oai-cn5g-fed/docker-compose/docker-compose-basic-nrf.yaml https://gitlab.eurecom.fr/oai/openairinterface5g/-/raw/develop/doc/tutorial_resources/docker-compose-basic-nrf.yaml?inline=false +``` +- Copy [oai_db.sql](tutorial_resources/oai_db.sql) to `~/oai-cn5g-fed/docker-compose/database` +```bash +wget -O ~/oai-cn5g-fed/docker-compose/database/oai_db.sql https://gitlab.eurecom.fr/oai/openairinterface5g/-/raw/develop/doc/tutorial_resources/oai_db.sql?inline=false ``` ## 2.4 SIM Card @@ -118,7 +119,7 @@ cd host mkdir build cd build cmake ../ -make -j 4 +make -j $(nproc) make test # This step is optional sudo make install sudo ldconfig From f8c82e69b92e232e2e4f40cefa2802f6e01af4b2 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Tue, 25 Oct 2022 15:49:42 +0200 Subject: [PATCH 16/49] feat(ci): migrating all LTE monolithic scenarios w/ docker approach Signed-off-by: Raphael Defosseux --- ci-scripts/main.py | 1 + .../container_lte_b200_fdd_05Mhz_tm1.xml | 6 +- ...lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml | 142 +++++++++++++++ .../container_lte_b200_fdd_10Mhz_tm1.xml | 169 +++++++++++++++++ .../container_lte_b200_fdd_10Mhz_tm1_cdrx.xml | 105 +++++++++++ .../container_lte_b200_fdd_20Mhz_tm1.xml | 168 +++++++++++++++++ ...xml => container_lte_b200_fdd_cleanup.xml} | 24 +-- .../container_lte_b200_tdd_05Mhz_tm1.xml | 172 ++++++++++++++++++ .../container_lte_b200_tdd_05Mhz_tm2.xml | 172 ++++++++++++++++++ .../container_lte_b200_tdd_10Mhz_tm1.xml | 172 ++++++++++++++++++ .../container_lte_b200_tdd_20Mhz_tm1.xml | 172 ++++++++++++++++++ ...e_b200_tdd_20Mhz_tm1_default_scheduler.xml | 172 ++++++++++++++++++ ...xml => container_lte_b200_tdd_cleanup.xml} | 33 ++-- .../enb_usrp210_band40_test_05mhz_tm1.xml | 150 --------------- .../enb_usrp210_band40_test_05mhz_tm2.xml | 154 ---------------- .../enb_usrp210_band40_test_10mhz_tm1.xml | 152 ---------------- .../enb_usrp210_band40_test_20mhz_tm1.xml | 153 ---------------- ...and40_test_20mhz_tm1_default_scheduler.xml | 152 ---------------- .../xml_files/enb_usrp210_band7_epc_start.xml | 47 ----- ...st_05mhz_tm1_rrc_inactivity_no_flexran.xml | 126 ------------- .../enb_usrp210_band7_test_10mhz_tm1.xml | 144 --------------- .../enb_usrp210_band7_test_10mhz_tm1_cdrx.xml | 89 --------- .../enb_usrp210_band7_test_20mhz_tm1.xml | 144 --------------- .../lte_b200_fdd_05Mhz_tm1/docker-compose.yml | 2 +- .../docker-compose.yml | 43 +++++ .../lte_b200_fdd_10Mhz_tm1/docker-compose.yml | 43 +++++ .../docker-compose.yml | 43 +++++ .../lte_b200_fdd_20Mhz_tm1/docker-compose.yml | 43 +++++ .../lte_b200_tdd_05Mhz_tm1/docker-compose.yml | 38 ++++ .../lte_b200_tdd_05Mhz_tm2/docker-compose.yml | 39 ++++ .../lte_b200_tdd_10Mhz_tm1/docker-compose.yml | 38 ++++ .../lte_b200_tdd_20Mhz_tm1/docker-compose.yml | 38 ++++ .../docker-compose.yml | 38 ++++ 33 files changed, 1836 insertions(+), 1348 deletions(-) create mode 100644 ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml create mode 100644 ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml create mode 100644 ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml create mode 100644 ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml rename ci-scripts/xml_files/{enb_usrp210_band7_build.xml => container_lte_b200_fdd_cleanup.xml} (66%) create mode 100644 ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml create mode 100644 ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml create mode 100644 ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml create mode 100644 ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml create mode 100644 ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml rename ci-scripts/xml_files/{enb_usrp210_band7_epc_closure.xml => container_lte_b200_tdd_cleanup.xml} (64%) delete mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band7_epc_start.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml delete mode 100644 ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml create mode 100644 ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml create mode 100644 ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c56c376b7f..762798b526 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -979,6 +979,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re elif action == 'Deploy_Object': CONTAINERS.DeployObject(HTML, EPC) if CONTAINERS.exitStatus==1: + CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS) RAN.prematureExit = True elif action == 'Undeploy_Object': CONTAINERS.UndeployObject(HTML, RAN) diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml index 28b70f103f..ce9a19fde3 100644 --- a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1.xml @@ -19,12 +19,12 @@ For more information about the OpenAirInterface (OAI) Software Alliance: contact@openairinterface.org -Replace xml_files/enb_usrp210_band7_test_05mhz_tm1.xml +Replaces xml_files/enb_usrp210_band7_test_05mhz_tm1.xml --> - test-05-tm1 - Test-05MHz-TM1 + test-fdd-05-tm1 + Test-FDD-05MHz-TM1 tasks 111110 diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml new file mode 100644 index 0000000000..8ead87d703 --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_fdd_05Mhz_tm1_no_rrc_activity.xml @@ -0,0 +1,142 @@ + + + test-fdd-05-rrc-inactivity + Test-FDD-05MHz-TM1-RRC-Inactivity + tasks + +111110 +040101 +030102 +000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (FDD/Band7/5MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity + 0 + 0 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + IdleSleep + Waiting for 55 seconds + 55 + + + + IdleSleep + Waiting for 10 seconds + 10 + + + + CheckStatusUE + Check UE(s) status before attachment + 0 + + + + CheckStatusUE + Check UE(s) status before data disabling + 2 + + + + CheckStatusUE + Check UE(s) status after data disabling + 0 + + + + CheckStatusUE + Check UE(s) status after data re-enabling + 2 + + + + DataDisable_UE + Disabling Data Service on UE + + + + DataEnable_UE + Enabling Data Service on UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 5 + + + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml new file mode 100644 index 0000000000..ce3161c94c --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1.xml @@ -0,0 +1,169 @@ + + + test-fdd-10-tm1 + Test-FDD-10MHz-TM1 + tasks + +111110 +040101 +030111 +000001 +040301 040511 040613 040614 040615 040651 040652 040653 040654 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (FDD/Band7/10MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1 + 0 + 0 + + + + IdleSleep + Sleep + 5 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1 + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (10MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile) + -u -b 30M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (10MHz - DL/30Mbps/UDP)(30 sec)(single-ue profile) + -u -b 30M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/30Mbps/UDP)(30 sec)(unbalanced profile) + -u -b 30M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (10MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm + 50 + balanced + + + + Iperf + iperf (10MHz - UL/18Mbps/UDP)(30 sec)(balanced profile) + -u -b 18M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (10MHz - UL/18Mbps/UDP)(30 sec)(single-ue profile) + -u -b 18M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm -R + 50 + balanced + + + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml new file mode 100644 index 0000000000..4d09bada08 --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_fdd_10Mhz_tm1_cdrx.xml @@ -0,0 +1,105 @@ + + + test-fdd-10-cdrx-tm1 + Test-FDD-10MHz-CDRX-TM1 + tasks + +111110 +040101 +030112 +040301 040512 040612 040650 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (FDD/Band7/10MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx + 0 + 0 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (10MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile) + -u -b 30M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (10MHz - UL/20Mbps/UDP)(30 sec)(balanced profile) + -u -b 20M -t 30 -i 1 -R + 50 + balanced + + + + diff --git a/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml new file mode 100644 index 0000000000..092ee208d1 --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_fdd_20Mhz_tm1.xml @@ -0,0 +1,168 @@ + + + test-fdd-20-tm1 + Test-FDD-20MHz-TM1 + tasks + +111110 +040101 +030121 +000001 +040301 040521 040623 040624 040625 040662 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (FDD/Band7/20MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1 + 0 + 0 + + + + IdleSleep + Sleep + 5 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1 + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 5 + + + + Iperf + iperf (20MHz - DL/70Mbps/UDP)(30 sec)(balanced profile) + -u -b 70M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile) + -u -b 70M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/70Mbps/UDP)(30 sec)(unbalanced profile) + -u -b 70M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm + 50 + balanced + + + + Iperf + iperf (20MHz - UL/12Mbps/UDP)(30 sec)(balanced profile) + -u -b 12M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (20MHz - UL/17Mbps/UDP)(30 sec)(single-ue profile) + -u -b 17M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(balanced profile) + -t 30 -i 1 -fm -R + 50 + balanced + + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7_build.xml b/ci-scripts/xml_files/container_lte_b200_fdd_cleanup.xml similarity index 66% rename from ci-scripts/xml_files/enb_usrp210_band7_build.xml rename to ci-scripts/xml_files/container_lte_b200_fdd_cleanup.xml index bfaaceaa2d..bc9d2cb361 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_build.xml +++ b/ci-scripts/xml_files/container_lte_b200_fdd_cleanup.xml @@ -21,18 +21,18 @@ --> - build-tab - Build - wrench - - 010101 - - + test-fdd-cleanup + CleanUp 4G LTE FDD + trash + + 222222 + + - - Build_eNB - Build eNB (USRP) - -w USRP -c --eNB --ninja - + + Clean_Test_Server_Images + Clean Test Images on Test Server + 0 + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml new file mode 100644 index 0000000000..fa191cd163 --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm1.xml @@ -0,0 +1,172 @@ + + + test-tdd-05-tm1 + Test-TDD-05MHz-TM1 + tasks + +111110 +040101 +030104 +040301 040501 040602 040601 040603 040604 040605 040642 040641 040643 040644 040645 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (TDD/Band40/5MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1 + 0 + 0 + + + + IdleSleep + Sleep + 5 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1 + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced) + -u -b 6.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) + -u -b 6.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 6.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) + -u -b 2M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) + -u -b 2M -t 30 -i 1 -R + 50 + unbalanced + + + + Iperf + iperf (5MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml new file mode 100644 index 0000000000..69997c5586 --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_tdd_05Mhz_tm2.xml @@ -0,0 +1,172 @@ + + + test-tdd-05-tm2 + Test-TDD-05MHz-TM2 + tasks + +111110 +040101 +030105 +040301 040502 040606 040608 040646 040648 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (TDD/Band40/5MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2 + 0 + 0 + + + + IdleSleep + Sleep + 5 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2 + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (5MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced) + -u -b 6.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) + -u -b 6.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 6.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (5MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) + -u -b 2M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) + -u -b 2M -t 30 -i 1 -R + 50 + unbalanced + + + + Iperf + iperf (5MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (5MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml new file mode 100644 index 0000000000..ada6945aad --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_tdd_10Mhz_tm1.xml @@ -0,0 +1,172 @@ + + + test-tdd-10-tm1 + Test-TDD-10MHz-TM1 + tasks + +111110 +040101 +030114 +040301 040511 040612 040611 040613 040614 040615 040652 040651 040653 040654 040655 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (TDD/Band40/10MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1 + 0 + 0 + + + + IdleSleep + Sleep + 5 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1 + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (10MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(balanced) + -u -b 13.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) + -u -b 13.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 13.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (10MHz - DL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (10MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (10MHz - UL/2Mbps/UDP)(30 sec)(balanced) + -u -b 2M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (10MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) + -u -b 2M -t 30 -i 1 -R + 50 + unbalanced + + + + Iperf + iperf (10MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (10MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml new file mode 100644 index 0000000000..ec3de1a5ae --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1.xml @@ -0,0 +1,172 @@ + + + test-tdd-20-tm1 + Test-TDD-20MHz-TM1 + tasks + +111110 +040101 +030124 +040301 040521 040622 040621 040623 040662 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (TDD/Band40/20MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1 + 0 + 0 + + + + IdleSleep + Sleep + 5 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1 + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(balanced) + -u -b 13.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) + -u -b 13.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 13.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (20MHz - UL/2Mbps/UDP)(30 sec)(balanced) + -u -b 2M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (20MHz - UL/2Mbps/UDP)(30 sec)(single-ue) + -u -b 2M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) + -u -b 2M -t 30 -i 1 -R + 50 + unbalanced + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + + diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml new file mode 100644 index 0000000000..390eacd5e8 --- /dev/null +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml @@ -0,0 +1,172 @@ + + + test-tdd-20-tm1 + Test-TDD-20MHz-TM1 + tasks + +111110 +040101 +030125 +040301 040522 040627 040626 040628 040629 040630 040667 040666 040668 040669 040670 040401 040201 +030201 + + + + + Pull_Local_Registry + Pull Images from Local Registry + 0 + oai-enb + + + + Deploy_Object + Deploy eNB (TDD/Band40/20MHz/B200) in a container + ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler + 0 + 0 + + + + IdleSleep + Sleep + 5 + + + + Undeploy_Object + Undeploy eNB + ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler + 0 + 0 + + + + Initialize_UE + Initialize UE + + + + Terminate_UE + Terminate UE + + + + Attach_UE + Attach UE + + + + Detach_UE + Detach UE + + + + Ping + ping (20MHz - 20 sec) + -c 20 + 25 + + + + Iperf + iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(balanced) + -u -b 27.5M -t 30 -i 1 + 50 + balanced + + + + Iperf + iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(single-ue) + -u -b 27.5M -t 30 -i 1 + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(unbalanced) + -u -b 27.5M -t 30 -i 1 + 50 + unbalanced + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm + 50 + single-ue + + + + Iperf + iperf (20MHz - DL/TCP)(30 sec) + -t 30 -i 1 -fm + 50 + + + + Iperf + iperf (20MHz - UL/7Mbps/UDP)(30 sec)(balanced) + -u -b 7M -t 30 -i 1 -R + 50 + balanced + + + + Iperf + iperf (20MHz - UL/7Mbps/UDP)(30 sec)(single-ue) + -u -b 7M -t 30 -i 1 -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/7Mbps/UDP)(30 sec)(unbalanced) + -u -b 7M -t 30 -i 1 -R + 50 + unbalanced + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec)(single-ue) + -t 30 -i 1 -fm -R + 50 + single-ue + + + + Iperf + iperf (20MHz - UL/TCP)(30 sec) + -t 30 -i 1 -fm -R + 50 + + + diff --git a/ci-scripts/xml_files/enb_usrp210_band7_epc_closure.xml b/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml similarity index 64% rename from ci-scripts/xml_files/enb_usrp210_band7_epc_closure.xml rename to ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml index 07fb6951f8..bc9d2cb361 100644 --- a/ci-scripts/xml_files/enb_usrp210_band7_epc_closure.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml @@ -21,27 +21,18 @@ --> - epc-closure - EPC-Closure - log-out - - 050201 060201 070201 - - + test-fdd-cleanup + CleanUp 4G LTE FDD + trash + + 222222 + + - - Terminate_HSS - Terminate HSS - - - - Terminate_MME - Terminate MME - - - - Terminate_SPGW - Terminate SPGW - + + Clean_Test_Server_Images + Clean Test Images on Test Server + 0 + diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml deleted file mode 100644 index f1a2ad2ea3..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm1.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - test-05-tm1 - Test-05MHz-TM1 - tasks - - 030201 - 040101 - 030104 040301 040501 040602 040601 040603 040604 040605 040642 040641 040643 040644 040645 040401 040201 030201 - - - - - Initialize_eNB - Initialize eNB (TDD/Band40/5MHz) - -O ci-scripts/conf_files/enb.band40.tm1.25PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 25 - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced) - -u -b 6.5M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) - -u -b 6.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 6.5M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec) - -t 30 -i 1 -fm - 50 - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) - -u -b 2M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) - -u -b 2M -t 30 -i 1 -R - 50 - unbalanced - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec) - -t 30 -i 1 -fm -R - 50 - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml deleted file mode 100644 index 9295306f23..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_05mhz_tm2.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - test-05-tm2 - Test-05MHz-TM2 - tasks - 1 - True - 040608 - - 030201 - 040101 - 030105 040301 040502 040606 040608 040646 040648 040401 040201 030201 - - - - - Initialize_eNB - Initialize eNB (TDD/Band40/5MHz) - -O ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 25 - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(balanced) - -u -b 6.5M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(single-ue) - -u -b 6.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (5MHz - DL/6.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 6.5M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (5MHz - DL/TCP)(30 sec) - -t 30 -i 1 -fm - 50 - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(balanced) - -u -b 2M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) - -u -b 2M -t 30 -i 1 -R - 50 - unbalanced - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (5MHz - UL/TCP)(30 sec) - -t 30 -i 1 -fm -R - 50 - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml deleted file mode 100644 index d2877fc01e..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_10mhz_tm1.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - test-10-tm1 - Test-10MHz-TM1 - tasks - True - 040615 - - 030201 - 040101 - 030114 040301 040511 040612 040611 040613 040614 040615 040652 040651 040653 040654 040655 040401 040201 030201 - - - - - Initialize_eNB - Initialize eNB (TDD/Band40/10MHz/info) - -O ci-scripts/conf_files/enb.band40.tm1.50PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (10MHz - 20 sec) - -c 20 - 25 - - - - Iperf - iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(balanced) - -u -b 13.5M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) - -u -b 13.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/13.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 13.5M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (10MHz - DL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/TCP)(30 sec) - -t 30 -i 1 -fm - 50 - - - - Iperf - iperf (10MHz - UL/2Mbps/UDP)(30 sec)(balanced) - -u -b 2M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (10MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) - -u -b 2M -t 30 -i 1 -R - 50 - unbalanced - - - - Iperf - iperf (10MHz - UL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/TCP)(30 sec) - -t 30 -i 1 -fm -R - 50 - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml deleted file mode 100644 index 1b32b873ca..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - test-20-tm1 - Test-20MHz-TM1 - tasks - 1 - True - 040623 - - 030201 - 040101 - 030124 040301 040521 040622 040621 040623 040662 040401 040201 030201 - - - - - Initialize_eNB - Initialize eNB (TDD/Band40/20MHz/info) - -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (20MHz - 20 sec) - -c 20 - 25 - - - - Iperf - iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(balanced) - -u -b 13.5M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(single-ue) - -u -b 13.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/13.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 13.5M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec) - -t 30 -i 1 -fm - 50 - - - - Iperf - iperf (20MHz - UL/2Mbps/UDP)(30 sec)(balanced) - -u -b 2M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (20MHz - UL/2Mbps/UDP)(30 sec)(single-ue) - -u -b 2M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/2Mbps/UDP)(30 sec)(unbalanced) - -u -b 2M -t 30 -i 1 -R - 50 - unbalanced - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec) - -t 30 -i 1 -fm -R - 50 - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml deleted file mode 100644 index adf03d802a..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - test-20-tm1-defSched - Test-20MHz-TM1-default-scheduler - tasks - True - 040522 - - 030201 - 040101 - 030125 040301 040522 040627 040626 040628 040629 040630 040667 040666 040668 040669 040670 040401 040201 030201 - - - - - Initialize_eNB - Initialize eNB (TDD/Band40/20MHz/info) - -O ci-scripts/conf_files/enb.band40.tm1.100PRB.FairScheduler.usrpb210.conf --MACRLCs.[0].scheduler_mode default --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (20MHz - 20 sec) - -c 20 - 25 - - - - Iperf - iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(balanced) - -u -b 27.5M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(single-ue) - -u -b 27.5M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/27.5Mbps/UDP)(30 sec)(unbalanced) - -u -b 27.5M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec) - -t 30 -i 1 -fm - 50 - - - - Iperf - iperf (20MHz - UL/7Mbps/UDP)(30 sec)(balanced) - -u -b 7M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (20MHz - UL/7Mbps/UDP)(30 sec)(single-ue) - -u -b 7M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/7Mbps/UDP)(30 sec)(unbalanced) - -u -b 7M -t 30 -i 1 -R - 50 - unbalanced - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec)(single-ue) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec) - -t 30 -i 1 -fm -R - 50 - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band7_epc_start.xml b/ci-scripts/xml_files/enb_usrp210_band7_epc_start.xml deleted file mode 100644 index 354cff346e..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band7_epc_start.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - epc-start-tab - EPC-Start - log-in - - 050101 060101 070101 - - - - - Initialize_HSS - Initialize HSS - - - - Initialize_MME - Initialize MME - - - - Initialize_SPGW - Initialize SPGW - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml deleted file mode 100644 index 90d54a2c82..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_05mhz_tm1_rrc_inactivity_no_flexran.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - test-05-tm1-rrc-no-flex - Test-05MHz-TM1-RRC-Inactivity - tasks - 1 - - 030201 - 040101 - 030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201 - - - - - IdleSleep - Waiting for 55 seconds - 55 - - - - IdleSleep - Waiting for 10 seconds - 10 - - - - CheckStatusUE - Check UE(s) status before attachment - 0 - - - - CheckStatusUE - Check UE(s) status before data disabling - 2 - - - - CheckStatusUE - Check UE(s) status after data disabling - 0 - - - - CheckStatusUE - Check UE(s) status after data re-enabling - 2 - - - - Initialize_eNB - Initialize eNB (FDD/Band7/5MHz) for RRC Inactivity Timer testing -- no FlexRan Ctl - -O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - DataDisable_UE - Disabling Data Service on UE - - - - DataEnable_UE - Enabling Data Service on UE - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 5 - - - - Ping - ping (5MHz - 20 sec) - -c 20 - 5 - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml deleted file mode 100644 index 01388a5aa1..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - test-10-tm1 - Test-10MHz-TM1 - tasks - - 030201 - 040101 - 030111 040301 040511 040613 040614 040615 040616 040617 040651 040652 040653 040654 040401 040201 030201 - - - - - Initialize_eNB - Initialize eNB (FDD/Band7/10MHz) - -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --eNBs.[0].component_carriers.[0].drx_Config_present prRelease --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (10MHz - 20 sec) - -c 20 - 5 - - - - Iperf - iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile) - -u -b 30M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (10MHz - DL/30Mbps/UDP)(30 sec)(single-ue profile) - -u -b 30M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/30Mbps/UDP)(30 sec)(unbalanced profile) - -u -b 30M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (10MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (10MHz - DL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm - 50 - balanced - - - - Iperf - iperf (10MHz - UL/18Mbps/UDP)(30 sec)(balanced profile) - -u -b 18M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (10MHz - UL/18Mbps/UDP)(30 sec)(single-ue profile) - -u -b 18M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (10MHz - UL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm -R - 50 - balanced - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml deleted file mode 100644 index 28140305db..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_10mhz_tm1_cdrx.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - test-10-cdrx-tm1 - Test-10MHz-CDRX-TM1 - tasks - 1 - - 030201 - 040101 - 030112 040302 040512 040612 040650 040401 040201 030201 - - - - - Initialize_eNB - Initialize eNB (FDD/Band7/10MHz) with CDRX - -O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf --eNBs.[0].component_carriers.[0].drx_Config_present prSetup --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (10MHz - 20 sec) - -c 20 - 5 - - - - Iperf - iperf (10MHz - DL/30Mbps/UDP)(30 sec)(balanced profile) - -u -b 30M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (10MHz - UL/20Mbps/UDP)(30 sec)(balanced profile) - -u -b 20M -t 30 -i 1 -R - 50 - balanced - - - diff --git a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml b/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml deleted file mode 100644 index b25f75d2d3..0000000000 --- a/ci-scripts/xml_files/enb_usrp210_band7_test_20mhz_tm1.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - test-20-tm1 - Test-20MHz-TM1 - tasks - - 030201 - 040101 - 030121 040301 040521 040623 040624 040625 040662 040401 040201 030201 - - 040626 040627 040661 040663 040664 - - - Initialize_eNB - Initialize eNB (FDD/Band7/20MHz) - -O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf --log_config.global_log_options level,nocolor,time - - - - Terminate_eNB - Terminate eNB - - - - Initialize_UE - Initialize UE - - - - Terminate_UE - Terminate UE - - - - Attach_UE - Attach UE - - - - Detach_UE - Detach UE - - - - Ping - ping (20MHz - 20 sec) - -c 20 - 5 - - - - Iperf - iperf (20MHz - DL/70Mbps/UDP)(30 sec)(balanced profile) - -u -b 70M -t 30 -i 1 - 50 - balanced - - - - Iperf - iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile) - -u -b 70M -t 30 -i 1 - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/70Mbps/UDP)(30 sec)(unbalanced profile) - -u -b 70M -t 30 -i 1 - 50 - unbalanced - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm - 50 - single-ue - - - - Iperf - iperf (20MHz - DL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm - 50 - balanced - - - - Iperf - iperf (20MHz - UL/12Mbps/UDP)(30 sec)(balanced profile) - -u -b 12M -t 30 -i 1 -R - 50 - balanced - - - - Iperf - iperf (20MHz - UL/17Mbps/UDP)(30 sec)(single-ue profile) - -u -b 17M -t 30 -i 1 -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec)(single-ue profile) - -t 30 -i 1 -fm -R - 50 - single-ue - - - - Iperf - iperf (20MHz - UL/TCP)(30 sec)(balanced profile) - -t 30 -i 1 -fm -R - 50 - balanced - - - diff --git a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml index e7309df77c..b98830d0f3 100644 --- a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml +++ b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1/docker-compose.yml @@ -26,7 +26,7 @@ services: ENB_S1U_IF_NAME: eth0 ENB_S1U_IP_ADDRESS: 172.21.18.46 ENB_X2_IP_ADDRESS: 172.21.18.46 - RRC_INACTIVITY_THRESHOLD: 30 + RRC_INACTIVITY_THRESHOLD: 0 FLEXRAN_ENABLED: 'no' FLEXRAN_INTERFACE_NAME: eth0 FLEXRAN_IPV4_ADDRESS: 172.21.18.48 diff --git a/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml new file mode 100644 index 0000000000..e7309df77c --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_fdd_05Mhz_tm1_no_rrc_activity/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3.8' + +services: + enb_mono_fdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-fdd-05Mhz-tm1 + environment: + USE_FDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 0 + NB_PRB: 25 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 172.21.18.46 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 172.21.18.46 + ENB_X2_IP_ADDRESS: 172.21.18.46 + RRC_INACTIVITY_THRESHOLD: 30 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 172.21.18.48 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml new file mode 100644 index 0000000000..ddcc805955 --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3.8' + +services: + enb_mono_fdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-fdd-10Mhz-tm1 + environment: + USE_FDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 0 + NB_PRB: 50 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 172.21.18.46 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 172.21.18.46 + ENB_X2_IP_ADDRESS: 172.21.18.46 + RRC_INACTIVITY_THRESHOLD: 0 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 172.21.18.48 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 120 --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml new file mode 100644 index 0000000000..78eb94eaca --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_fdd_10Mhz_tm1_cdrx/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3.8' + +services: + enb_mono_fdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-fdd-10Mhz-tm1 + environment: + USE_FDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 0 + NB_PRB: 50 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 172.21.18.46 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 172.21.18.46 + ENB_X2_IP_ADDRESS: 172.21.18.46 + RRC_INACTIVITY_THRESHOLD: 0 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 172.21.18.48 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 120 --eNBs.[0].component_carriers.[0].drx_Config_present prSetup --eNBs.[0].component_carriers.[0].drx_onDurationTimer psf1 --eNBs.[0].component_carriers.[0].drx_InactivityTimer psf1 --eNBs.[0].component_carriers.[0].drx_RetransmissionTimer psf1 --eNBs.[0].component_carriers.[0].drx_longDrx_CycleStartOffset_present prSf128 --eNBs.[0].component_carriers.[0].drx_longDrx_CycleStartOffset 0 --eNBs.[0].component_carriers.[0].drx_shortDrx_Cycle sf16 --eNBs.[0].component_carriers.[0].drx_shortDrx_ShortCycleTimer 3 --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml new file mode 100644 index 0000000000..cc52d72602 --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_fdd_20Mhz_tm1/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3.8' + +services: + enb_mono_fdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-fdd-20Mhz-tm1 + environment: + USE_FDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 7 + DL_FREQUENCY_IN_MHZ: 2680 + UL_FREQUENCY_OFFSET_IN_MHZ: 120 + NID_CELL: 0 + NB_PRB: 100 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + ENB_S1C_IF_NAME: eth0 + ENB_S1C_IP_ADDRESS: 172.21.18.46 + ENB_S1U_IF_NAME: eth0 + ENB_S1U_IP_ADDRESS: 172.21.18.46 + ENB_X2_IP_ADDRESS: 172.21.18.46 + RRC_INACTIVITY_THRESHOLD: 0 + FLEXRAN_ENABLED: 'no' + FLEXRAN_INTERFACE_NAME: eth0 + FLEXRAN_IPV4_ADDRESS: 172.21.18.48 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 115 --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml new file mode 100644 index 0000000000..43d3ba5b3b --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm1/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + enb_mono_tdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-tdd-05Mhz-tm1 + environment: + USE_TDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 40 + DL_FREQUENCY_IN_MHZ: 2350 + UL_FREQUENCY_OFFSET_IN_MHZ: 0 + NID_CELL: 0 + NB_PRB: 25 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + S1C_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 172.21.18.45 + S1U_IF_NAME: eth0 + ENB_X2_IP_ADDRESS: 172.21.18.45 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml new file mode 100644 index 0000000000..9a32803a99 --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_tdd_05Mhz_tm2/docker-compose.yml @@ -0,0 +1,39 @@ +version: '3.8' + +services: + enb_mono_tdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-tdd-05Mhz-tm2 + environment: + USE_TDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 40 + DL_FREQUENCY_IN_MHZ: 2350 + UL_FREQUENCY_OFFSET_IN_MHZ: 0 + NID_CELL: 0 + NB_PRB: 25 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + S1C_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 172.21.18.45 + S1U_IF_NAME: eth0 + ENB_X2_IP_ADDRESS: 172.21.18.45 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 115 --RUs.[0].nb_tx 2 --RUs.[0].nb_rx 2 --eNBs.[0].component_carriers.[0].nb_antenna_ports 2 --log_config.global_log_options level,nocolor,time,line_num,function + #USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 115 --RUs.[0].nb_tx 2 --RUs.[0].nb_rx 2 --eNBs.[0].component_carriers.[0].nb_antenna_ports 2 --eNBs.[0].component_carriers.[0].nb_antennas_tx 2 --eNBs.[0].component_carriers.[0].nb_antennas_rx 2 --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml new file mode 100644 index 0000000000..4a746db6b4 --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_tdd_10Mhz_tm1/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + enb_mono_tdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-tdd-10Mhz-tm1 + environment: + USE_TDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 40 + DL_FREQUENCY_IN_MHZ: 2350 + UL_FREQUENCY_OFFSET_IN_MHZ: 0 + NID_CELL: 0 + NB_PRB: 50 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + S1C_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 172.21.18.45 + S1U_IF_NAME: eth0 + ENB_X2_IP_ADDRESS: 172.21.18.45 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 120 --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml new file mode 100644 index 0000000000..3f7062ea3e --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + enb_mono_tdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-tdd-20Mhz-tm1 + environment: + USE_TDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 40 + DL_FREQUENCY_IN_MHZ: 2350 + UL_FREQUENCY_OFFSET_IN_MHZ: 0 + NID_CELL: 0 + NB_PRB: 100 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + S1C_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 172.21.18.45 + S1U_IF_NAME: eth0 + ENB_X2_IP_ADDRESS: 172.21.18.45 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 115 --eNBs.[0].component_carriers.[0].pdsch_referenceSignalPower -29 --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 diff --git a/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml new file mode 100644 index 0000000000..9c7fc35af6 --- /dev/null +++ b/ci-scripts/yaml_files/lte_b200_tdd_20Mhz_tm1_default_scheduler/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + enb_mono_tdd: + image: oai-enb:latest + privileged: true + container_name: lte-b200-enb-tdd-20Mhz-tm1 + environment: + USE_TDD_MONO: 'yes' + USE_B2XX: 'yes' + ENB_NAME: eNB-in-docker + MCC: '208' + MNC: '92' + MNC_LENGTH: 2 + TAC: 1 + UTRA_BAND_ID: 40 + DL_FREQUENCY_IN_MHZ: 2350 + UL_FREQUENCY_OFFSET_IN_MHZ: 0 + NID_CELL: 0 + NB_PRB: 100 + ENABLE_MEASUREMENT_REPORTS: 'no' + ENABLE_X2: 'no' + MME_S1C_IP_ADDRESS: 172.21.18.48 + S1C_IF_NAME: eth0 + F1_CU_IP_ADDRESS: 172.21.18.45 + S1U_IF_NAME: eth0 + ENB_X2_IP_ADDRESS: 172.21.18.45 + THREAD_PARALLEL_CONFIG: PARALLEL_SINGLE_THREAD + USE_ADDITIONAL_OPTIONS: --RUs.[0].max_rxgain 115 --eNBs.[0].component_carriers.[0].pdsch_referenceSignalPower -29 --MACRLCs.[0].scheduler_mode default --log_config.global_log_options level,nocolor,time,line_num,function + volumes: + - /dev:/dev + network_mode: "host" + healthcheck: + # pgrep does NOT work + test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" + interval: 10s + timeout: 5s + retries: 5 From decaec0860f549cfcfe0e59d0bd9e9ac93012206 Mon Sep 17 00:00:00 2001 From: Sagar Arora Date: Wed, 26 Oct 2022 10:27:49 +0200 Subject: [PATCH 17/49] (fix): typo in collecting pod resource metrics --- ci-scripts/cls_cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 68895a04d6..2f158caa9b 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -291,7 +291,7 @@ class Cluster: status = status and wait mySSH.command(f'oc logs {ranbuild_job} &> cmake_targets/log/ran-build.log', '\$', 10) mySSH.command(f'oc logs {physim_job} &> cmake_targets/log/oai-physim.log', '\$', 10) - mySSH.command('oc get pods.metrics.k8s.io > cmake_targets/log/build-metrics.log', '\$', 10) + mySSH.command('oc get pods.metrics.k8s.io >> cmake_targets/log/build-metrics.log', '\$', 10) if status: self._recreate_is_tag(mySSH, 'oai-enb', imageTag, 'openshift/oai-enb-is.yaml') From c447b814c2ebbc88e114fc579eab63f5bacd1289 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 26 Oct 2022 20:59:19 +0200 Subject: [PATCH 18/49] feat(ci): triggering LTE Monolithic pipelines Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index f9bb72ec47..f2e4267afe 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -285,6 +285,46 @@ pipeline { } } } + stage ("LTE-B200-FDD-LTEBOX-Container") { + when { expression {do4Gtest} } + steps { + script { + triggerSlaveJob ('RAN-LTE-FDD-LTEBOX-Container', 'LTE-B200-FDD-Mono-LTEBOX-Container') + } + } + post { + always { + script { + finalizeSlaveJob('RAN-LTE-FDD-LTEBOX-Container') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } + stage ("LTE-B200-TDD-LTEBOX-Container") { + when { expression {do4Gtest || do5Gtest} } + steps { + script { + triggerSlaveJob ('RAN-LTE-TDD-LTEBOX-Container', 'LTE-B200-TDD-Mono-LTEBOX-Container') + } + } + post { + always { + script { + finalizeSlaveJob('RAN-LTE-TDD-LTEBOX-Container') + } + } + failure { + script { + currentBuild.result = 'FAILURE' + } + } + } + } stage ("NSA-B200-Module-LTEBOX-Container") { when { expression {do4Gtest || do5Gtest} } steps { From f3594a663a31104f9a34d4d65506f1d17237cc19 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Wed, 26 Oct 2022 21:03:23 +0200 Subject: [PATCH 19/49] fix(ci): fixing log collection for xNB run logs and iper operations * Copying everything back to the python executor workspace * For iperf operations, client and server logs are always copied, even when successful * for xNB run logs, since we could delete completely xNB workspaces on the python executor, they are always there * Copying back to the xNB server #0 for artifacting Signed-off-by: Raphael Defosseux --- ci-scripts/cls_oaicitest.py | 36 +++++++++++++++++++++++++++++++++++- ci-scripts/ran.py | 10 ++++++++++ ci-scripts/sshconnection.py | 5 +++-- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py index f0cf43ef27..05181a168e 100644 --- a/ci-scripts/cls_oaicitest.py +++ b/ci-scripts/cls_oaicitest.py @@ -2383,6 +2383,8 @@ class OaiCiTest(): iperf_status = SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "/data/local/tmp/iperf -c ' + EPC_Iperf_UE_IPAddress + ' ' + modified_options + ' -p ' + str(port) + '"\' 2>&1 > iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) SSH.command('fromdos -o iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) SSH.command('cat iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', 5) + # Copying locally iperf client for artifacting + SSH.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, EPC.SourceCodePath+ '/scripts/iperf_' + self.testCase_id + '_' + device_id + '.log', '.') # TIMEOUT Case if iperf_status < 0: SSH.close() @@ -2421,6 +2423,10 @@ class OaiCiTest(): SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath+ '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') filename='iperf_server_' + self.testCase_id + '_' + device_id + '.log' self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options,filename,0) + else: + # Copying all the time the iperf server for artifacting + if launchFromEpc: + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath+ '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') # in case of OAI-UE if (device_id == 'OAI-UE'): SSH.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/iperf_' + self.testCase_id + '_' + device_id + '.log', '.') @@ -2780,6 +2786,8 @@ class OaiCiTest(): os.remove('iperf_' + self.testCase_id + '_' + device_id + '.log') if (useIperf3): SSH.command('stdbuf -o0 iperf3 -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) + # Copying the iperf client locally for artifacting + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/iperf_' + self.testCase_id + '_' + device_id + '.log', '.') clientStatus = 0 self.Iperf_analyzeV3Output(lock, UE_IPAddress, device_id, statusQueue,SSH) @@ -2795,6 +2803,8 @@ class OaiCiTest(): iperf_status = SSH.command('docker exec -it prod-trf-gen /bin/bash -c "' + prefix + 'iperf -c ' + UE_IPAddress + ' ' + modified_options + '" 2>&1 | tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) else: iperf_status = SSH.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0) + # Copying the iperf client locally for artifacting + SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/scripts/iperf_' + self.testCase_id + '_' + device_id + '.log', '.') else: if self.ueIperfVersion == self.dummyIperfVersion: prefix = '' @@ -2862,6 +2872,13 @@ class OaiCiTest(): pass filename='iperf_server_' + self.testCase_id + '_' + device_id + '.log' self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, modified_options,filename,0) + else: + # Copying all the time the iperf server for artifacting + time.sleep(1) + if (device_id == 'OAI-UE'): + SSH.copyin(self.UEIPAddress, self.UEUserName, self.UEPassword, self.UESourceCodePath + '/cmake_targets/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') + else: + SSH.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, EPC.SourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.') # in case of OAI UE: if (device_id == 'OAI-UE'): @@ -3780,7 +3797,11 @@ class OaiCiTest(): HTML.CreateHtmlTestRow('Cannot perform requested X2 Handover', 'KO', CONST.ALL_PROCESSES_OK) def LogCollectBuild(self,RAN): - SSH = sshconnection.SSHConnection() + # Some pipelines are using "none" IP / Credentials + # In that case, just forget about it + if RAN.eNBIPAddress == 'none' or self.UEIPAddress == 'none': + sys.exit(0) + if (RAN.eNBIPAddress != '' and RAN.eNBUserName != '' and RAN.eNBPassword != ''): IPAddress = RAN.eNBIPAddress UserName = RAN.eNBUserName @@ -3793,6 +3814,7 @@ class OaiCiTest(): SourceCodePath = self.UESourceCodePath else: sys.exit('Insufficient Parameter') + SSH = sshconnection.SSHConnection() SSH.open(IPAddress, UserName, Password) SSH.command('cd ' + SourceCodePath, '\$', 5) SSH.command('cd cmake_targets', '\$', 5) @@ -3801,6 +3823,10 @@ class OaiCiTest(): SSH.close() def LogCollectPing(self,EPC): + # Some pipelines are using "none" IP / Credentials + # In that case, just forget about it + if self.IPAddress == 'none': + sys.exit(0) SSH = sshconnection.SSHConnection() SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) SSH.command('cd ' + EPC.SourceCodePath, '\$', 5) @@ -3811,6 +3837,10 @@ class OaiCiTest(): SSH.close() def LogCollectIperf(self,EPC): + # Some pipelines are using "none" IP / Credentials + # In that case, just forget about it + if self.IPAddress == 'none': + sys.exit(0) SSH = sshconnection.SSHConnection() SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password) SSH.command('cd ' + EPC.SourceCodePath, '\$', 5) @@ -3821,6 +3851,10 @@ class OaiCiTest(): SSH.close() def LogCollectOAIUE(self): + # Some pipelines are using "none" IP / Credentials + # In that case, just forget about it + if self.UEIPAddress == 'none': + sys.exit(0) SSH = sshconnection.SSHConnection() SSH.open(self.UEIPAddress, self.UEUserName, self.UEPassword) SSH.command('cd ' + self.UESourceCodePath, '\$', 5) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 7a50a12231..ac123ec22d 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -735,6 +735,16 @@ class RANManagement(): def LogCollecteNB(self): mySSH = SSH.SSHConnection() + # Copying back to xNB server any log from all the runs. + # Should also contains ping and iperf logs + absPath = os.path.abspath('.') + if absPath.count('ci-scripts') == 0: + os.chdir('./ci-scripts') + + for x in os.listdir(): + if x.endswith('.log') or x.endswith('.log.png'): + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, x, self.eNBSourceCodePath + '/cmake_targets/', silent=True) + # Back to normal mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) mySSH.command('cd ' + self.eNBSourceCodePath, '\$', 5) mySSH.command('cd cmake_targets', '\$', 5) diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index 5115136dda..d4e5c1661d 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -229,10 +229,11 @@ class SSHConnection(): else: return -1 - def copyout(self, ipaddress, username, password, source, destination): + def copyout(self, ipaddress, username, password, source, destination, silent=False): count = 0 copy_status = False - logging.info('scp -r ' + source + ' ' + username + '@' + ipaddress + ':' + destination) + if not silent: + logging.info('scp -r ' + source + ' ' + username + '@' + ipaddress + ':' + destination) while count < 4: scp_spawn = pexpect.spawn('scp -r ' + source + ' ' + username + '@' + ipaddress + ':' + destination, timeout = 100) scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT]) From 4bf6ce323eb0f92d2dced13c450bc5ea37e1ac3e Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 27 Oct 2022 09:33:01 +0200 Subject: [PATCH 20/49] fix(ci): when running the bare-metal pipelines, some files are already on the target side with root ownership. Copy is bypassed Signed-off-by: Raphael Defosseux --- ci-scripts/ran.py | 2 +- ci-scripts/sshconnection.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index ac123ec22d..d978539097 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -743,7 +743,7 @@ class RANManagement(): for x in os.listdir(): if x.endswith('.log') or x.endswith('.log.png'): - mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, x, self.eNBSourceCodePath + '/cmake_targets/', silent=True) + mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, x, self.eNBSourceCodePath + '/cmake_targets/', silent=True, ignorePermDenied=True) # Back to normal mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) mySSH.command('cd ' + self.eNBSourceCodePath, '\$', 5) diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index d4e5c1661d..c340603ba1 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -229,7 +229,7 @@ class SSHConnection(): else: return -1 - def copyout(self, ipaddress, username, password, source, destination, silent=False): + def copyout(self, ipaddress, username, password, source, destination, silent=False, ignorePermDenied=False): count = 0 copy_status = False if not silent: @@ -245,6 +245,10 @@ class SSHConnection(): if scp_response == 0: count = 10 copy_status = True + elif scp_response == 1 and ignorePermDenied: + logging.warning('Copy was denied but ignored!') + count = 10 + copy_status = True else: logging.warning('1 - scp_response = ' + str(scp_response)) elif scp_response == 1: @@ -253,6 +257,10 @@ class SSHConnection(): if scp_response == 0 or scp_response == 3: count = 10 copy_status = True + elif scp_response == 1 and ignorePermDenied: + logging.warning('Copy was denied but ignored!') + count = 10 + copy_status = True else: logging.warning('2 - scp_response = ' + str(scp_response)) elif scp_response == 2: From 187b3915b246d39c4a42a6989f85b20df2a3cef1 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 27 Oct 2022 09:33:47 +0200 Subject: [PATCH 21/49] fix(ci): little typos in the scenario HTML tab references Signed-off-by: Raphael Defosseux --- .../container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml | 4 ++-- ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml index 390eacd5e8..b5ff90e112 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_20Mhz_tm1_default_scheduler.xml @@ -23,8 +23,8 @@ Replaces xml_files/enb_usrp210_band40_test_20mhz_tm1_default_scheduler.xml --> - test-tdd-20-tm1 - Test-TDD-20MHz-TM1 + test-tdd-20-tm1-def-sched + Test-TDD-20MHz-TM1-Default-Scheduler tasks 111110 diff --git a/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml b/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml index bc9d2cb361..671ef0e5f4 100644 --- a/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml +++ b/ci-scripts/xml_files/container_lte_b200_tdd_cleanup.xml @@ -21,8 +21,8 @@ --> - test-fdd-cleanup - CleanUp 4G LTE FDD + test-tdd-cleanup + CleanUp 4G LTE TDD trash 222222 From 3e5deb4385c22cccb2ae9995b49e03530ab11387 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Thu, 27 Oct 2022 12:29:34 +0200 Subject: [PATCH 22/49] fix(ci): after code review Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 6 +++--- ci-scripts/sshconnection.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index f2e4267afe..b949584830 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -289,7 +289,7 @@ pipeline { when { expression {do4Gtest} } steps { script { - triggerSlaveJob ('RAN-LTE-FDD-LTEBOX-Container', 'LTE-B200-FDD-Mono-LTEBOX-Container') + triggerSlaveJob ('RAN-LTE-FDD-LTEBOX-Container', 'RAN-LTE-FDD-LTEBOX-Container') } } post { @@ -306,10 +306,10 @@ pipeline { } } stage ("LTE-B200-TDD-LTEBOX-Container") { - when { expression {do4Gtest || do5Gtest} } + when { expression {do4Gtest} } steps { script { - triggerSlaveJob ('RAN-LTE-TDD-LTEBOX-Container', 'LTE-B200-TDD-Mono-LTEBOX-Container') + triggerSlaveJob ('RAN-LTE-TDD-LTEBOX-Container', 'RAN-LTE-TDD-LTEBOX-Container') } } post { diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py index c340603ba1..65a0a0bd67 100644 --- a/ci-scripts/sshconnection.py +++ b/ci-scripts/sshconnection.py @@ -246,7 +246,7 @@ class SSHConnection(): count = 10 copy_status = True elif scp_response == 1 and ignorePermDenied: - logging.warning('Copy was denied but ignored!') + logging.warning(f'copyout(): permission denied, not copying file ({source})') count = 10 copy_status = True else: @@ -258,7 +258,7 @@ class SSHConnection(): count = 10 copy_status = True elif scp_response == 1 and ignorePermDenied: - logging.warning('Copy was denied but ignored!') + logging.warning(f'copyout(): permission denied, not copying file ({source})') count = 10 copy_status = True else: From 3247cdd0c3e1f41a815e9d96788a42ec7524cf97 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 27 Oct 2022 09:27:22 +0200 Subject: [PATCH 23/49] addressing review --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 6 - openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c | 2 +- openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 2 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c | 4 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 2 +- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 38 ++-- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 176 +++++++++--------- openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 6 +- openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 3 +- 11 files changed, 122 insertions(+), 121 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index dd138e5265..85d9a641fa 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -1536,12 +1536,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, corr32_im[symb][group][aa]+((int16_t*)(&prod_im[aa]))[0]); #endif - LOG_D(PHY,"pucch2 cw %d group %d aa %d: (%d,%d)+(%d,%d) = (%d,%d)\n",cw,group,aa, - corr32_re[symb][group][aa],corr32_im[symb][group][aa], - ((int16_t*)(&prod_re[aa]))[0], - ((int16_t*)(&prod_im[aa]))[0], - corr32_re[symb][group][aa]+((int16_t*)(&prod_re[aa]))[0], - corr32_im[symb][group][aa]+((int16_t*)(&prod_im[aa]))[0]); corr_re = ( corr32_re[symb][group][aa]+((int16_t*)(&prod_re[aa]))[0]); corr_im = ( corr32_im[symb][group][aa]+((int16_t*)(&prod_im[aa]))[0]); diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c index 94bb084f89..253b85cfce 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c @@ -4427,7 +4427,7 @@ void fill_searchSpaceZero(NR_SearchSpace_t *ss0, NR_Type0_PDCCH_CSS_config_t *ty } -void find_period_offest_SR (NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset) { +void find_period_offset_SR(const NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset) { NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR P_O = SchedulingReqRec->periodicityAndOffset->present; switch (P_O){ case NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl1: diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h index 9a8750ae51..e3ad29b43f 100644 --- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h +++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h @@ -221,7 +221,7 @@ uint16_t compute_pucch_prb_size(uint8_t format, int16_t get_N_RA_RB (int delta_f_RA_PRACH,int delta_f_PUSCH); -void find_period_offest_SR (NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset); +void find_period_offset_SR(const NR_SchedulingRequestResourceConfig_t *SchedulingReqRec, int *period, int *offset); void csi_period_offset(NR_CSI_ReportConfig_t *csirep, struct NR_CSI_ResourcePeriodicityAndOffset *periodicityAndOffset, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 161cdb7079..963a8d4b2f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2388,7 +2388,7 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac, NR_SchedulingRequestResourceConfig_t *SchedulingRequestResourceConfig = pucch_Config->schedulingRequestResourceToAddModList->list.array[SR_resource_id]; int SR_period; int SR_offset; - find_period_offest_SR(SchedulingRequestResourceConfig,&SR_period,&SR_offset); + find_period_offset_SR(SchedulingRequestResourceConfig,&SR_period,&SR_offset); int sfn_sf = frame * n_slots_frame + slot; if ((sfn_sf - SR_offset) % SR_period == 0) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 7155a633ee..6f9011e6ed 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1469,7 +1469,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra LOG_D(NR_MAC,"[RAPROC] Msg4 r_pucch %d (CCEIndex %d, nb_of_candidates %d, delta_PRI %d)\n", r_pucch, CCEIndex, nr_of_candidates, delta_PRI); - int alloc = nr_acknack_scheduling(module_idP, UE, frameP, slotP, r_pucch, 1); + int alloc = nr_acknack_scheduling(nr_mac, UE, frameP, slotP, r_pucch, 1); if (alloc<0) { LOG_D(NR_MAC,"Couldn't find a pucch allocation for ack nack (msg4) in frame %d slot %d\n",frameP,slotP); return; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 3215ab1764..adba522db9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -508,7 +508,7 @@ bool allocate_dl_retransmission(module_id_t module_id, * allocation after CCE alloc fail would be more complex) */ int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, ul_bwp->pucch_Config, CCEIndex); - const int alloc = nr_acknack_scheduling(module_id, UE, frame, slot, r_pucch, 0); + const int alloc = nr_acknack_scheduling(nr_mac, UE, frame, slot, r_pucch, 0); if (alloc<0) { LOG_D(MAC, "could not find PUCCH for UE %04x@%d.%d\n", @@ -701,7 +701,7 @@ void pf_dl(module_id_t module_id, * allocation after CCE alloc fail would be more complex) */ int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, ul_bwp->pucch_Config, CCEIndex); - const int alloc = nr_acknack_scheduling(module_id, iterator->UE, frame, slot, r_pucch, 0); + const int alloc = nr_acknack_scheduling(mac, iterator->UE, frame, slot, r_pucch, 0); if (alloc<0) { LOG_D(NR_MAC, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 5136c7fc53..6238016cb3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -277,7 +277,7 @@ void nr_preprocessor_phytest(module_id_t module_id, UE->rnti); int r_pucch = nr_get_pucch_resource(sched_ctrl->coreset, UE->current_UL_BWP.pucch_Config, CCEIndex); - const int alloc = nr_acknack_scheduling(module_id, UE, frame, slot, r_pucch, 0); + const int alloc = nr_acknack_scheduling(RC.nrmac[module_id], UE, frame, slot, r_pucch, 0); if (alloc < 0) { LOG_D(MAC, "%s(): could not find PUCCH for UE %04x@%d.%d\n", diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 36ba747e72..db4649008c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2210,6 +2210,20 @@ void delete_nr_ue_data(NR_UE_info_t *UE, NR_COMMON_channels_t *ccPtr, uid_alloca } } + +void set_max_fb_time(NR_UE_UL_BWP_t *UL_BWP, const NR_UE_DL_BWP_t *DL_BWP) +{ + UL_BWP->max_fb_time = 8; // default value + // take the maximum in dl_DataToUL_ACK list + if (DL_BWP->dci_format != NR_DL_DCI_FORMAT_1_0 && UL_BWP->pucch_Config) { + const struct NR_PUCCH_Config__dl_DataToUL_ACK *fb_times = UL_BWP->pucch_Config->dl_DataToUL_ACK; + for (int i = 0; i < fb_times->list.count; i++) { + if(*fb_times->list.array[i] > UL_BWP->max_fb_time) + UL_BWP->max_fb_time = *fb_times->list.array[i]; + } + } +} + // main function to configure parameters of current BWP void configure_UE_BWP(gNB_MAC_INST *nr_mac, NR_ServingCellConfigCommon_t *scc, @@ -2410,17 +2424,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, if (UL_BWP->csi_MeasConfig) compute_csi_bitlen (UL_BWP->csi_MeasConfig, UE->csi_report_template); - UL_BWP->max_fb_time = 0; - if(DL_BWP->dci_format != NR_DL_DCI_FORMAT_1_0 && - UL_BWP->pucch_Config) { - for (int i=0; ipucch_Config->dl_DataToUL_ACK->list.count; i++) { - if(*UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i] > UL_BWP->max_fb_time) - UL_BWP->max_fb_time = *UL_BWP->pucch_Config->dl_DataToUL_ACK->list.array[i]; - } - } - else - UL_BWP->max_fb_time = 8; // default value - + set_max_fb_time(UL_BWP, DL_BWP); set_sched_pucch_list(sched_ctrl, UL_BWP, scc); } @@ -2567,21 +2571,19 @@ NR_UE_info_t *add_new_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rntiP, NR_CellGroupConf } void set_sched_pucch_list(NR_UE_sched_ctrl_t *sched_ctrl, - NR_UE_UL_BWP_t *ul_bwp, - NR_ServingCellConfigCommon_t *scc) { + const NR_UE_UL_BWP_t *ul_bwp, + const NR_ServingCellConfigCommon_t *scc) { const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs]; const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; + // PUCCH list size is given by the number of UL slots in the PUCCH period + // the length PUCCH period is determined by max_fb_time since we may need to prepare PUCCH for ACK/NACK max_fb_time slots ahead const int list_size = n_ul_slots_period << (ul_bwp->max_fb_time/nr_slots_period); if(!sched_ctrl->sched_pucch) { - sched_ctrl->sched_pucch = malloc(list_size * sizeof(*sched_ctrl->sched_pucch)); + sched_ctrl->sched_pucch = calloc(list_size, sizeof(*sched_ctrl->sched_pucch)); sched_ctrl->sched_pucch_size = list_size; - for(int i=0; isched_pucch[i]; - memset(curr_pucch, 0, sizeof(*curr_pucch)); - } } else if (list_size > sched_ctrl->sched_pucch_size) { sched_ctrl->sched_pucch = realloc(sched_ctrl->sched_pucch, list_size * sizeof(*sched_ctrl->sched_pucch)); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index f718c6703c..b9373c85cb 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -131,6 +131,20 @@ int diff_rsrp_ssb_csi_meas_10_1_6_1_2[16] = { }; +int get_pucch_index(int slot, int n_slots_frame, const NR_TDD_UL_DL_Pattern_t *tdd, int sched_pucch_size) +{ + // PUCCH structures are indexed by slot in the PUCCH period determined by sched_pucch_size number of UL slots + // this functions return the index to the structure for slot passed to the function + const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; + const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; + const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; + // ((slot % nr_slots_period) - first_ul_slot_period) gives the progressive number of the slot in a TDD period + // ((slot / nr_slots_period) * n_ul_slots_period) adds up the number of UL slots in the previous TDD periods + // the sum gives the index of current UL slot in the frame which is normalized wrt sched_pucch_size + return ((slot % nr_slots_period) - first_ul_slot_period + (slot / nr_slots_period) * n_ul_slots_period) % sched_pucch_size; + +} + void nr_schedule_pucch(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP) @@ -140,20 +154,25 @@ void nr_schedule_pucch(gNB_MAC_INST *nrmac, UE_iterator(nrmac->UE_info.list, UE) { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; - for (int i = 0; i < sched_ctrl->sched_pucch_size; i++) { - NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[i]; - const uint16_t O_ack = curr_pucch->dai_c; - const uint16_t O_csi = curr_pucch->csi_bits; - const uint8_t O_sr = curr_pucch->sr_flag; - if (curr_pucch->active == true && - frameP == curr_pucch->frame && - slotP == curr_pucch->ul_slot) { - LOG_D(NR_MAC,"Scheduling PUCCH[%d] RX for UE %04x in %4d.%2d O_ack %d, O_sr %d, O_csi %d\n", - i,UE->rnti,curr_pucch->frame,curr_pucch->ul_slot,O_ack,O_sr,O_csi); - nr_fill_nfapi_pucch(nrmac, frameP, slotP, curr_pucch, UE); - memset(curr_pucch, 0, sizeof(*curr_pucch)); - } - } + NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; + const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs]; + const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[0].ServingCellConfigCommon; + const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; + AssertFatal(tdd || nrmac->common_channels[0].frame_type == FDD, "Dynamic TDD not handled yet\n"); + const int pucch_index = get_pucch_index(slotP, n_slots_frame, tdd, sched_ctrl->sched_pucch_size); + NR_sched_pucch_t *curr_pucch = &UE->UE_sched_ctrl.sched_pucch[pucch_index]; + if (!curr_pucch->active) + continue; + DevAssert(frameP == curr_pucch->frame && slotP == curr_pucch->ul_slot); + + const uint16_t O_ack = curr_pucch->dai_c; + const uint16_t O_csi = curr_pucch->csi_bits; + const uint8_t O_sr = curr_pucch->sr_flag; + LOG_D(NR_MAC,"Scheduling PUCCH[%d] RX for UE %04x in %4d.%2d O_ack %d, O_sr %d, O_csi %d\n", + pucch_index,UE->rnti,curr_pucch->frame,curr_pucch->ul_slot,O_ack,O_sr,O_csi); + nr_fill_nfapi_pucch(nrmac, frameP, slotP, curr_pucch, UE); + memset(curr_pucch, 0, sizeof(*curr_pucch)); + } } @@ -207,10 +226,7 @@ void nr_csi_meas_reporting(int Mod_idP, const NR_ServingCellConfigCommon_t *scc = RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; AssertFatal(tdd || RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD, "Dynamic TDD not handled yet\n"); - const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; - const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; - const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; - const int pucch_index = ((sched_slot % nr_slots_period) - first_ul_slot_period + (sched_slot / nr_slots_period) * n_ul_slots_period) % sched_ctrl->sched_pucch_size; + const int pucch_index = get_pucch_index(sched_slot, n_slots_frame, tdd, sched_ctrl->sched_pucch_size); NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[pucch_index]; AssertFatal(curr_pucch->active == false, "CSI structure is scheduled in advance. It should be free!\n"); curr_pucch->r_pucch = -1; @@ -995,17 +1011,12 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, } } -bool test_pucch0_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, - NR_sched_pucch_t *pucch, - uint16_t *vrb_map_UL, - const NR_ServingCellConfigCommon_t *scc, - NR_PUCCH_Config_t *pucch_Config, - int r_pucch, - int bwp_start, - int bwp_size) { - - // We assume initial cyclic shift is always 0 so different pucch resources can't overlap - +void set_pucch_allocation(const NR_PUCCH_Config_t *pucch_Config, + const NR_ServingCellConfigCommon_t *scc, + const int r_pucch, + const int bwp_size, + NR_sched_pucch_t *pucch) +{ if(r_pucch<0){ const NR_PUCCH_Resource_t *resource = pucch_Config->resourceToAddModList->list.array[0]; DevAssert(resource->format.present == NR_PUCCH_Resource__format_PR_format0); @@ -1024,6 +1035,14 @@ bool test_pucch0_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, &pucch->nr_of_symb, &pucch->start_symb); } +} + +bool test_pucch0_vrb_occupation(const NR_sched_pucch_t *pucch, + uint16_t *vrb_map_UL, + const int bwp_start, + const int bwp_size) { + + // We assume initial cyclic shift is always 0 so different pucch resources can't overlap // verifying occupation of PRBs for ACK/NACK on dedicated pucch for (int l=0; lnr_of_symb; l++) { @@ -1041,9 +1060,24 @@ bool test_pucch0_vrb_occupation(NR_UE_sched_ctrl_t *sched_ctrl, return true; } +void set_pucch0_vrb_occupation(const NR_sched_pucch_t *pucch, + uint16_t *vrb_map_UL, + const int bwp_start) +{ + for (int l=0; lnr_of_symb; l++) { + uint16_t symb = SL_to_bitmap(pucch->start_symb+l, 1); + int prb; + if (l==1 && pucch->second_hop_prb != 0) + prb = pucch->second_hop_prb; + else + prb = pucch->prb_start; + vrb_map_UL[bwp_start+prb] |= symb; + } +} + // this function returns an index to NR_sched_pucch structure // if the function returns -1 it was not possible to schedule acknack -int nr_acknack_scheduling(int mod_id, +int nr_acknack_scheduling(gNB_MAC_INST *mac, NR_UE_info_t *UE, frame_t frame, sub_frame_t slot, @@ -1052,27 +1086,20 @@ int nr_acknack_scheduling(int mod_id, { const int CC_id = 0; - const int minfbtime = RC.nrmac[mod_id]->minRXTXTIMEpdsch; - const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels[CC_id].ServingCellConfigCommon; + const int minfbtime = mac->minRXTXTIMEpdsch; + const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon; const NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs]; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; - AssertFatal(tdd || RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD, "Dynamic TDD not handled yet\n"); + AssertFatal(tdd || mac->common_channels[CC_id].frame_type == FDD, "Dynamic TDD not handled yet\n"); const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; - const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; - /* for the moment, we consider: - * * only pucch_sched[0] holds HARQ (and SR) - * * we do not multiplex with CSI, which is always in pucch_sched[2] - * * SR uses format 0 and is allocated in the first UL (mixed) slot (and not - * later) - * * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */ NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_PUCCH_Config_t *pucch_Config = ul_bwp->pucch_Config; - int bwp_start = ul_bwp->BWPStart; - int bwp_size = ul_bwp->BWPSize; + const int bwp_start = ul_bwp->BWPStart; + const int bwp_size = ul_bwp->BWPSize; nr_dci_format_t dci_format = NR_DL_DCI_FORMAT_1_0; if(is_common == 0) @@ -1090,7 +1117,8 @@ int nr_acknack_scheduling(int mod_id, if(pucch_slot%nr_slots_period < first_ul_slot_period) continue; const int pucch_frame = (frame + ((slot + pdsch_to_harq_feedback[f]) / n_slots_frame)) & 1023; - const int pucch_index = ((pucch_slot % nr_slots_period) - first_ul_slot_period + (pucch_slot / nr_slots_period) * n_ul_slots_period) % sched_ctrl->sched_pucch_size; + // we store PUCCH resources according to slot, TDD configuration and size of the vector containing PUCCH structures + const int pucch_index = get_pucch_index(pucch_slot, n_slots_frame, tdd, sched_ctrl->sched_pucch_size); NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[pucch_index]; if (curr_pucch->active && curr_pucch->frame == pucch_frame && @@ -1102,8 +1130,8 @@ int nr_acknack_scheduling(int mod_id, curr_pucch->dai_c == 2) continue; // if there is CSI but simultaneous HARQ+CSI is disable we can't schedule - if(!curr_pucch->simultaneous_harqcsi && - curr_pucch->csi_bits>0) + if(curr_pucch->csi_bits > 0 && + !curr_pucch->simultaneous_harqcsi) continue; // TODO we can't schedule more than 11 bits in PUCCH2 for now if (curr_pucch->csi_bits + curr_pucch->dai_c >= 10) @@ -1118,19 +1146,15 @@ int nr_acknack_scheduling(int mod_id, return pucch_index; // index of current PUCCH structure } else if (curr_pucch->active) { - LOG_E(NR_MAC, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n", - curr_pucch->frame, curr_pucch->ul_slot, pucch_frame, pucch_slot); - continue; + AssertFatal(1==0, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with computed frame.slot %d.%d\n", + curr_pucch->frame, curr_pucch->ul_slot, pucch_frame, pucch_slot); } else { // unoccupied occasion // checking if in ul_slot the resources potentially to be assigned to this PUCCH are available - uint16_t *vrb_map_UL = &RC.nrmac[mod_id]->common_channels[CC_id].vrb_map_UL[pucch_slot * MAX_BWP_SIZE]; - bool ret = test_pucch0_vrb_occupation(sched_ctrl, - curr_pucch, + set_pucch_allocation(pucch_Config, scc, r_pucch, bwp_size, curr_pucch); + uint16_t *vrb_map_UL = &mac->common_channels[CC_id].vrb_map_UL[pucch_slot * MAX_BWP_SIZE]; + bool ret = test_pucch0_vrb_occupation(curr_pucch, vrb_map_UL, - scc, - pucch_Config, - r_pucch, bwp_start, bwp_size); if(!ret) { @@ -1151,13 +1175,7 @@ int nr_acknack_scheduling(int mod_id, frame,slot,curr_pucch->frame,curr_pucch->ul_slot,pucch_index,f,curr_pucch->dai_c); // blocking resources for current PUCCH in VRB map - for (int l=0; lnr_of_symb; l++) { - uint16_t symb = SL_to_bitmap(curr_pucch->start_symb+l, 1); - int prb = curr_pucch->prb_start; - if (l==1 && curr_pucch->second_hop_prb != 0) - prb = curr_pucch->second_hop_prb; - vrb_map_UL[bwp_start+prb] |= symb; - } + set_pucch0_vrb_occupation(curr_pucch, vrb_map_UL, bwp_start); return pucch_index; // index of current PUCCH structure } @@ -1171,7 +1189,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) { if (!is_xlsch_in_slot(nrmac->ulsch_slot_bitmap[slot / 64], slot)) return; - int CC_id = 0; + const int CC_id = 0; UE_iterator(nrmac->UE_info.list, UE) { NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; @@ -1189,13 +1207,13 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) int SR_period; int SR_offset; - find_period_offest_SR(SchedulingRequestResourceConfig,&SR_period,&SR_offset); + find_period_offset_SR(SchedulingRequestResourceConfig,&SR_period,&SR_offset); // convert to int to avoid underflow of uint int sfn_sf = SFN * n_slots_frame + slot; LOG_D(NR_MAC,"SR_resource_id %d: SR_period %d, SR_offset %d\n",SR_resource_id,SR_period,SR_offset); if ((sfn_sf - SR_offset) % SR_period != 0) continue; - LOG_D(NR_MAC, "%4d.%2d Scheduling Request identified\n", SFN, slot); + LOG_D(NR_MAC, "%4d.%2d Scheduling Request UE %04x identified\n", SFN, slot, UE->rnti); NR_PUCCH_ResourceId_t *PucchResourceId = SchedulingRequestResourceConfig->resource; int idx = -1; @@ -1210,10 +1228,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) const NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; AssertFatal(tdd || nrmac->common_channels[CC_id].frame_type == FDD, "Dynamic TDD not handled yet\n"); - const int nr_slots_period = tdd ? n_slots_frame / get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity) : n_slots_frame; - const int first_ul_slot_period = tdd ? tdd->nrofDownlinkSlots : 0; - const int n_ul_slots_period = tdd ? tdd->nrofUplinkSlots + (tdd->nrofUplinkSymbols > 0 ? 1 : 0) : n_slots_frame; - const int pucch_index = ((slot % nr_slots_period) - first_ul_slot_period + (slot / nr_slots_period) * n_ul_slots_period) % sched_ctrl->sched_pucch_size; + const int pucch_index = get_pucch_index(slot, n_slots_frame, tdd, sched_ctrl->sched_pucch_size); NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[pucch_index]; if (curr_pucch->active && @@ -1222,20 +1237,17 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) curr_pucch->resource_indicator == idx) curr_pucch->sr_flag = true; else if (curr_pucch->active) { - LOG_E(NR_MAC, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with SR function frame.slot %d.%d\n", - curr_pucch->frame, curr_pucch->ul_slot, SFN, slot); + AssertFatal(1==0, "This shouldn't happen! curr_pucch frame.slot %d.%d not matching with SR function frame.slot %d.%d\n", + curr_pucch->frame, curr_pucch->ul_slot, SFN, slot); continue; } else { uint16_t *vrb_map_UL = &nrmac->common_channels[CC_id].vrb_map_UL[slot * MAX_BWP_SIZE]; - int bwp_start = ul_bwp->BWPStart; - int bwp_size = ul_bwp->BWPSize; - bool ret = test_pucch0_vrb_occupation(sched_ctrl, - curr_pucch, + const int bwp_start = ul_bwp->BWPStart; + const int bwp_size = ul_bwp->BWPSize; + set_pucch_allocation(pucch_Config, scc, -1, bwp_size, curr_pucch); + bool ret = test_pucch0_vrb_occupation(curr_pucch, vrb_map_UL, - scc, - pucch_Config, - -1, bwp_start, bwp_size); if (!ret) { @@ -1248,15 +1260,7 @@ void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t SFN, sub_frame_t slot) curr_pucch->resource_indicator = idx; curr_pucch->r_pucch = -1; curr_pucch->active = true; - for (int l=0; lnr_of_symb; l++) { - uint16_t symb = SL_to_bitmap(curr_pucch->start_symb+l, 1); - int prb; - if (l==1 && curr_pucch->second_hop_prb != 0) - prb = curr_pucch->second_hop_prb; - else - prb = curr_pucch->prb_start; - vrb_map_UL[bwp_start+prb] |= symb; - } + set_pucch0_vrb_occupation(curr_pucch, vrb_map_UL, bwp_start); } } } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 2e3ccf4ba6..a322c4917b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -209,7 +209,7 @@ void nr_csi_meas_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP); -int nr_acknack_scheduling(int Mod_idP, +int nr_acknack_scheduling(gNB_MAC_INST *mac, NR_UE_info_t *UE, frame_t frameP, sub_frame_t slotP, @@ -466,8 +466,8 @@ uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx); uint8_t get_dl_nrOfLayers(const NR_UE_sched_ctrl_t *sched_ctrl, const nr_dci_format_t dci_format); void set_sched_pucch_list(NR_UE_sched_ctrl_t *sched_ctrl, - NR_UE_UL_BWP_t *ul_bwp, - NR_ServingCellConfigCommon_t *scc); + const NR_UE_UL_BWP_t *ul_bwp, + const NR_ServingCellConfigCommon_t *scc); const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot); const int get_ul_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 17f0504e15..b28fd0ffee 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -563,8 +563,9 @@ typedef struct { int cce_index; uint8_t aggregation_level; - /// Array of PUCCH scheduling information. + /// Array of PUCCH scheduling information /// Its size depends on TDD configuration and max feedback time + /// There will be a structure for each UL slot in the active period determined by the size NR_sched_pucch_t *sched_pucch; int sched_pucch_size; From c14b39b07f8bd33b6920c310de527af61a6a3627 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Thu, 25 Aug 2022 15:57:56 +0100 Subject: [PATCH 24/49] Add TDLA30, TDLB100 and TDLC300 in channel model options and improve the help log --- openair1/SIMULATION/NR_PHY/ulsim.c | 101 ++++++++++++++++------------- 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index feca4c4dea..82f1b3430d 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -399,54 +399,63 @@ int main(int argc, char **argv) case 'g': switch ((char) *optarg) { - case 'A': - channel_model = SCM_A; - break; - - case 'B': - channel_model = SCM_B; - break; - - case 'C': - channel_model = SCM_C; - break; - - case 'D': - channel_model = SCM_D; - break; - - case 'E': - channel_model = EPA; - break; - - case 'F': - channel_model = EVA; - break; - - case 'G': - channel_model = ETU; - break; + case 'A': + channel_model = SCM_A; + printf("Channel model: SCM-A\n"); + break; - case 'H': - channel_model = TDL_C; - DS_TDL = .030; // 30 ns - break; - - case 'I': - channel_model = TDL_C; - DS_TDL = .3; // 300ns - break; - - case 'J': - channel_model=TDL_D; - DS_TDL = .03; - break; + case 'B': + channel_model = SCM_B; + printf("Channel model: SCM-B\n"); + break; - default: - printf("Unsupported channel model!\n"); - exit(-1); + case 'C': + channel_model = SCM_C; + printf("Channel model: SCM-C\n"); + break; + + case 'D': + channel_model = SCM_D; + printf("Channel model: SCM-D\n"); + break; + + case 'E': + channel_model = EPA; + printf("Channel model: EPA\n"); + break; + + case 'F': + channel_model = EVA; + printf("Channel model: EVA\n"); + break; + + case 'G': + channel_model = ETU; + printf("Channel model: ETU\n"); + break; + + case 'H': + channel_model = TDL_A; + DS_TDL = .030; // 30 ns + printf("Channel model: TDLA30\n"); + break; + + case 'I': + channel_model = TDL_B; + DS_TDL = .100; // 100ns + printf("Channel model: TDLB100\n"); + break; + + case 'J': + channel_model = TDL_C; + DS_TDL = 0.300; // 300 ns + printf("Channel model: TDLC300\n"); + break; + + default: + printf("Unsupported channel model!\n"); + exit(-1); } - break; case 'i': @@ -626,7 +635,7 @@ int main(int argc, char **argv) //printf("-d Use TDD\n"); printf("-d Introduce delay in terms of number of samples\n"); printf("-f Number of frames to simulate\n"); - printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n"); + printf("-g and the channel model [A] SCM-A, [B] SCM-B, [C] SCM-C, [D] SCM-D, [E] EPA, [F] EVA, [G] ETU, [H] TDLA30, [I] TDLB100, [J] TDLC300\n"); printf("-h This message\n"); printf("-i Change channel estimation technique. Arguments list: Number of arguments=2, Frequency domain {0:Linear interpolation, 1:PRB based averaging}, Time domain {0:Estimates of last DMRS symbol, 1:Average of DMRS symbols}. e.g. -i 2 1 0\n"); //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); From c3a51d771c4de8a57658633316f96d2000b3dffc Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Thu, 25 Aug 2022 19:23:04 +0100 Subject: [PATCH 25/49] Implementation of tables G.2.1.1-2, G.2.1.1-3 and G.2.1.1-4 of TS 38.104, for TDLA30, TDLB100 and TDLC300 channel models --- openair1/SIMULATION/NR_PHY/ulsim.c | 6 +- openair1/SIMULATION/TOOLS/random_channel.c | 157 ++------------------- 2 files changed, 12 insertions(+), 151 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 82f1b3430d..092b6da367 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -436,13 +436,13 @@ int main(int argc, char **argv) case 'H': channel_model = TDL_A; - DS_TDL = .030; // 30 ns + DS_TDL = 0.030; // 30 ns printf("Channel model: TDLA30\n"); break; case 'I': channel_model = TDL_B; - DS_TDL = .100; // 100ns + DS_TDL = 0.100; // 100ns printf("Channel model: TDLB100\n"); break; @@ -703,7 +703,7 @@ int main(int argc, char **argv) UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, sampling_frequency/1e6, tx_bandwidth, - DS_TDL, + DS_TDL, 0, 0, 0, 0); if (UE2gNB == NULL) { diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 17d34fed1a..43ed9bab7e 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -183,156 +183,17 @@ static double mbsfn_amps_dB[] = {0,-1.5,-1.4,-3.6,-0.6,-7.0,-10,-11.5,-11.4,-13. static double scm_c_delays[] = {0, 0.0125, 0.0250, 0.3625, 0.3750, 0.3875, 0.2500, 0.2625, 0.2750, 1.0375, 1.0500, 1.0625, 2.7250, 2.7375, 2.7500, 4.6000, 4.6125, 4.6250}; static double scm_c_amps_dB[] = {0.00, -2.22, -3.98, -1.86, -4.08, -5.84, -1.08, -3.30, -5.06, -9.08, -11.30, -13.06, -15.14, -17.36, -19.12, -20.64, -22.85, -24.62}; -static double tdl_a_delays[] = {0.0000, - 0.3819, - 0.4025, - 0.5868, - 0.4610, - 0.5375, - 0.6708, - 0.5750, - 0.7618, - 1.5375, - 1.8978, - 2.2242, - 2.1718, - 2.4942, - 2.5119, - 3.0582, - 4.0810, - 4.4579, - 4.5695, - 4.7966, - 5.0066, - 5.3043, - 9.6586 - }; -static double tdl_a_amps_dB[] = {-13.4, - 0, - -2.2, - -4, - -6, - -8.2, - -9.9, - -10.5, - -7.5, - -15.9, - -6.6, - -16.7, - -12.4, - -15.2, - -10.8, - -11.3, - -12.7, - -16.2, - -18.3, - -18.9, - -16.6, - -19.9, - -29.7 - }; +// TS 38.104 - Table G.2.1.1-2, delays normalized based on TR 38.901 - eq. 7.7-1 +static double tdl_a_delays[] = {0, 0.3333, 0.5000, 0.6667, 0.8333, 1.6667, 2.1667, 2.5000, 3.5000, 4.5000, 5.0000, 9.6667}; +static double tdl_a_amps_dB[] = {-15.5, 0.0, -5.1, -5.1, -9.6, -8.2, -13.1, -11.5, -11.0, -16.2, -16.6, -26.2}; -static double tdl_b_delays[] = {0.0000, - 0.1072, - 0.2155, - 0.2095, - 0.2870, - 0.2986, - 0.3752, - 0.5055, - 0.3681, - 0.3697, - 0.5700, - 0.5283, - 1.1021, - 1.2756, - 1.5474, - 1.7842, - 2.0169, - 2.8294, - 3.0219, - 3.6187, - 4.1067, - 4.2790, - 4.7834 - }; +// TS 38.104 - Table G.2.1.1-3, delays normalized based on TR 38.901 - eq. 7.7-1 +static double tdl_b_delays[] = {0.0000, 0.1000, 0.2000, 0.3000, 0.3500, 0.4500, 0.5500, 1.2000, 1.7000, 2.4500, 3.3000, 4.8000}; +static double tdl_b_amps_dB[] = {0.0, -2.2, -0.6, -0.6, -0.3, -1.2, -5.9, -2.2, -0.8, -6.3, -7.5, -7.1}; -static double tdl_b_amps_dB[] = {0, - -2.2, - -4, - -3.2, - -9.8, - -1.2, - -3.4, - -5.2, - -7.6, - -3, - -8.9, - -9, - -4.8, - -5.7, - -7.5, - -1.9, - -7.6, - -12.2, - -9.8, - -11.4, - -14.9, - -9.2, - -11.3 - }; - -static double tdl_c_delays[] = {0, - 0.2099, - 0.2219, - 0.2329, - 0.2176, - 0.6366, - 0.6448, - 0.6560, - 0.6584, - 0.7935, - 0.8213, - 0.9336, - 1.2285, - 1.3083, - 2.1704, - 2.7105, - 4.2589, - 4.6003, - 5.4902, - 5.6077, - 6.3065, - 6.6374, - 7.0427, - 8.6523 - }; - -static double tdl_c_amps_dB[] = {-4.4, - -1.2, - -3.5, - -5.2, - -2.5, - 0, - -2.2, - -3.9, - -7.4, - -7.1, - -10.7, - -11.1, - -5.1, - -6.8, - -8.7, - -13.2, - -13.9, - -13.9, - -15.8, - -17.1, - -16, - -15.7, - -21.6, - -22.8 - }; +// TS 38.104 - Table G.2.1.1-4, delays normalized based on TR 38.901 - eq. 7.7-1 +static double tdl_c_delays[] = {0.0000, 0.2167, 0.2333, 0.6333, 0.6500, 0.6667, 0.8000, 1.0833, 1.7333, 3.4833, 5.0333, 8.6500}; +static double tdl_c_amps_dB[] = {-6.9, 0.0, -7.7, -2.5, -2.4, -9.9, -8.0, -6.6, -7.1, -13.0, -14.2, -16.0}; static double tdl_d_delays[] = {//0, 0, From ac39d3b48cbcda64a37a85afeece69c8a206c9c7 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Fri, 26 Aug 2022 15:05:19 +0100 Subject: [PATCH 26/49] Remove the hardcoded channel matrix H_awgn_mimo from nr_ulsim --- openair1/SIMULATION/NR_PHY/ulsim.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 092b6da367..3ec1c58467 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -1322,30 +1322,10 @@ int main(int argc, char **argv) } } - // The multipath_channel() function calculates a channel matrix with only 1's. So the channel rank is 1, and we - // cannot use multi-layer. To solve this issue, for now we use the H_awgn_mimo matrix for multi-layer. - if (precod_nbr_layers == 1) { - if (UE2gNB->max_Doppler == 0) { - multipath_channel(UE2gNB, s_re, s_im, r_re, r_im, slot_length, 0, (n_trials==1)?1:0); - } else { - multipath_tv_channel(UE2gNB, s_re, s_im, r_re, r_im, 2*slot_length, 0); - } + if (UE2gNB->max_Doppler == 0) { + multipath_channel(UE2gNB, s_re, s_im, r_re, r_im, slot_length, 0, (n_trials==1)?1:0); } else { - double H_awgn_mimo[4][4] ={{1.0, 0.2, 0.1, 0.05}, //rx 0 - {0.2, 1.0, 0.2, 0.1}, //rx 1 - {0.1, 0.2, 1.0, 0.2}, //rx 2 - {0.05, 0.1, 0.2, 1.0}}; //rx 3 - for (i=0; inb_antennas_rx; ap++) { - // sum up signals from different Tx antennas - r_re[ap][i] = 0; - r_im[ap][i] = 0; - for (int aa=0; aa Date: Fri, 26 Aug 2022 15:37:06 +0100 Subject: [PATCH 27/49] TDL channel model implementation for low, medium and high correlation scenarios --- openair1/SIMULATION/TOOLS/multipath_channel.c | 17 ++-- openair1/SIMULATION/TOOLS/random_channel.c | 98 +++++++++++++++---- openair1/SIMULATION/TOOLS/scm_corrmat.h | 94 ++++++++++++++++++ openair1/SIMULATION/TOOLS/sim.h | 11 ++- 4 files changed, 190 insertions(+), 30 deletions(-) diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.c b/openair1/SIMULATION/TOOLS/multipath_channel.c index 3045d8ca6c..cff6f85d46 100644 --- a/openair1/SIMULATION/TOOLS/multipath_channel.c +++ b/openair1/SIMULATION/TOOLS/multipath_channel.c @@ -31,7 +31,6 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc) { - random_channel(desc,0); return(1); } @@ -163,7 +162,8 @@ void multipath_channel(channel_desc_t *desc, dd = abs(desc->channel_offset); #ifdef DEBUG_CH - printf("[CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d \n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length); + printf("[CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d \n", + keep_channel, path_loss, desc->path_loss_dB, desc->nb_rx, desc->nb_tx, dd, desc->channel_length); #endif if (keep_channel) { @@ -173,12 +173,9 @@ void multipath_channel(channel_desc_t *desc, } #ifdef DEBUG_CH - for (l = 0; l<(int)desc->channel_length; l++) { - printf("%p (%f,%f) ",desc->ch[0],desc->ch[0][l].x,desc->ch[0][l].y); + printf("ch[%i] = (%f, %f)\n", l, desc->ch[0][l].r, desc->ch[0][l].i); } - - printf("\n"); #endif for (i=0; i<((int)length-dd); i++) { @@ -200,7 +197,8 @@ void multipath_channel(channel_desc_t *desc, rx_tmp.i += (tx.i * desc->ch[ii+(j*desc->nb_rx)][l].r) + (tx.r * desc->ch[ii+(j*desc->nb_rx)][l].i); if (i==0 && log_channel == 1) { - printf("channel[%d][%d][%d] = %f dB (%e,%e)\n",ii,j,l,10*log10(pow(desc->ch[ii+(j*desc->nb_rx)][l].r,2.0)+pow(desc->ch[ii+(j*desc->nb_rx)][l].i,2.0)), + printf("channel[%d][%d][%d] = %f dB \t(%e, %e)\n", + ii, j, l, 10*log10(pow(desc->ch[ii+(j*desc->nb_rx)][l].r,2.0)+pow(desc->ch[ii+(j*desc->nb_rx)][l].i,2.0)), desc->ch[ii+(j*desc->nb_rx)][l].r, desc->ch[ii+(j*desc->nb_rx)][l].i); } @@ -209,9 +207,10 @@ void multipath_channel(channel_desc_t *desc, rx_sig_re[ii][i+dd] = rx_tmp.r*path_loss; rx_sig_im[ii][i+dd] = rx_tmp.i*path_loss; -#ifdef DEBUG_CHANNEL +#ifdef DEBUG_CH if ((i%32)==0) { - printf("rx aa %d: %p %p %f,%f => %e,%e\n",ii,rx_sig_re[ii],rx_sig_im[ii],rx_tmp.x,rx_tmp.y,rx_sig_re[ii][i-dd],rx_sig_im[ii][i-dd]); + printf("rx aa %d: %f, %f => %e, %e\n", + ii, rx_tmp.r, rx_tmp.i, rx_sig_re[ii][i-dd], rx_sig_im[ii][i-dd]); } #endif //rx_sig_re[ii][i] = sqrt(.5)*(tx_sig_re[0][i] + tx_sig_re[1][i]); diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 43ed9bab7e..9eb8ebe7e6 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -375,6 +375,7 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS chan_desc->ch = (struct complexd **) malloc(nb_tx*nb_rx*sizeof(struct complexd *)); chan_desc->chF = (struct complexd **) malloc(nb_tx*nb_rx*sizeof(struct complexd *)); chan_desc->a = (struct complexd **) malloc(chan_desc->nb_taps*sizeof(struct complexd *)); + chan_desc->ricean_factor = 1.0; for (int i = 0; ich[i] = (struct complexd *) malloc(chan_desc->channel_length * sizeof(struct complexd)); @@ -385,27 +386,69 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS for (int i = 0; inb_taps; i++) chan_desc->a[i] = (struct complexd *) malloc(nb_tx*nb_rx * sizeof(struct complexd)); - chan_desc->R_sqrt = (struct complexd **) malloc(tdl_pathsby3*sizeof(struct complexd **)); + // FIXME: Remove this hardcoded value + chan_desc->corr_level = CORR_LEVEL_LOW; - if (nb_tx==2 && nb_rx==2) { - for (int i = 0; i<(tdl_pathsby3); i++) - chan_desc->R_sqrt[i] = (struct complexd *) &R22_sqrt[i][0]; - } else if (nb_tx==2 && nb_rx==1) { - for (int i = 0; i<(tdl_pathsby3); i++) - chan_desc->R_sqrt[i] = (struct complexd *) &R21_sqrt[i][0]; - } else if (nb_tx==1 && nb_rx==2) { - for (int i = 0; i<(tdl_pathsby3); i++) - chan_desc->R_sqrt[i] = (struct complexd *) &R12_sqrt[i][0]; - } else { - for (int i = 0; i<(tdl_pathsby3); i++) { - chan_desc->R_sqrt[i] = (struct complexd *) malloc(nb_tx*nb_rx*nb_tx*nb_rx * sizeof(struct complexd)); - - for (int j = 0; jR_sqrt[i][j].r = 1.0; - chan_desc->R_sqrt[i][j].i = 0.0; + int matrix_size = nb_tx*nb_rx; + double *correlation_matrix[matrix_size]; + if (chan_desc->corr_level!=CORR_LEVEL_LOW) { + if (nb_rx==1 && nb_tx==2) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R12_medium_high[row]; } + } else if (nb_rx==1 && nb_tx==4) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R14_medium_high[row]; + } + } else if (nb_rx==1 && nb_tx==8) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R18_medium_high[row]; + } + } else if (nb_rx==2 && nb_tx==2 && chan_desc->corr_level==CORR_LEVEL_MEDIUM) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R22_medium[row]; + } + } else if (nb_rx==2 && nb_tx==4 && chan_desc->corr_level==CORR_LEVEL_MEDIUM) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R24_medium[row]; + } + } else if (nb_rx==4 && nb_tx==4 && chan_desc->corr_level==CORR_LEVEL_MEDIUM) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R44_medium[row]; + } + } else if (nb_rx==2 && nb_tx==2 && chan_desc->corr_level==CORR_LEVEL_HIGH) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R22_high[row]; + } + } else if (nb_rx==2 && nb_tx==4 && chan_desc->corr_level==CORR_LEVEL_HIGH) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R24_high[row]; + } + } else if (nb_rx==4 && nb_tx==4 && chan_desc->corr_level==CORR_LEVEL_HIGH) { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = R44_high[row]; + } + } else { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = NULL; + } + } + } else { + for (int row = 0; row < matrix_size; row++) { + correlation_matrix[row] = NULL; + } + } - LOG_W(OCM,"correlation matrix not implemented for nb_tx==%d and nb_rx==%d, using identity\n", nb_tx, nb_rx); + chan_desc->R_sqrt = (struct complexd **) malloc(matrix_size*sizeof(struct complexd **)); + for (int row = 0; row < matrix_size; row++) { + chan_desc->R_sqrt[row] = (struct complexd *) calloc(1, matrix_size*sizeof(struct complexd)); + if (correlation_matrix[row] == NULL) { + // TS 38.104 - Table G.2.3.1.2-4: MIMO correlation matrices for low correlation + chan_desc->R_sqrt[row][row].r = 1.0; + } else { + for (int col = 0; col < matrix_size; col++) { + chan_desc->R_sqrt[row][col].r = correlation_matrix[row][col]; + } } } } @@ -1574,6 +1617,8 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { struct complexd phase, alpha, beta; start_meas(&desc->random_channel); + bzero(acorr,desc->nb_tx*desc->nb_rx*sizeof(struct complexd)); + for (i=0; i<(int)desc->nb_taps; i++) { for (aarx=0; aarxnb_rx; aarx++) { for (aatx=0; aatxnb_tx; aatx++) { @@ -1612,8 +1657,21 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { */ //apply correlation matrix //compute acorr = R_sqrt[i] * anew - bzero(acorr,desc->nb_tx*desc->nb_rx*sizeof(struct complexd)); - cblas_zaxpy(desc->nb_tx*desc->nb_rx, (void *) desc->R_sqrt[i/3], (void *) anew, 1, (void *) acorr, 1); + if (desc->modelid >= TDL_A && desc->modelid <= TDL_E) { + for (aatx = 0; aatx < desc->nb_tx; aatx++) { + for (aarx=0; aarxnb_rx; aarx++) { + cblas_zaxpy(desc->nb_tx*desc->nb_rx, + (void *) &anew[aarx+(aatx*desc->nb_rx)], + (void *) desc->R_sqrt[aarx+(aatx*desc->nb_rx)], + 1, + (void *) acorr, + 1); + } + } + } else { + bzero(acorr,desc->nb_tx*desc->nb_rx*sizeof(struct complexd)); + cblas_zaxpy(desc->nb_tx*desc->nb_rx, (void *) desc->R_sqrt[i/3], (void *) anew, 1, (void *) acorr, 1); + } /* FIXME: Function cblas_zgemv has an undefined output (for the same input) after a second call in RHEL8 (acorr = nan) diff --git a/openair1/SIMULATION/TOOLS/scm_corrmat.h b/openair1/SIMULATION/TOOLS/scm_corrmat.h index 5695e0bd0f..b3e4f0b6ad 100644 --- a/openair1/SIMULATION/TOOLS/scm_corrmat.h +++ b/openair1/SIMULATION/TOOLS/scm_corrmat.h @@ -43,3 +43,97 @@ static double R12_sqrt[6][8] = { {0.991912, 0.000000,0.041738, -0.119870,0.041738, 0.119870,0.991912, 0.000000}, {0.968169, 0.000000,0.216594, -0.125443,0.216594, 0.125443,0.968169, 0.000000}, }; + +// TS 38.104 - Table G.2.3.1.2-2: MIMO correlation matrices for high correlation +static double R22_high[4][4] = { + {1.0, 0.9, 0.9, 0.81}, + {0.9, 1.0, 0.81, 0.9}, + {0.9, 0.81, 1.0, 0.9}, + {0.81, 0.9, 0.9, 1} +}; +static double R24_high[8][8] = { + {1.0000, 0.9883, 0.9542, 0.8999, 0.8999, 0.8894, 0.8587, 0.8099}, + {0.9883, 1.0000, 0.9883, 0.9542, 0.8894, 0.8999, 0.8894, 0.8587}, + {0.9542, 0.9883, 1.0000, 0.9883, 0.8587, 0.8894, 0.8999, 0.8894}, + {0.8999, 0.9542, 0.9883, 1.0000, 0.8099, 0.8587, 0.8894, 0.8999}, + {0.8999, 0.8894, 0.8587, 0.8099, 1.0000, 0.9883, 0.9542, 0.8999}, + {0.8894, 0.8999, 0.8894, 0.8587, 0.9883, 1.0000, 0.9883, 0.9542}, + {0.8587, 0.8894, 0.8999, 0.8894, 0.9542, 0.9883, 1.0000, 0.9883}, + {0.8099, 0.8587, 0.8894, 0.8999, 0.8999, 0.9542, 0.9883, 1.0000} +}; +static double R44_high[16][16] = { + {1.0000, 0.9882, 0.9541, 0.8999, 0.9882, 0.9767, 0.9430, 0.8894, 0.9541, 0.9430, 0.9105, 0.8587, 0.8999, 0.8894, 0.8587, 0.8099}, + {0.9882, 1.0000, 0.9882, 0.9541, 0.9767, 0.9882, 0.9767, 0.9430, 0.9430, 0.9541, 0.9430, 0.9105, 0.8894, 0.8999, 0.8894, 0.8587}, + {0.9541, 0.9882, 1.0000, 0.9882, 0.9430, 0.9767, 0.9882, 0.9767, 0.9105, 0.9430, 0.9541, 0.9430, 0.8587, 0.8894, 0.8999, 0.8894}, + {0.8999, 0.9541, 0.9882, 1.0000, 0.8894, 0.9430, 0.9767, 0.9882, 0.8587, 0.9105, 0.9430, 0.9541, 0.8099, 0.8587, 0.8894, 0.8999}, + {0.9882, 0.9767, 0.9430, 0.8894, 1.0000, 0.9882, 0.9541, 0.8999, 0.9882, 0.9767, 0.9430, 0.8894, 0.9541, 0.9430, 0.9105, 0.8587}, + {0.9767, 0.9882, 0.9767, 0.9430, 0.9882, 1.0000, 0.9882, 0.9541, 0.9767, 0.9882, 0.9767, 0.9430, 0.9430, 0.9541, 0.9430, 0.9105}, + {0.9430, 0.9767, 0.9882, 0.9767, 0.9541, 0.9882, 1.0000, 0.9882, 0.9430, 0.9767, 0.9882, 0.9767, 0.9105, 0.9430, 0.9541, 0.9430}, + {0.8894, 0.9430, 0.9767, 0.9882, 0.8999, 0.9541, 0.9882, 1.0000, 0.8894, 0.9430, 0.9767, 0.9882, 0.8587, 0.9105, 0.9430, 0.9541}, + {0.9541, 0.9430, 0.9105, 0.8587, 0.9882, 0.9767, 0.9430, 0.8894, 1.0000, 0.9882, 0.9541, 0.8999, 0.9882, 0.9767, 0.9430, 0.8894}, + {0.9430, 0.9541, 0.9430, 0.9105, 0.9767, 0.9882, 0.9767, 0.9430, 0.9882, 1.0000, 0.9882, 0.9541, 0.9767, 0.9882, 0.9767, 0.9430}, + {0.9105, 0.9430, 0.9541, 0.9430, 0.9430, 0.9767, 0.9882, 0.9767, 0.9541, 0.9882, 1.0000, 0.9882, 0.9430, 0.9767, 0.9882, 0.9767}, + {0.8587, 0.9105, 0.9430, 0.9541, 0.8894, 0.9430, 0.9767, 0.9882, 0.8999, 0.9541, 0.9882, 1.0000, 0.8894, 0.9430, 0.9767, 0.9882}, + {0.8999, 0.8894, 0.8587, 0.8099, 0.9541, 0.9430, 0.9105, 0.8587, 0.9882, 0.9767, 0.9430, 0.8894, 1.0000, 0.9882, 0.9541, 0.8999}, + {0.8894, 0.8999, 0.8894, 0.8587, 0.9430, 0.9541, 0.9430, 0.9105, 0.9767, 0.9882, 0.9767, 0.9430, 0.9882, 1.0000, 0.9882, 0.9541}, + {0.8587, 0.8894, 0.8999, 0.8894, 0.9105, 0.9430, 0.9541, 0.9430, 0.9430, 0.9767, 0.9882, 0.9767, 0.9541, 0.9882, 1.0000, 0.9882}, + {0.8099, 0.8587, 0.8894, 0.8999, 0.8587, 0.9105, 0.9430, 0.9541, 0.8894, 0.9430, 0.9767, 0.9882, 0.8999, 0.9541, 0.9882, 1.0000} +}; + +// TS 38.104 - Table G.2.3.1.2-3: MIMO correlation matrices for medium correlation +static double R22_medium[4][4] = { + {1.0000, 0.9000, 0.3000, 0.2700}, + {0.9000, 1.0000, 0.2700, 0.3000}, + {0.3000, 0.2700, 1.0000, 0.9000}, + {0.2700, 0.3000, 0.9000, 1.0000} +}; +static double R24_medium[8][8] = { + {1.0000, 0.9884, 0.9543, 0.9000, 0.3000, 0.2965, 0.2863, 0.2700}, + {0.9884, 1.0000, 0.9884, 0.9543, 0.2965, 0.3000, 0.2965, 0.2863}, + {0.9543, 0.9884, 1.0000, 0.9884, 0.2863, 0.2965, 0.3000, 0.2965}, + {0.9000, 0.9543, 0.9884, 1.0000, 0.2700, 0.2863, 0.2965, 0.3000}, + {0.3000, 0.2965, 0.2863, 0.2700, 1.0000, 0.9884, 0.9543, 0.9000}, + {0.2965, 0.3000, 0.2965, 0.2863, 0.9884, 1.0000, 0.9884, 0.9543}, + {0.2863, 0.2965, 0.3000, 0.2965, 0.9543, 0.9884, 1.0000, 0.9884}, + {0.2700, 0.2863, 0.2965, 0.3000, 0.9000, 0.9543, 0.9884, 1.0000} +}; +static double R44_medium[16][16] = { + {1.0000, 0.9882, 0.9541, 0.8999, 0.8747, 0.8645, 0.8347, 0.7872, 0.5855, 0.5787, 0.5588, 0.5270, 0.3000, 0.2965, 0.2862, 0.2700}, + {0.9882, 1.0000, 0.9882, 0.9541, 0.8645, 0.8747, 0.8645, 0.8347, 0.5787, 0.5855, 0.5787, 0.5588, 0.2965, 0.3000, 0.2965, 0.2862}, + {0.9541, 0.9882, 1.0000, 0.9882, 0.8347, 0.8645, 0.8747, 0.8645, 0.5588, 0.5787, 0.5855, 0.5787, 0.2862, 0.2965, 0.3000, 0.2965}, + {0.8999, 0.9541, 0.9882, 1.0000, 0.7872, 0.8347, 0.8645, 0.8747, 0.5270, 0.5588, 0.5787, 0.5855, 0.2700, 0.2862, 0.2965, 0.3000}, + {0.8747, 0.8645, 0.8347, 0.7872, 1.0000, 0.9882, 0.9541, 0.8999, 0.8747, 0.8645, 0.8347, 0.7872, 0.5855, 0.5787, 0.5588, 0.5270}, + {0.8645, 0.8747, 0.8645, 0.8347, 0.9882, 1.0000, 0.9882, 0.9541, 0.8645, 0.8747, 0.8645, 0.8347, 0.5787, 0.5855, 0.5787, 0.5588}, + {0.8347, 0.8645, 0.8747, 0.8645, 0.9541, 0.9882, 1.0000, 0.9882, 0.8347, 0.8645, 0.8747, 0.8645, 0.5588, 0.5787, 0.5855, 0.5787}, + {0.7872, 0.8347, 0.8645, 0.8747, 0.8999, 0.9541, 0.9882, 1.0000, 0.7872, 0.8347, 0.8645, 0.8747, 0.5270, 0.5588, 0.5787, 0.5855}, + {0.5855, 0.5787, 0.5588, 0.5270, 0.8747, 0.8645, 0.8347, 0.7872, 1.0000, 0.9882, 0.9541, 0.8999, 0.8747, 0.8645, 0.8347, 0.7872}, + {0.5787, 0.5855, 0.5787, 0.5588, 0.8645, 0.8747, 0.8645, 0.8347, 0.9882, 1.0000, 0.9882, 0.9541, 0.8645, 0.8747, 0.8645, 0.8347}, + {0.5588, 0.5787, 0.5855, 0.5787, 0.8347, 0.8645, 0.8747, 0.8645, 0.9541, 0.9882, 1.0000, 0.9882, 0.8347, 0.8645, 0.8747, 0.8645}, + {0.5270, 0.5588, 0.5787, 0.5855, 0.7872, 0.8347, 0.8645, 0.8747, 0.8999, 0.9541, 0.9882, 1.0000, 0.7872, 0.8347, 0.8645, 0.8747}, + {0.3000, 0.2965, 0.2862, 0.2700, 0.5855, 0.5787, 0.5588, 0.5270, 0.8747, 0.8645, 0.8347, 0.7872, 1.0000, 0.9882, 0.9541, 0.8999}, + {0.2965, 0.3000, 0.2965, 0.2862, 0.5787, 0.5855, 0.5787, 0.5588, 0.8645, 0.8747, 0.8645, 0.8347, 0.9882, 1.0000, 0.9882, 0.9541}, + {0.2862, 0.2965, 0.3000, 0.2965, 0.5588, 0.5787, 0.5855, 0.5787, 0.8347, 0.8645, 0.8747, 0.8645, 0.9541, 0.9882, 1.0000, 0.9882}, + {0.2700, 0.2862, 0.2965, 0.3000, 0.5270, 0.5588, 0.5787, 0.5855, 0.7872, 0.8347, 0.8645, 0.8747, 0.8999, 0.9541, 0.9882, 1.0000} +}; + +// Matrices computed based on TS 38.104 - Tables G.2.3.1.1-3 and G.2.3.1.2-1 +static double R12_medium_high[2][2] = { + {1.0, 0.9}, + {0.9, 1.0} +}; +static double R14_medium_high[4][4] = { + {1.000000, 0.988362, 0.954253, 0.900000}, + {0.988362, 1.000000, 0.988362, 0.954253}, + {0.954253, 0.988362, 1.000000, 0.988362}, + {0.900000, 0.954253, 0.988362, 1.000000}, +}; +static double R18_medium_high[8][8] = { + {1.000000, 0.997852, 0.991436, 0.980834, 0.966182, 0.947664, 0.925512, 0.900000}, + {0.997852, 1.000000, 0.997852, 0.991436, 0.980834, 0.966182, 0.947664, 0.925512}, + {0.991436, 0.997852, 1.000000, 0.997852, 0.991436, 0.980834, 0.966182, 0.947664}, + {0.980834, 0.991436, 0.997852, 1.000000, 0.997852, 0.991436, 0.980834, 0.966182}, + {0.966182, 0.980834, 0.991436, 0.997852, 1.000000, 0.997852, 0.991436, 0.980834}, + {0.947664, 0.966182, 0.980834, 0.991436, 0.997852, 1.000000, 0.997852, 0.991436}, + {0.925512, 0.947664, 0.966182, 0.980834, 0.991436, 0.997852, 1.000000, 0.997852}, + {0.900000, 0.925512, 0.947664, 0.966182, 0.980834, 0.991436, 0.997852, 1.000000} +}; \ No newline at end of file diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index 64842cfa63..8068cba53b 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -50,6 +50,13 @@ typedef enum { #define CHANMODEL_FREE_RSQRT_6 1<<1 #define CHANMODEL_FREE_RSQRT_NTAPS 1<<2 #define CHANMODEL_FREE_AMPS 1<<3 + +typedef enum { + CORR_LEVEL_LOW, + CORR_LEVEL_MEDIUM, + CORR_LEVEL_HIGH +} corr_level_t; + typedef struct { ///Number of tx antennas uint8_t nb_tx; @@ -75,8 +82,10 @@ typedef struct { double channel_bandwidth; ///System sampling rate in Msps. double sampling_rate; - ///Ricean factor of first tap wrt other taps (0..1, where 0 means AWGN and 1 means Rayleigh channel). + ///Ricean factor, sqrt(1/(K+1)), of first tap wrt other taps (0..1, where 0 means AWGN and 1 means Rayleigh channel). double ricean_factor; + ///Correlation level of correlation channel matrix + corr_level_t corr_level; ///Angle of arrival of wavefront (in radians). For Ricean channel only. This assumes that both RX and TX have linear antenna arrays with lambda/2 antenna spacing. Furhter it is assumed that the arrays are parallel to each other and that they are far enough apart so that we can safely assume plane wave propagation. double aoa; ///If set to 1, aoa is randomized according to a uniform random distribution From 6f51b930c10585a6a81322406384da0ecba00b81 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Tue, 30 Aug 2022 19:45:08 +0100 Subject: [PATCH 28/49] Put the correlation level (low, medium or high) as input of new_channel_desc_scm() --- openair1/SIMULATION/LTE_PHY/dlsim.c | 8 +++- openair1/SIMULATION/LTE_PHY/ulsim.c | 4 +- openair1/SIMULATION/NR_PHY/dlschsim.c | 14 ++++--- openair1/SIMULATION/NR_PHY/dlsim.c | 8 ++-- openair1/SIMULATION/NR_PHY/pbchsim.c | 10 +++-- openair1/SIMULATION/NR_PHY/prachsim.c | 4 +- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/NR_PHY/ulschsim.c | 6 ++- openair1/SIMULATION/NR_PHY/ulsim.c | 11 ++++-- openair1/SIMULATION/TOOLS/random_channel.c | 26 ++++++++----- openair1/SIMULATION/TOOLS/sim.h | 7 ++-- radio/rfsimulator/simulator.c | 18 ++++----- targets/RT/USER/rfsim.c | 44 +++++++++++----------- 13 files changed, 98 insertions(+), 64 deletions(-) diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index e2f78e9036..5da6a3cde7 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -1192,9 +1192,11 @@ int main(int argc, char **argv) { N_RB2sampling_rate(eNB->frame_parms.N_RB_DL), N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL), DS_TDL, + CORR_LEVEL_LOW, forgetting_factor, rx_sample_offset, - 0, 0); + 0, + 0); reset_meas(&eNB2UE[0]->random_channel); reset_meas(&eNB2UE[0]->interp_time); @@ -1206,9 +1208,11 @@ int main(int argc, char **argv) { N_RB2sampling_rate(eNB->frame_parms.N_RB_DL), N_RB2channel_bandwidth(eNB->frame_parms.N_RB_DL), DS_TDL, + CORR_LEVEL_LOW, forgetting_factor, rx_sample_offset, - 0, 0); + 0, + 0); reset_meas(&eNB2UE[n]->random_channel); reset_meas(&eNB2UE[n]->interp_time); } diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index b72ed441f6..5db449e4b9 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -741,9 +741,11 @@ int main(int argc, char **argv) { N_RB2sampling_rate(eNB->frame_parms.N_RB_UL), N_RB2channel_bandwidth(eNB->frame_parms.N_RB_UL), 30e-9, + CORR_LEVEL_LOW, forgetting_factor, delay, - 0, 0); + 0, + 0); // set Doppler UE2eNB->max_Doppler = maxDoppler; diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index 768501e99a..3b36b0d6e5 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -336,11 +336,15 @@ int main(int argc, char **argv) if (ouput_vcd) vcd_signal_dumper_init("/tmp/openair_dump_nr_dlschsim.vcd"); - gNB2UE = new_channel_desc_scm(n_tx, n_rx, channel_model, - 61.44e6, //N_RB2sampling_rate(N_RB_DL), - 40e6, //N_RB2channel_bandwidth(N_RB_DL), - DS_TDL, - 0, 0, 0, 0); + gNB2UE = new_channel_desc_scm(n_tx, n_rx, channel_model, + 61.44e6, //N_RB2sampling_rate(N_RB_DL), + 40e6, //N_RB2channel_bandwidth(N_RB_DL), + DS_TDL, + CORR_LEVEL_LOW, + 0, + 0, + 0, + 0); if (gNB2UE == NULL) { printf("Problem generating channel model. Exiting.\n"); diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 59a74c9e91..3a0c90842d 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -901,11 +901,13 @@ int main(int argc, char **argv) n_rx, channel_model, fs/1e6,//sampling frequency in MHz - txbw, - 30e-9, + txbw, + 30e-9, + CORR_LEVEL_LOW, 0, 0, - 0, 0); + 0, + 0); if (gNB2UE==NULL) { printf("Problem generating channel model. Exiting.\n"); diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index 8c7bce71f6..0a50e79139 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -534,12 +534,14 @@ int main(int argc, char **argv) gNB2UE = new_channel_desc_scm(n_tx, n_rx, channel_model, - fs, - bw, - 300e-9, + fs, + bw, + 300e-9, + CORR_LEVEL_LOW, 0, 0, - 0, 0); + 0, + 0); if (gNB2UE==NULL) { printf("Problem generating channel model. Exiting.\n"); diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 3622ba49ba..7adb0d4b93 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -734,9 +734,11 @@ int main(int argc, char **argv){ fs, bw, DS_TDL, + CORR_LEVEL_LOW, 0.0, delay, - 0, 0); + 0, + 0); if (UE2gNB==NULL) { printf("Problem generating channel model. Exiting.\n"); diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index cabe87ef01..199942bd30 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -415,7 +415,7 @@ int main(int argc, char **argv) &txbw, &rxbw); - UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, txbw, DS_TDL,0, 0, 0, 0); + UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, fs, txbw, DS_TDL, CORR_LEVEL_LOW, 0, 0, 0, 0); if (UE2gNB==NULL) { printf("Problem generating channel model. Exiting.\n"); diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c index 91377e3d31..7d9b465d37 100644 --- a/openair1/SIMULATION/NR_PHY/ulschsim.c +++ b/openair1/SIMULATION/NR_PHY/ulschsim.c @@ -383,7 +383,11 @@ int main(int argc, char **argv) 61.44e6, //N_RB2sampling_rate(N_RB_DL), 40e6, //N_RB2channel_bandwidth(N_RB_DL), DS_TDL, - 0,0,0, 0); + CORR_LEVEL_LOW, + 0, + 0, + 0, + 0); if (gNB2UE == NULL) { printf("Problem generating channel model. Exiting.\n"); diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index 3ec1c58467..def47fb3db 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -699,12 +699,17 @@ int main(int argc, char **argv) LOG_I( PHY,"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++",loglvl); - - UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, + corr_level_t corr_level = CORR_LEVEL_MEDIUM; // FIXME: Remove this hardcoded value + UE2gNB = new_channel_desc_scm(n_tx, + n_rx, channel_model, sampling_frequency/1e6, tx_bandwidth, DS_TDL, - 0, 0, 0, 0); + corr_level, + 0, + 0, + 0, + 0); if (UE2gNB == NULL) { printf("Problem generating channel model. Exiting.\n"); diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 9eb8ebe7e6..8b6d100ca3 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -386,9 +386,6 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS for (int i = 0; inb_taps; i++) chan_desc->a[i] = (struct complexd *) malloc(nb_tx*nb_rx * sizeof(struct complexd)); - // FIXME: Remove this hardcoded value - chan_desc->corr_level = CORR_LEVEL_LOW; - int matrix_size = nb_tx*nb_rx; double *correlation_matrix[matrix_size]; if (chan_desc->corr_level!=CORR_LEVEL_LOW) { @@ -459,10 +456,11 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, double sampling_rate, double channel_bandwidth, double DS_TDL, + const corr_level_t corr_level, double forgetting_factor, int32_t channel_offset, double path_loss_dB, - float noise_power_dB) { + float noise_power_dB) { channel_desc_t *chan_desc = (channel_desc_t *)calloc(1,sizeof(channel_desc_t)); for(int i=0; imodelid = channel_model; + chan_desc->modelid = channel_model; chan_desc->nb_tx = nb_tx; chan_desc->nb_rx = nb_rx; chan_desc->sampling_rate = sampling_rate; chan_desc->channel_bandwidth = channel_bandwidth; + chan_desc->corr_level = corr_level; chan_desc->forgetting_factor = forgetting_factor; chan_desc->channel_offset = channel_offset; chan_desc->path_loss_dB = path_loss_dB; chan_desc->first_run = 1; - chan_desc->ip = 0.0; + chan_desc->ip = 0.0; chan_desc->noise_power_dB = noise_power_dB; LOG_I(OCM,"Channel Model (inside of new_channel_desc_scm)=%d\n\n", channel_model); int tdl_paths=0; @@ -2009,10 +2008,17 @@ int load_channellist(uint8_t nb_tx, uint8_t nb_rx, double sampling_rate, double AssertFatal(0, "\n Choose a valid model type\n"); } - channel_desc_t *channeldesc_p = new_channel_desc_scm(nb_tx,nb_rx,modid,sampling_rate,channel_bandwidth, - *(channel_list.paramarray[i][pindex_DT].dblptr), *(channel_list.paramarray[i][pindex_FF].dblptr), - *(channel_list.paramarray[i][pindex_CO].iptr), *(channel_list.paramarray[i][pindex_PL].dblptr), - *(channel_list.paramarray[i][pindex_NP].dblptr) ); + channel_desc_t *channeldesc_p = new_channel_desc_scm(nb_tx, + nb_rx, + modid, + sampling_rate, + channel_bandwidth, + *(channel_list.paramarray[i][pindex_DT].dblptr), + CORR_LEVEL_LOW, + *(channel_list.paramarray[i][pindex_FF].dblptr), + *(channel_list.paramarray[i][pindex_CO].iptr), + *(channel_list.paramarray[i][pindex_PL].dblptr), + *(channel_list.paramarray[i][pindex_NP].dblptr)); AssertFatal( (channeldesc_p!= NULL), "Could not allocate channel %s type %s \n",*(channel_list.paramarray[i][pindex_NAME].strptr), *(channel_list.paramarray[i][pindex_TYPE].strptr)); channeldesc_p->model_name = strdup(*(channel_list.paramarray[i][pindex_NAME].strptr)); LOG_I(OCM,"Model %s type %s allocated from config file, list %s\n",*(channel_list.paramarray[i][pindex_NAME].strptr), diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index 8068cba53b..fc35b5cae5 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -312,13 +312,14 @@ typedef struct { channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, uint8_t nb_rx, SCM_t channel_model, - double sampling_rate, + double sampling_rate, double channel_bandwidth, - double TDL_DS, + double DS_TDL, + const corr_level_t corr_level, double forgetting_factor, int32_t channel_offset, double path_loss_dB, - float noise_power_dB); + float noise_power_dB); channel_desc_t *find_channel_desc_fromname( char *modelname ); diff --git a/radio/rfsimulator/simulator.c b/radio/rfsimulator/simulator.c index 332d588b6f..498c3d1ea3 100644 --- a/radio/rfsimulator/simulator.c +++ b/radio/rfsimulator/simulator.c @@ -343,15 +343,15 @@ static int rfsimu_setchanmod_cmd(char *buff, int debug, telnet_printfunc_t prnt, if (b->conn_sock >= 0 && (strcmp(b->channel_model->model_name,modelname)==0)) { channel_desc_t *newmodel=new_channel_desc_scm(t->tx_num_channels,t->rx_num_channels, - channelmod, - t->sample_rate, - t->tx_bw, - 30e-9, // TDL delay-spread parameter - t->chan_forgetfact, // forgetting_factor - t->chan_offset, // maybe used for TA - t->chan_pathloss, - t->noise_power_dB - ); // path_loss in dB + channelmod, + t->sample_rate, + t->tx_bw, + 30e-9, // TDL delay-spread parameter + CORR_LEVEL_LOW, + t->chan_forgetfact, // forgetting_factor + t->chan_offset, // maybe used for TA + t->chan_pathloss, + t->noise_power_dB); // path_loss in dB set_channeldesc_owner(newmodel, RFSIMU_MODULEID); set_channeldesc_name(newmodel,modelname); random_channel(newmodel,false); diff --git a/targets/RT/USER/rfsim.c b/targets/RT/USER/rfsim.c index 2bd95507c3..df604d247a 100644 --- a/targets/RT/USER/rfsim.c +++ b/targets/RT/USER/rfsim.c @@ -352,31 +352,33 @@ void init_ocm(void) { for (CC_id=0; CC_idframe_parms->N_RB_DL); - sim.RU2UE[ru_id][UE_id][CC_id] = - new_channel_desc_scm(RC.ru[ru_id]->nb_tx, - PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx, - AWGN, - N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_DL), - N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_DL), - DS_TDL, - 0.0, - 0, - 0, - 0); + sim.RU2UE[ru_id][UE_id][CC_id] = + new_channel_desc_scm(RC.ru[ru_id]->nb_tx, + PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx, + AWGN, + N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_DL), + N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_DL), + DS_TDL, + CORR_LEVEL_LOW, + 0.0, + 0, + 0, + 0); random_channel(sim.RU2UE[ru_id][UE_id][CC_id],0); LOG_D(OCM,"[SIM] Initializing channel (%s) from UE %d to ru %d\n", "AWGN", UE_id, ru_id); sim.UE2RU[UE_id][ru_id][CC_id] = - new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_tx, - RC.ru[ru_id]->nb_rx, - AWGN, - N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_UL), - N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_UL), - DS_TDL, - 0.0, - 0, - 0, - 0); + new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_tx, + RC.ru[ru_id]->nb_rx, + AWGN, + N_RB2sampling_rate(RC.ru[ru_id]->frame_parms->N_RB_UL), + N_RB2channel_bandwidth(RC.ru[ru_id]->frame_parms->N_RB_UL), + DS_TDL, + CORR_LEVEL_LOW, + 0.0, + 0, + 0, + 0); random_channel(sim.UE2RU[UE_id][ru_id][CC_id],0); // to make channel reciprocal uncomment following line instead of previous. However this only works for SISO at the moment. For MIMO the channel would need to be transposed. //UE2RU[UE_id][ru_id] = RU2UE[ru_id][UE_id]; From f8160bd34ab10a1077fb117c67243d4cf974e60f Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Wed, 31 Aug 2022 14:38:42 +0100 Subject: [PATCH 29/49] Change input command line from -g 2 A l to -g A,l and add channel correlation level as command line option in ulsim --- openair1/SIMULATION/NR_PHY/ulsim.c | 111 +++++++++++++---------------- 1 file changed, 49 insertions(+), 62 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index def47fb3db..d1a06393b4 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -291,6 +291,7 @@ int main(int argc, char **argv) //int8_t interf1 = -21, interf2 = -21; FILE *input_fd = NULL; SCM_t channel_model = AWGN; //Rayleigh1_anticorr; + corr_level_t corr_level = CORR_LEVEL_LOW; uint16_t N_RB_DL = 106, N_RB_UL = 106, mu = 1; NB_UE_INST = 1; @@ -398,70 +399,52 @@ int main(int argc, char **argv) break; case 'g': + switch ((char) *optarg) { case 'A': - channel_model = SCM_A; - printf("Channel model: SCM-A\n"); - break; - - case 'B': - channel_model = SCM_B; - printf("Channel model: SCM-B\n"); - break; - - case 'C': - channel_model = SCM_C; - printf("Channel model: SCM-C\n"); - break; - - case 'D': - channel_model = SCM_D; - printf("Channel model: SCM-D\n"); - break; - - case 'E': - channel_model = EPA; - printf("Channel model: EPA\n"); - break; - - case 'F': - channel_model = EVA; - printf("Channel model: EVA\n"); - break; - - case 'G': - channel_model = ETU; - printf("Channel model: ETU\n"); - break; - - case 'H': channel_model = TDL_A; DS_TDL = 0.030; // 30 ns printf("Channel model: TDLA30\n"); break; - - case 'I': + case 'B': channel_model = TDL_B; DS_TDL = 0.100; // 100ns printf("Channel model: TDLB100\n"); break; - - case 'J': + case 'C': channel_model = TDL_C; DS_TDL = 0.300; // 300 ns printf("Channel model: TDLC300\n"); break; - default: printf("Unsupported channel model!\n"); exit(-1); } + + if (optarg[1] == ',') { + switch (optarg[2]) { + case 'l': + corr_level = CORR_LEVEL_LOW; + break; + case 'm': + corr_level = CORR_LEVEL_MEDIUM; + break; + case 'h': + corr_level = CORR_LEVEL_HIGH; + break; + default: + printf("Invalid correlation level!\n"); + } + } + break; case 'i': - for(i=0; i < atoi(optarg); i++){ - chest_type[i] = atoi(argv[optind++]); - } + i=0; + do { + chest_type[i>>1] = atoi(&optarg[i]); + i+=2; + } while (optarg[i-1] == ','); break; case 'k': @@ -523,7 +506,7 @@ int main(int argc, char **argv) break; case 't': - eff_tp_check = (float)atoi(optarg); + eff_tp_check = atof(optarg); break; /* @@ -606,16 +589,20 @@ int main(int argc, char **argv) case 'T': enable_ptrs=1; - for(i=0; i < atoi(optarg); i++){ - ptrs_arg[i] = atoi(argv[optind++]); - } + i=0; + do { + ptrs_arg[i>>1] = atoi(&optarg[i]); + i+=2; + } while (optarg[i-1] == ','); break; case 'U': modify_dmrs = 1; - for(i=0; i < atoi(optarg); i++){ - dmrs_arg[i] = atoi(argv[optind++]); - } + i=0; + do { + dmrs_arg[i>>1] = atoi(&optarg[i]); + i+=2; + } while (optarg[i-1] == ','); break; case 'Q': @@ -635,11 +622,12 @@ int main(int argc, char **argv) //printf("-d Use TDD\n"); printf("-d Introduce delay in terms of number of samples\n"); printf("-f Number of frames to simulate\n"); - printf("-g and the channel model [A] SCM-A, [B] SCM-B, [C] SCM-C, [D] SCM-D, [E] EPA, [F] EVA, [G] ETU, [H] TDLA30, [I] TDLB100, [J] TDLC300\n"); + printf("-g Channel model configuration. Arguments list: Number of arguments = 2, {Channel model: [A] TDLA30, [B] TDLB100, [C] TDLC300}, {Correlation: [l] Low, [m] Medium, [h] High}, e.g. -g A,l\n"); printf("-h This message\n"); - printf("-i Change channel estimation technique. Arguments list: Number of arguments=2, Frequency domain {0:Linear interpolation, 1:PRB based averaging}, Time domain {0:Estimates of last DMRS symbol, 1:Average of DMRS symbols}. e.g. -i 2 1 0\n"); + printf("-i Change channel estimation technique. Arguments list: Number of arguments=2, Frequency domain {0:Linear interpolation, 1:PRB based averaging}, Time domain {0:Estimates of last DMRS symbol, 1:Average of DMRS symbols}. e.g. -i 1,0\n"); //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n"); printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if ending SNR isn't given\n"); + printf("-S Ending SNR, runs from SNR0 to SNR1\n"); printf("-m MCS value\n"); printf("-n Number of trials to simulate\n"); printf("-o ldpc offload flag\n"); @@ -663,10 +651,9 @@ int main(int argc, char **argv) printf("-O oversampling factor (1,2,4,8,16)\n"); printf("-R Maximum number of available resorce blocks (N_RB_DL)\n"); printf("-t Acceptable effective throughput (in percentage)\n"); - printf("-S Ending SNR, runs from SNR0 to SNR1\n"); printf("-P Print ULSCH performances\n"); - printf("-T Enable PTRS, arguments list: Number of arguments=2 L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n"); - printf("-U Change DMRS Config, arguments list: Number of arguments=4, DMRS Mapping Type{0=A,1=B}, DMRS AddPos{0:3}, DMRS Config Type{1,2}, Number of CDM groups without data{1,2,3} e.g. -U 4 0 2 0 1 \n"); + printf("-T Enable PTRS, arguments list: Number of arguments=2 L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 0,2 \n"); + printf("-U Change DMRS Config, arguments list: Number of arguments=4, DMRS Mapping Type{0=A,1=B}, DMRS AddPos{0:3}, DMRS Config Type{1,2}, Number of CDM groups without data{1,2,3} e.g. -U 0,2,0,1 \n"); printf("-Q If -F used, read parameters from file\n"); printf("-Z If -Z is used, SC-FDMA or transform precoding is enabled in Uplink \n"); printf("-W Num of layer for PUSCH\n"); @@ -699,7 +686,6 @@ int main(int argc, char **argv) LOG_I( PHY,"++++++++++++++++++++++++++++++++++++++++++++++%i+++++++++++++++++++++++++++++++++++++++++",loglvl); - corr_level_t corr_level = CORR_LEVEL_MEDIUM; // FIXME: Remove this hardcoded value UE2gNB = new_channel_desc_scm(n_tx, n_rx, channel_model, sampling_frequency/1e6, @@ -1020,7 +1006,6 @@ int main(int argc, char **argv) //for (int i=0;i<16;i++) printf("%f\n",gaussdouble(0.0,1.0)); snrRun = 0; - int n_errs = 0; int read_errors=0; int slot_offset = frame_parms->get_samples_slot_timestamp(slot,frame_parms,0); @@ -1071,7 +1056,8 @@ int main(int argc, char **argv) mod_order = nr_get_Qm_ul(Imcs, mcs_table); code_rate = nr_get_code_rate_ul(Imcs, mcs_table); } - + + int ret = 1; uint32_t errors_scrambling[4][100]; int n_errors[4][100]; int round_trials[4][100]; @@ -1083,8 +1069,9 @@ int main(int argc, char **argv) memset(round_trials, 0, sizeof(int)*4*100); memset(blerStats, 0, sizeof(double)*4*100); memset(berStats, 0, sizeof(double)*4*100); - memset(snrStats, 0, sizeof(double)*100); - for (SNR = snr0; SNR < snr1; SNR += snr_step) { + memset(snrStats, 0, sizeof(double) * 100); + + for (SNR = snr0; SNR <= snr1; SNR += snr_step) { varArray_t *table_rx=initVarArray(1000,sizeof(double)); int error_flag = 0; n_false_positive = 0; @@ -1627,12 +1614,12 @@ int main(int argc, char **argv) printf("*************\n"); printf("PUSCH test OK\n"); printf("*************\n"); + ret = 0; break; } snrStats[snrRun] = SNR; snrRun++; - n_errs = n_errors[0][snrRun]; } // SNR loop printf("\n"); @@ -1681,5 +1668,5 @@ int main(int argc, char **argv) if (scg_fd) fclose(scg_fd); - return (n_errs); + return ret; } From abb6fadd19b6e68a55ce311d3a9a977c10903da7 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Wed, 31 Aug 2022 15:46:40 +0100 Subject: [PATCH 30/49] Implementation of function add_noise() --- openair1/SIMULATION/NR_PHY/ulsim.c | 13 +--------- openair1/SIMULATION/TOOLS/multipath_channel.c | 26 +++++++++++++++++++ openair1/SIMULATION/TOOLS/sim.h | 24 +++++++++++++++++ 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index d1a06393b4..54c0d42db1 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -305,7 +305,6 @@ int main(int argc, char **argv) int Imcs = 9; uint8_t precod_nbr_layers = 1; int gNB_id = 0; - int ap; int tx_offset; int32_t txlev_sum = 0, atxlev[4]; int start_rb = 0; @@ -1319,17 +1318,7 @@ int main(int argc, char **argv) } else { multipath_tv_channel(UE2gNB, s_re, s_im, r_re, r_im, 2*slot_length, 0); } - - for (i=0; inb_antennas_rx; ap++) { - rxdata[ap][slot_offset+i+delay].r = (int16_t)((r_re[ap][i]) + (sqrt(sigma/2)*gaussdouble(0.0,1.0))); // convert to fixed point - rxdata[ap][slot_offset+i+delay].i = (int16_t)((r_im[ap][i]) + (sqrt(sigma/2)*gaussdouble(0.0,1.0))); - /* Add phase noise if enabled */ - if (pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { - phase_noise(ts, &rxdata[ap][slot_offset].r, &rxdata[ap][slot_offset].i); - } - } - } + add_noise(rxdata, (const double **) r_re, (const double **) r_im, sigma, slot_length, slot_offset, ts, delay, pdu_bit_map, frame_parms->nb_antennas_rx); } /*End input_fd */ diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.c b/openair1/SIMULATION/TOOLS/multipath_channel.c index cff6f85d46..6adc33b646 100644 --- a/openair1/SIMULATION/TOOLS/multipath_channel.c +++ b/openair1/SIMULATION/TOOLS/multipath_channel.c @@ -23,6 +23,7 @@ #include #include #include +#include "nfapi_nr_interface_scf.h" #include "PHY/TOOLS/tools_defs.h" #include "SIMULATION/RF/rf.h" #include "sim.h" @@ -144,6 +145,31 @@ void multipath_channel(channel_desc_t *desc, } #else + +void add_noise(c16_t **rxdata, + const double **r_re, + const double **r_im, + const double sigma, + const int length, + const int slot_offset, + const double ts, + const int delay, + const uint16_t pdu_bit_map, + const uint8_t nb_antennas_rx) +{ + for (int i = 0; i < length; i++) { + for (int ap = 0; ap < nb_antennas_rx; ap++) { + c16_t *rxd = &rxdata[ap][slot_offset + i + delay]; + rxd->r = r_re[ap][i] + sqrt(sigma / 2) * gaussdouble(0.0, 1.0); // convert to fixed point + rxd->i = r_im[ap][i] + sqrt(sigma / 2) * gaussdouble(0.0, 1.0); + /* Add phase noise if enabled */ + if (pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) { + phase_noise(ts, &rxdata[ap][slot_offset + i + delay].r, &rxdata[ap][slot_offset + i + delay].i); + } + } + } +} + void multipath_channel(channel_desc_t *desc, double *tx_sig_re[NB_ANTENNAS_TX], double *tx_sig_im[NB_ANTENNAS_TX], diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index fc35b5cae5..badb2c3d35 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -348,6 +348,30 @@ void set_channeldesc_name(channel_desc_t *cdesc,char *modelname); */ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag); +/** +\brief Add AWGN noise and phase noise if enabled +\param rxdata output data with noise +\param r_re real part of input data without noise +\param r_im imaginary part of input data without noise +\param sigma noise power +\param length number of samples to apply the noise +\param slot_offset slot offset to start applying the noise +\param ts sampling time +\param delay introduce delay in terms of number of samples +\param pdu_bit_map bitmap indicating presence of optional PDUs +\param nb_antennas_rx number of receive antennas +*/ +void add_noise(c16_t **rxdata, + const double **r_re, + const double **r_im, + const double sigma, + const int length, + const int slot_offset, + const double ts, + const int delay, + const uint16_t pdu_bit_map, + const uint8_t nb_antennas_rx); + /**\fn void multipath_channel(channel_desc_t *desc, double tx_sig_re[NB_ANTENNAS_TX], double tx_sig_im[NB_ANTENANS_TX], From 9b594ff3b61f9e9efca67a4bd316812ab1c88a8b Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Thu, 1 Sep 2022 15:07:26 +0100 Subject: [PATCH 31/49] Fix AWGN channel --- openair1/SIMULATION/NR_PHY/pucchsim.c | 2 +- openair1/SIMULATION/TOOLS/random_channel.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c index 199942bd30..7dc5ccdeff 100644 --- a/openair1/SIMULATION/NR_PHY/pucchsim.c +++ b/openair1/SIMULATION/NR_PHY/pucchsim.c @@ -354,7 +354,7 @@ int main(int argc, char **argv) printf("-b number of HARQ bits (1-2)\n"); printf("-B payload to be transmitted on PUCCH\n"); printf("-m initial cyclic shift m0\n"); - printf("-T to check nacktoack miss for format 1"); + printf("-T to check nacktoack miss for format 1\n"); exit (-1); break; } diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index 8b6d100ca3..e744106daf 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -1616,6 +1616,22 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { struct complexd phase, alpha, beta; start_meas(&desc->random_channel); + // For AWGN channel, the received signal (Srx) is equal to transmitted signal (Stx) plus noise (N), i.e., Srx = Stx + N, + // therefore, the channel matrix is the identity matrix. + if (desc->modelid == AWGN) { + for (aarx=0; aarxnb_rx; aarx++) { + for (aatx = 0; aatx < desc->nb_tx; aatx++) { + desc->ch[aarx+(aatx*desc->nb_rx)][0].r = aarx%desc->nb_tx == aatx ? 1.0 : 0.0; + desc->ch[aarx+(aatx*desc->nb_rx)][0].i = 0.0; + acorr[aarx+(aatx*desc->nb_rx)].r = desc->ch[aarx+(aatx*desc->nb_rx)][0].r; + acorr[aarx+(aatx*desc->nb_rx)].i = desc->ch[aarx+(aatx*desc->nb_rx)][0].i; + } + } + cblas_zcopy(desc->nb_tx*desc->nb_rx, (void *) acorr, 1, (void *) desc->a[0], 1); + stop_meas(&desc->random_channel); + desc->first_run = 0; + return 0; + } bzero(acorr,desc->nb_tx*desc->nb_rx*sizeof(struct complexd)); for (i=0; i<(int)desc->nb_taps; i++) { From 6b83d9e0f1a5991edb1821bbd14a18152f305f1a Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Fri, 30 Sep 2022 01:22:05 +0100 Subject: [PATCH 32/49] Compute normalization channel factor --- openair1/SIMULATION/TOOLS/random_channel.c | 101 +++++++++++++++++++-- openair1/SIMULATION/TOOLS/sim.h | 2 + 2 files changed, 96 insertions(+), 7 deletions(-) diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index e744106daf..8f7cc8ea0e 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -36,6 +36,7 @@ //#define DEBUG_CH +//#define DEBUG_CH_POWER #include "assertions.h" @@ -450,6 +451,71 @@ void tdlModel(int tdl_paths, double *tdl_delays, double *tdl_amps_dB, double DS } } +double get_normalization_ch_factor(channel_desc_t *desc) +{ + if (!(desc->channel_length > 1 && desc->modelid >= TDL_A && desc->modelid <= TDL_E)) { + return 1.0; + } + + uint16_t N_average = 1000; + double accumulated_ch_power = 0; + struct complexd a[desc->nb_taps][desc->nb_tx * desc->nb_rx]; + struct complexd anew[desc->nb_tx * desc->nb_rx]; + struct complexd acorr[desc->nb_tx * desc->nb_rx]; + + for (int n = 1; n <= N_average; n++) { + for (int l = 0; l < (int)desc->nb_taps; l++) { + for (int aarx = 0; aarx < desc->nb_rx; aarx++) { + for (int aatx = 0; aatx < desc->nb_tx; aatx++) { + anew[aarx + (aatx * desc->nb_rx)].r = sqrt(desc->ricean_factor * desc->amps[l] / 2) * gaussdouble(0.0, 1.0); + anew[aarx + (aatx * desc->nb_rx)].i = sqrt(desc->ricean_factor * desc->amps[l] / 2) * gaussdouble(0.0, 1.0); + if ((l == 0) && (desc->ricean_factor != 1.0)) { + anew[aarx + (aatx * desc->nb_rx)].r += sqrt((1.0 - desc->ricean_factor) / 2); + anew[aarx + (aatx * desc->nb_rx)].i += sqrt((1.0 - desc->ricean_factor) / 2); + } + } // for (int aatx = 0; aatx < desc->nb_tx; aatx++) + } // for (int aarx = 0; aarx < desc->nb_rx; aarx++) + + // Apply correlation matrix + bzero(acorr, desc->nb_tx * desc->nb_rx * sizeof(struct complexd)); + for (int aatx = 0; aatx < desc->nb_tx; aatx++) { + for (int aarx = 0; aarx < desc->nb_rx; aarx++) { + cblas_zaxpy(desc->nb_tx * desc->nb_rx, + (void *)&anew[aarx + (aatx * desc->nb_rx)], + (void *)desc->R_sqrt[aarx + (aatx * desc->nb_rx)], + 1, + (void *)acorr, + 1); + } // for (int aarx = 0; aarx < desc->nb_rx; aarx++) + } // for (int aatx = 0; aatx < desc->nb_tx; aatx++) + cblas_zcopy(desc->nb_tx * desc->nb_rx, (void *)acorr, 1, (void *)a[l], 1); + } // for (int l = 0; l < (int)desc->nb_taps; l++) + + for (int aarx = 0; aarx < desc->nb_rx; aarx++) { + for (int aatx = 0; aatx < desc->nb_tx; aatx++) { + for (int k = 0; k < (int)desc->channel_length; k++) { + double ch_r = 0.0; + double ch_i = 0.0; + double s = 0.0; + for (int l = 0; l < desc->nb_taps; l++) { + if ((k - (desc->delays[l] * desc->sampling_rate) - desc->channel_offset) == 0) { + s = 1.0; + } else { + s = sin(M_PI * (k - (desc->delays[l] * desc->sampling_rate) - desc->channel_offset)) / + (M_PI * (k - (desc->delays[l] * desc->sampling_rate) - desc->channel_offset)); + } + ch_r += s * a[l][aarx + (aatx * desc->nb_rx)].r; + ch_i += s * a[l][aarx + (aatx * desc->nb_rx)].i; + } // for (int l = 0; l < desc->nb_taps; l++) + accumulated_ch_power += (ch_r * ch_r + ch_i * ch_i); + } // for (int k = 0; k < (int)desc->channel_length; k++) + } // for (int aatx = 0; aatx < desc->nb_tx; aatx++) + } // for (int aarx = 0; aarx < desc->nb_rx; aarx++) + } + + return sqrt((N_average * desc->nb_tx * desc->nb_rx) / accumulated_ch_power); +} + channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, uint8_t nb_rx, SCM_t channel_model, @@ -491,6 +557,7 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, chan_desc->first_run = 1; chan_desc->ip = 0.0; chan_desc->noise_power_dB = noise_power_dB; + chan_desc->normalization_ch_factor = 1.0; LOG_I(OCM,"Channel Model (inside of new_channel_desc_scm)=%d\n\n", channel_model); int tdl_paths=0; double *tdl_amps_dB; @@ -1540,6 +1607,8 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx, return(NULL); } + chan_desc->normalization_ch_factor = get_normalization_ch_factor(chan_desc); + LOG_D(OCM,"[CHANNEL] RF %f\n",chan_desc->ricean_factor); for (i=0; inb_taps; i++) @@ -1608,6 +1677,11 @@ void set_channeldesc_name(channel_desc_t *cdesc,char *modelname) { cdesc->model_name=strdup(modelname); } +#ifdef DEBUG_CH_POWER +double accumulated_ch_power = 0; +int ch_power_count = 0; +#endif + int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { double s; int i,k,l,aarx,aatx; @@ -1637,8 +1711,9 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { for (i=0; i<(int)desc->nb_taps; i++) { for (aarx=0; aarxnb_rx; aarx++) { for (aatx=0; aatxnb_tx; aatx++) { - anew[aarx+(aatx*desc->nb_rx)].r = sqrt(desc->ricean_factor*desc->amps[i]/2) * gaussdouble(0.0,1.0); - anew[aarx+(aatx*desc->nb_rx)].i = sqrt(desc->ricean_factor*desc->amps[i]/2) * gaussdouble(0.0,1.0); + + anew[aarx + (aatx * desc->nb_rx)].r = sqrt(desc->ricean_factor * desc->amps[i] / 2) * gaussdouble(0.0, 1.0) * desc->normalization_ch_factor; + anew[aarx + (aatx * desc->nb_rx)].i = sqrt(desc->ricean_factor * desc->amps[i] / 2) * gaussdouble(0.0, 1.0) * desc->normalization_ch_factor; if ((i==0) && (desc->ricean_factor != 1.0)) { if (desc->random_aoa==1) { @@ -1648,10 +1723,10 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { // this assumes that both RX and TX have linear antenna arrays with lambda/2 antenna spacing. // Furhter it is assumed that the arrays are parallel to each other and that they are far enough apart so // that we can safely assume plane wave propagation. - phase.r = cos(M_PI*((aarx-aatx)*sin(desc->aoa))); - phase.i = sin(M_PI*((aarx-aatx)*sin(desc->aoa))); - anew[aarx+(aatx*desc->nb_rx)].r += phase.r * sqrt(1.0-desc->ricean_factor); - anew[aarx+(aatx*desc->nb_rx)].i += phase.i * sqrt(1.0-desc->ricean_factor); + phase.r = cos(M_PI * ((aarx - aatx) * sin(desc->aoa))); + phase.i = sin(M_PI * ((aarx - aatx) * sin(desc->aoa))); + anew[aarx + (aatx * desc->nb_rx)].r += phase.r * sqrt(1.0 - desc->ricean_factor) * desc->normalization_ch_factor; + anew[aarx + (aatx * desc->nb_rx)].i += phase.i * sqrt(1.0 - desc->ricean_factor) * desc->normalization_ch_factor; } #ifdef DEBUG_CH @@ -1672,6 +1747,7 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { */ //apply correlation matrix //compute acorr = R_sqrt[i] * anew + bzero(acorr, desc->nb_tx * desc->nb_rx * sizeof(struct complexd)); if (desc->modelid >= TDL_A && desc->modelid <= TDL_E) { for (aatx = 0; aatx < desc->nb_tx; aatx++) { for (aarx=0; aarxnb_rx; aarx++) { @@ -1684,7 +1760,6 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { } } } else { - bzero(acorr,desc->nb_tx*desc->nb_rx*sizeof(struct complexd)); cblas_zaxpy(desc->nb_tx*desc->nb_rx, (void *) desc->R_sqrt[i/3], (void *) anew, 1, (void *) acorr, 1); } @@ -1765,14 +1840,26 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) { // printf("l %d : desc->ch.x %f, s %e, delay %f\n",l,desc->a[l][aarx+(aatx*desc->nb_rx)].x,s,desc->delays[l]); } //nb_taps +#ifdef DEBUG_CH_POWER + accumulated_ch_power += (desc->ch[aarx + (aatx * desc->nb_rx)][k].r * desc->ch[aarx + (aatx * desc->nb_rx)][k].r + + desc->ch[aarx + (aatx * desc->nb_rx)][k].i * desc->ch[aarx + (aatx * desc->nb_rx)][k].i); +#endif + #ifdef DEBUG_CH printf("(%d,%d,%d)->(%e,%e)\n",k,aarx,aatx,desc->ch[aarx+(aatx*desc->nb_rx)][k].r,desc->ch[aarx+(aatx*desc->nb_rx)][k].i); #endif } //channel_length +#ifdef DEBUG_CH_POWER + ch_power_count++; +#endif } } //aatx } //aarx +#ifdef DEBUG_CH_POWER + printf("(%5i) Average channel power = %f\n", ch_power_count, accumulated_ch_power / ch_power_count); +#endif + stop_meas(&desc->interp_time); } diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h index badb2c3d35..9b3fd98ae6 100644 --- a/openair1/SIMULATION/TOOLS/sim.h +++ b/openair1/SIMULATION/TOOLS/sim.h @@ -66,6 +66,8 @@ typedef struct { uint8_t nb_taps; ///linear amplitudes of taps double *amps; + ///normalization channel factor + double normalization_ch_factor; ///Delays of the taps in mus. length(delays)=nb_taps. Has to be between 0 and Td. double *delays; ///length of impulse response. should be set to 11+2*bw*t_max From d388be80c07a45840c26e77d9d75a1520bdc2a1e Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Mon, 3 Oct 2022 16:40:58 +0100 Subject: [PATCH 33/49] Compute log2_maxh for UL channel estimation using nb_antennas_rx --- .../NR_ESTIMATION/nr_ul_channel_estimation.c | 29 +++++++------------ .../PHY/NR_TRANSPORT/nr_ulsch_demodulation.c | 3 +- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c index fef8583000..c965e68fba 100644 --- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c +++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c @@ -397,11 +397,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, for (c16_t *end=ul_ch+12; ul_ch>15; // 1/12*16384 ul_ch += 4; - multadd_real_vector_complex_scalar(filt8_avlip3, ch, ul_ch, 8); - + c16multaddVectRealComplex(filt8_avlip3, &ch, ul_ch, 8); ul_ch += 8; - multadd_real_vector_complex_scalar(filt8_avlip4, ch, ul_ch, 8); - + c16multaddVectRealComplex(filt8_avlip4, &ch, ul_ch, 8); ul_ch += 8; - multadd_real_vector_complex_scalar(filt8_avlip5, ch, ul_ch, 8); + c16multaddVectRealComplex(filt8_avlip5, &ch, ul_ch, 8); ul_ch -= 8; #endif } @@ -437,16 +435,9 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ul_ch[3].i += (ch.i * 1365)>>15; // 1/12*16384 ul_ch += 4; - c16multaddVectRealComplex(filt8_avlip3, - ch, - ul_ch, - 8); - + c16multaddVectRealComplex(filt8_avlip3, &ch, ul_ch, 8); ul_ch += 8; - c16multaddVectRealComplex(filt8_avlip6, - ch, - ul_ch, - 8); + c16multaddVectRealComplex(filt8_avlip6, &ch, ul_ch, 8); #endif } else { // this is case without frequency-domain linear interpolation, just take average of LS channel estimates of 4 DMRS REs and use a common value for the whole PRB LOG_D(PHY,"PUSCH estimation DMRS type 2, no Freq-domain interpolation"); @@ -514,7 +505,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, for (c16_t *end=ul_ch+12; ul_chrb_size&1) == 1)? 4:0; uint32_t rxdataF_ext_offset = 0; + uint8_t ad_shift = 1 + log2_approx(frame_parms->nb_antennas_rx >> 2); for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) { uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01; @@ -2021,7 +2022,7 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB, for (aarx=0;aarxnb_antennas_rx;aarx++) avgs = cmax(avgs,avg[aatx*frame_parms->nb_antennas_rx+aarx]); - gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+2; + gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs) / 2) + ad_shift; gNB->pusch_vars[ulsch_id]->cl_done = 1; } From 559670fd85af5d310cca170b4025b4309357bab1 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 27 Oct 2022 17:17:01 +0100 Subject: [PATCH 34/49] Add UL 3GPP tests in CI --- cmake_targets/autotests/test_case_list.xml | 82 ++++++++++++++++------ 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 33c6ee0d57..759c145468 100755 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -354,10 +354,10 @@ (Test3: MCS 28 50 PRBs), (Test4: MCS 9 217 PRBs), (Test5: MCS 9 273 PRBs), - (Test6: DMRS Type A, 2 DMRS Symbols), - (Test7: DMRS Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols), - (Test8: DMRS Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols), - (Test9: DMRS Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols), + (Test6: PUSCH Type A, 2 DMRS Symbols), + (Test7: PUSCH Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols), + (Test8: PUSCH Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols), + (Test9: PUSCH Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols), (Test10: 25 PRBs, 15 kHz SCS), (Test11: MCS 0, low SNR performance) nr_ulsim @@ -366,12 +366,12 @@ -n100 -m28 -s20 -n100 -m9 -R217 -r217 -s5 -n100 -m9 -R273 -r273 -s5 - -n100 -s5 -U 4 0 1 1 1 - -n100 -s5 -T 2 1 2 -U 4 0 2 1 1 - -n100 -s5 -T 2 2 2 -U 4 1 2 1 1 - -n100 -s5 -a4 -b8 -T 2 1 2 -U 4 1 3 1 1 - -n100 -u0 -m0 -R25 -r25 -i 2 1 0 - -n100 -m0 -S -0.6 -i 2 1 0 + -n100 -s5 -U 0,1,1,1 + -n100 -s5 -T 1,2 -U 0,2,1,1 + -n100 -s5 -T 2,2 -U 1,2,1,1 + -n100 -s5 -a4 -b8 -T 1,2 -U 1,3,1,1 + -n100 -u0 -m0 -R25 -r25 -i 1,0 + -n100 -m0 -S -0.6 -i 1,0 test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 PUSCH test OK segmentation fault|assertion|exiting|fatal @@ -389,7 +389,7 @@ -n100 -s5 -Z -r75 -n50 -s5 -Z -r216 -R217 -n50 -s5 -Z -r270 -R273 - -n100 -s5 -Z -U 4 0 2 1 2 + -n100 -s5 -Z -U 0,2,1,2 test1 test2 test3 test4 test5 PUSCH test OK segmentation fault|assertion|exiting|fatal @@ -402,8 +402,8 @@ (Test3: MCS 9 106 PRBs MIMO 4 layers) nr_ulsim -n100 -m19 -s10 -S15 -z2 - -n100 -m9 -r106 -s10 -W2 -y2 -z2 - -n100 -m9 -r106 -s20 -W4 -y4 -z4 + -n100 -m9 -r106 -s8 -W2 -y2 -z2 + -n100 -m9 -r106 -s10 -W4 -y4 -z4 test1 test2 test3 PUSCH test OK segmentation fault|assertion|exiting|fatal @@ -411,14 +411,56 @@ - nr_ulsim Test cases. (Test1: 3GPP G-FR1-A4-13 2 RX Antennas Requirements Test), - (Test2: 3GPP G-FR1-A4-13 4 RX Antennas Requirements Test), - (Test3: 3GPP G-FR1-A4-13 8 RX Antennas Requirements Test) + nr_ulsim Test cases. (Test1: 3GPP G-FR1-A5-13, PUSCH Type A, 40 MHz BW, 30 kHz SCS, 2 RX Antennas Requirements Test), + (Test2: 3GPP G-FR1-A5-13, PUSCH Type A, 40 MHz BW, 30 kHz SCS, 4 RX Antennas Requirements Test), + (Test3: 3GPP G-FR1-A5-13, PUSCH Type A, 40 MHz BW, 30 kHz SCS, 8 RX Antennas Requirements Test), + (Test4: 3GPP G-FR1-A5-8, PUSCH Type B, 5 MHz BW, 15 kHz SCS, 2 RX Antennas Requirements Test), + (Test5: 3GPP G-FR1-A5-8, PUSCH Type B, 5 MHz BW, 15 kHz SCS, 4 RX Antennas Requirements Test), + (Test6: 3GPP G-FR1-A5-8, PUSCH Type B, 5 MHz BW, 15 kHz SCS, 8 RX Antennas Requirements Test), + (Test7: 3GPP G-FR1-A5-9, PUSCH Type B, 10 MHz BW, 15 kHz SCS, 2 RX Antennas Requirements Test), + (Test8: 3GPP G-FR1-A5-9, PUSCH Type B, 10 MHz BW, 15 kHz SCS, 4 RX Antennas Requirements Test), + (Test9: 3GPP G-FR1-A5-9, PUSCH Type B, 10 MHz BW, 15 kHz SCS, 8 RX Antennas Requirements Test), + (Test10: 3GPP G-FR1-A5-10, PUSCH Type B, 20 MHz BW, 15 kHz SCS, 2 RX Antennas Requirements Test), + (Test11: 3GPP G-FR1-A5-10, PUSCH Type B, 20 MHz BW, 15 kHz SCS, 4 RX Antennas Requirements Test), + (Test12: 3GPP G-FR1-A5-10, PUSCH Type B, 20 MHz BW, 15 kHz SCS, 8 RX Antennas Requirements Test), + (Test13: 3GPP G-FR1-A5-11, PUSCH Type B, 10 MHz BW, 30 kHz SCS, 2 RX Antennas Requirements Test), + (Test14: 3GPP G-FR1-A5-11, PUSCH Type B, 10 MHz BW, 30 kHz SCS, 4 RX Antennas Requirements Test), + (Test15: 3GPP G-FR1-A5-11, PUSCH Type B, 10 MHz BW, 30 kHz SCS, 8 RX Antennas Requirements Test), + (Test16: 3GPP G-FR1-A5-12, PUSCH Type B, 20 MHz BW, 30 kHz SCS, 2 RX Antennas Requirements Test), + (Test17: 3GPP G-FR1-A5-12, PUSCH Type B, 20 MHz BW, 30 kHz SCS, 4 RX Antennas Requirements Test), + (Test18: 3GPP G-FR1-A5-12, PUSCH Type B, 20 MHz BW, 30 kHz SCS, 8 RX Antennas Requirements Test), + (Test19: 3GPP G-FR1-A5-13, PUSCH Type B, 40 MHz BW, 30 kHz SCS, 2 RX Antennas Requirements Test), + (Test20: 3GPP G-FR1-A5-13, PUSCH Type B, 40 MHz BW, 30 kHz SCS, 4 RX Antennas Requirements Test), + (Test21: 3GPP G-FR1-A5-13, PUSCH Type B, 40 MHz BW, 30 kHz SCS, 8 RX Antennas Requirements Test), + (Test22: 3GPP G-FR1-A5-14, PUSCH Type B, 100 MHz BW, 30 kHz SCS, 2 RX Antennas Requirements Test), + (Test23: 3GPP G-FR1-A5-14, PUSCH Type B, 100 MHz BW, 30 kHz SCS, 4 RX Antennas Requirements Test), + (Test24: 3GPP G-FR1-A5-14, PUSCH Type B, 100 MHz BW, 30 kHz SCS, 8 RX Antennas Requirements Test) nr_ulsim - -m16 -r106 -s8.8 -S9.4 -z2 -n200 -U 4 1 1 1 2 -gI -b14 -t70 -I15 -i 2 1 0 - -m16 -r106 -s5.4 -S6 -z4 -n200 -U 4 1 1 1 2 -gI -b14 -t70 -I15 -i 2 1 0 - -m16 -r106 -s3.4 -S3.8 -z8 -n200 -U 4 1 1 1 2 -gI -b14 -t70 -I15 -i 2 1 0 - test1 test2 test3 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z2 -s12.4 -S12.4 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z4 -s8.5 -S8.5 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R106 -r106 -U 0,1,1,2 -z8 -s5.4 -S5.4 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z2 -s12.5 -S12.5 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z4 -s8.9 -S8.9 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R25 -r25 -U 1,1,1,2 -z8 -s5.7 -S5.7 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z2 -s12.6 -S12.6 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z4 -s8.9 -S8.9 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R52 -r52 -U 1,1,1,2 -z8 -s5.8 -S5.8 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z2 -s12.3 -S12.3 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z4 -s8.8 -S8.8 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 0 -m20 -R106 -r106 -U 1,1,1,2 -z8 -s5.7 -S5.7 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z2 -s12.5 -S12.5 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z4 -s8.6 -S8.6 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R24 -r24 -U 1,1,1,2 -z8 -s5.6 -S5.6 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z2 -s12.5 -S12.5 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z4 -s8.6 -S8.6 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R51 -r51 -U 1,1,1,2 -z8 -s5.6 -S5.6 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z2 -s12.5 -S12.5 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z4 -s8.7 -S8.7 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R106 -r106 -U 1,1,1,2 -z8 -s5.5 -S5.5 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z2 -s13.1 -S13.1 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z4 -s9.2 -S9.2 + -n100 -b14 -I15 -i 1,1 -g A,l -t70 -u 1 -m20 -R273 -r273 -U 1,1,1,2 -z8 -s5.9 -S5.9 + test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 test20 test21 test22 test23 test24 PUSCH test OK segmentation fault|assertion|exiting|fatal 3 From f4982ca060248f5d86747f0291c8f597c3dbfef8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 24 Oct 2022 13:47:55 +0200 Subject: [PATCH 35/49] Retrieving pod statistics at the end of physim run --- ci-scripts/cls_physim1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py index 20d2481c56..1cef2270c3 100644 --- a/ci-scripts/cls_physim1.py +++ b/ci-scripts/cls_physim1.py @@ -166,10 +166,10 @@ class PhySim: isRunning = True podNames = re.findall('oai-[\S\d\w]+', mySSH.getBefore()) count +=1 - mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc describe pod $pod >> cmake_targets/log/physim_pods_summary.txt; done', '\$', 10) if isRunning == False: logging.error('\u001B[1m Some PODS Running FAILED \u001B[0m') mySSH.command('oc get pods -l app.kubernetes.io/instance=physim 2>&1 | tee -a cmake_targets/log/physim_pods_summary.txt', '\$', 6) + mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc describe pod $pod >> cmake_targets/log/physim_pods_summary.txt; done', '\$', 10) mySSH.command('helm uninstall physim 2>&1 >> cmake_targets/log/physim_helm_summary.txt', '\$', 6) self.AnalyzeLogFile_phySim() isFinished1 = False @@ -206,6 +206,7 @@ class PhySim: # Getting the logs of each executables running in individual pods for podName in podNames: mySSH.command(f'oc logs {podName} >> cmake_targets/log/physim_test.txt 2>&1', '\$', 15, resync=True) + mySSH.command('for pod in $(oc get pods | tail -n +2 | awk \'{print $1}\'); do oc describe pod $pod >> cmake_targets/log/physim_pods_summary.txt; done', '\$', 10) mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/log/physim_test.txt', '.') try: listLogFiles = subprocess.check_output('egrep --colour=never "Execution Log file|Linux oai-" physim_test.txt', shell=True, universal_newlines=True) From bef72dd7479185e3c70f5997c7bd18f986cde79c Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Thu, 27 Oct 2022 18:44:36 +0200 Subject: [PATCH 36/49] PSEA - SABOX fix - changed the max accumulated apn length --- .../NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 2 +- .../NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index cbcd767c11..ee52e1f9c0 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -168,7 +168,7 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received DNN IE\n"); psea_msg.dnn_ie.dnn_length = *(buffer + offset++); uint8_t i=0; - char apn[20]; + char apn[APN_MAX_LEN]; while (*(buffer + offset + i) != ASCII_ACK) { apn[i] = *(buffer + offset + i); diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index ca92e54418..393d2cb4b6 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -58,6 +58,13 @@ #define ASCII_ACK 0x06 /* Delimiter in the DNN IEI */ +/* DNN - APN + * TS 23.003 9.1 + * The APN is composed of two parts, the APN Network Identifier (9.1.1) & The APN Operator Identifier (9.1.2). + * The accumulated max length of APN is 100 bytes. + */ +#define APN_MAX_LEN 100 + /* Mandatory Presence IE - TS 24.501 Table 8.3.2.1.1 */ typedef struct packet_filter_create_qos_rule_s { From dbd00175a77c57e2c28f4aa022ece3b9534a1b92 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Thu, 27 Oct 2022 19:13:59 +0200 Subject: [PATCH 37/49] PSEA - SABOX fix - Avoid the infinite loop, when not receiving an APN Operator Identifier --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index ee52e1f9c0..67c58f1e85 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -167,13 +167,10 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ case IEI_DNN: LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received DNN IE\n"); psea_msg.dnn_ie.dnn_length = *(buffer + offset++); - uint8_t i=0; char apn[APN_MAX_LEN]; - while (*(buffer + offset + i) != ASCII_ACK) { + for (int i = 0 ; i < psea_msg.dnn_ie.dnn_length ; ++i) apn[i] = *(buffer + offset + i); - ++i; - } LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - APN: %s\n", apn); offset += psea_msg.dnn_ie.dnn_length; From d91cfdc6cfbf4883866a47904fcaa924ddf2c448 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Thu, 27 Oct 2022 20:05:16 +0200 Subject: [PATCH 38/49] PSEA - Remove of unused ASCII macro definition --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 393d2cb4b6..757455f340 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -54,10 +54,6 @@ #define ROC_MODIFY_QOS_RULE_WITHOUT_PF 0b110 /* Modify existing QoS rule without modifying packet filters */ #define ROC_RESERVED_1 0b111 /* Reserved */ -/* DNN - ASCII Codes */ - -#define ASCII_ACK 0x06 /* Delimiter in the DNN IEI */ - /* DNN - APN * TS 23.003 9.1 * The APN is composed of two parts, the APN Network Identifier (9.1.1) & The APN Operator Identifier (9.1.2). From 978753d6acbfce368dbc65d266f5ab14c9660be0 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 28 Oct 2022 09:22:05 +0200 Subject: [PATCH 39/49] Delete unused 162PRB XML test stages file --- .../fr1_sa_quectel_stages_162prb.xml | 167 ------------------ 1 file changed, 167 deletions(-) delete mode 100644 ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml deleted file mode 100644 index 9371e46ec9..0000000000 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages_162prb.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - TEST-SA-FR1-Tab4 - SA Staged DL with QUECTEL - tasks - 1 - - 040000 - 000002 - 010000 - 000001 - 050000 - 000001 - 070000 - 000001 - 070001 - 000001 - 070002 - 000001 - 070003 - 000001 - 070004 - 000001 - 070005 - 000001 - 010002 - 080000 - - - - - Initialize_UE - Initialize Quectel - nrmodule2_quectel - yes - - - - - Terminate_UE - Terminate Quectel - nrmodule2_quectel - - - - - Initialize_eNB - Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time - 0 - 0 - nr - yes - yes - datalog_rt_stats.2x2.yaml - 172.21.19.14 - - - - IdleSleep - Sleep - 5 - - - - IdleSleep - Sleep - 20 - - - - - Ping - Ping: 20pings in 20sec - nrmodule2_quectel - -c 20 - 5 - - - - - Iperf - iperf (DL/10Mbps/UDP)(30 sec)(single-ue profile) - -u -b 10M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/20Mbps/UDP)(30 sec)(single-ue profile) - -u -b 20M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/40Mbps/UDP)(30 sec)(single-ue profile) - -u -b 40M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/60Mbps/UDP)(30 sec)(single-ue profile) - -u -b 60M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile) - -u -b 90M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - Iperf - iperf (DL/140Mbps/UDP)(30 sec)(single-ue profile) - -u -b 140M -t 30 - DL - nrmodule2_quectel - 5 - single-ue - - - - - Terminate_eNB - Terminate gNB - 0 - 0 - nr - - - - From 058c6a4f26f07c34849e9e19abffc82b84b24b90 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 28 Oct 2022 08:41:03 +0200 Subject: [PATCH 40/49] Add Config file for 162PRB phytest --- .../gnb.band78.tm1.162PRB.usrpn300.conf | 240 ++++++++++++++++++ .../xml_files/gnb_phytest_usrp_run_60.xml | 2 +- 2 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 ci-scripts/conf_files/gnb.band78.tm1.162PRB.usrpn300.conf diff --git a/ci-scripts/conf_files/gnb.band78.tm1.162PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.162PRB.usrpn300.conf new file mode 100644 index 0000000000..aefbe78887 --- /dev/null +++ b/ci-scripts/conf_files/gnb.band78.tm1.162PRB.usrpn300.conf @@ -0,0 +1,240 @@ +Active_gNBs = ( "gNB-Eurecom-5GNRBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + + cell_type = "CELL_MACRO_GNB"; + + gNB_name = "gNB-Eurecom-5GNRBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + + plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;}); + + tr_s_preference = "local_mac" + + ////////// Physical parameters: + + min_rxtxtime = 6; + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 621312; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 620040; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 162; + #initialDownlinkBWP + #genericParameters + # this is RBstart=41,L=24 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 31624; +# 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 = 162; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 31624; +# 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 = -118; +#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 = 15; +#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; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.26"; + ipv6 = "192:168:30::17"; + port = 36412 ; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : { + GNB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24"; + GNB_INTERFACE_NAME_FOR_S1U = "eth0"; + GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24"; + GNB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + } +); + +MACRLCs = ({ + num_cc = 1; + tr_s_preference = "local_L1"; + tr_n_preference = "local_RRC"; +}); + +L1s = ({ + num_cc = 1; + tr_n_preference = "local_mac"; +}); + +RUs = ({ + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [7]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 50; + eNB_instances = [0]; + bf_weights = [0x00007fff, 0x0000]; + sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2"; +}); + +THREAD_STRUCT = ({ + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_RU_L1_TRX_SPLIT"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; +}); + +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"; + hw_log_level = "info"; + phy_log_level = "info"; + mac_log_level = "info"; + rlc_log_level = "info"; + pdcp_log_level = "info"; + rrc_log_level = "info"; +}; diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml index d46c1c0caf..d4290d5961 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml @@ -33,7 +33,7 @@ Initialize_eNB Initialize gNB USRP - -O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test --gNBs.[0].servingCellConfigCommon.[0].dl_carrierBandwidth 162 --gNBs.[0].servingCellConfigCommon.[0].ul_carrierBandwidth 162 -q -U 787200 -T 162 -t 23 -D 130175 -m 23 -M 162 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time + -O ci-scripts/conf_files/gnb.band78.tm1.162PRB.usrpn300.conf --phy-test -q -U 787200 -T 162 -t 23 -D 130175 -m 23 -M 162 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time datalog_rt_stats.1x1.60.yaml NR 192.168.20.2 From 40159bdf4da4016dd7aba3a9c30e7def97a722c1 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Oct 2022 08:06:21 +0200 Subject: [PATCH 41/49] Define cmd_prefix for Initialize_eNB --- ci-scripts/main.py | 3 +++ ci-scripts/ran.py | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-scripts/main.py b/ci-scripts/main.py index c56c376b7f..02e51f531c 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -187,6 +187,9 @@ def GetParametersFromXML(action): else : RAN.air_interface[RAN.eNB_instance] = 'ocp-enb' + cmd_prefix = test.findtext('cmd_prefix') + if cmd_prefix is not None: RAN.cmd_prefix = cmd_prefix + elif action == 'Terminate_eNB': eNB_instance=test.findtext('eNB_instance') if (eNB_instance is None): diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index 7a50a12231..0ce85a35f1 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -99,6 +99,7 @@ class RANManagement(): self.USRPIPAddress = '' #checkers from xml self.ran_checkers={} + self.cmd_prefix = '' # prefix before {lte,nr}-softmodem #----------------------------------------------------------- @@ -472,11 +473,7 @@ class RANManagement(): gNB = False else: gNB = True - if ((self.USRPIPAddress!='') and (gNB==True)): - mySSH.command('echo ' + lPassWord + ' | echo "ulimit -c unlimited && sudo UHD_RFNOC_DIR=/usr/local/share/uhd/rfnoc ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) - #otherwise the regular command is ok - else: - mySSH.command('echo "ulimit -c unlimited && catchsegv ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) + mySSH.command(f'echo "ulimit -c unlimited && {self.cmd_prefix} ./ran_build/build/{self.air_interface[self.eNB_instance]} -O {lSourcePath}/{ci_full_config_file} {extra_options}" > ./my-lte-softmodem-run{self.eNB_instance}.sh', '\$', 5) mySSH.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5) mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5) @@ -567,7 +564,7 @@ class RANManagement(): mySSH.close() - HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'OK', CONST.ALL_PROCESSES_OK) + HTML.CreateHtmlTestRow(f'{self.cmd_prefix} {self.air_interface[self.eNB_instance]} -O {config_file} {extra_options}', 'OK', CONST.ALL_PROCESSES_OK) logging.debug('\u001B[1m Initialize eNB/gNB/ocp-eNB Completed\u001B[0m') def CheckeNBProcess(self, status_queue): From ec7e09353ff97ea0326e7526581ad83ce7b4189b Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 28 Oct 2022 09:18:56 +0200 Subject: [PATCH 42/49] Add numactl for phytest-timing test --- ci-scripts/xml_files/gnb_phytest_usrp_run.xml | 1 + ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml index 9a184c9e52..7a9eafeb8f 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run.xml @@ -37,6 +37,7 @@ datalog_rt_stats.default.yaml NR 192.168.20.2 + numactl --cpunodebind=netdev:enp94s0f0 --membind=netdev:enp94s0f0 diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml index d4290d5961..ed80a8b1e1 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60.xml @@ -37,6 +37,7 @@ datalog_rt_stats.1x1.60.yaml NR 192.168.20.2 + numactl --cpunodebind=netdev:enp94s0f0 --membind=netdev:enp94s0f0 From 49d9d0443b1722f8889115d32bb06d0ead24ef9e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 28 Oct 2022 09:21:37 +0200 Subject: [PATCH 43/49] Add new phytest test stage for 60MHz 2x2 --- .../xml_files/gnb_phytest_usrp_run_60_2x2.xml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml new file mode 100644 index 0000000000..53bb22cfd6 --- /dev/null +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml @@ -0,0 +1,56 @@ + + + gNB-PHY-Test-60-2x2 + Timing phytest 60 MHz 2x2 + tasks + 1 + +290101 000001 290109 + + + + + Initialize_eNB + Initialize gNB USRP + -O ci-scripts/conf_files/gnb.band78.tm1.162PRB.usrpn300.conf --phy-test --gNBs.[0].pdsch_AntennaPorts_XP 2 --RUs.[0].nb_tx 2 --RUs.[0].nb_rx 2 -q -U 787200 -T 162 -t 23 -D 130175 -m 23 -M 162 -l 2 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time + datalog_rt_stats.2x2.yaml + NR + 192.168.20.2 + numactl --cpunodebind=netdev:enp94s0f0 --membind=netdev:enp94s0f0 + + + + IdleSleep + Sleep + 60 + + + + + Terminate_eNB + Terminate gNB + NR + + + From 27f2bd454e156427bca092c8bc1b0d408b800915 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 13 Oct 2022 08:30:22 +0200 Subject: [PATCH 44/49] SA N310 test: pin threads, use numactl --- ci-scripts/xml_files/fr1_sa_quectel.xml | 3 ++- ci-scripts/xml_files/fr1_sa_quectel_162prb.xml | 3 ++- ci-scripts/xml_files/fr1_sa_quectel_stages.xml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml index cc44bdf051..cdae3678f9 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel.xml @@ -64,7 +64,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --tune-offset 30000000 --log_config.global_log_options level,nocolor,time + -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --tune-offset 30000000 --thread-pool 1,3,5,7,9,11,13,15 --log_config.global_log_options level,nocolor,time 0 0 nr @@ -72,6 +72,7 @@ yes datalog_rt_stats.2x2.yaml 172.21.19.14 + numactl --cpunodebind=netdev:ens2f0np0 --membind=netdev:ens2f0np0 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml index 776486013d..693848cd39 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_162prb.xml @@ -62,7 +62,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --tune-offset 30000000 --log_config.global_log_options level,nocolor,time + -O ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --tune-offset 30000000 --thread-pool 1,3,5,7,9,11,13,15 --log_config.global_log_options level,nocolor,time 0 0 nr @@ -70,6 +70,7 @@ yes datalog_rt_stats.2x2.yaml 172.21.19.14 + numactl --cpunodebind=netdev:ens2f0np0 --membind=netdev:ens2f0np0 diff --git a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml index 20225b0a1a..0a2e721ce7 100644 --- a/ci-scripts/xml_files/fr1_sa_quectel_stages.xml +++ b/ci-scripts/xml_files/fr1_sa_quectel_stages.xml @@ -68,7 +68,7 @@ Initialize_eNB Initialize gNB - -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --tune-offset 30000000 --log_config.global_log_options level,nocolor,time + -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --tune-offset 30000000 --thread-pool 1,3,5,7,9,11,13,15 --log_config.global_log_options level,nocolor,time 0 0 nr @@ -76,6 +76,7 @@ yes datalog_rt_stats.2x2.yaml 172.21.19.14 + numactl --cpunodebind=netdev:ens2f0np0 --membind=netdev:ens2f0np0 From dff94f6b3214aca1001bbd4ce44b2fbb21a7c6f8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 28 Oct 2022 11:41:18 +0200 Subject: [PATCH 45/49] Update 1x1 40 and 60 MHz thresholds --- ci-scripts/datalog_rt_stats.1x1.60.yaml | 18 +++++++++--------- ci-scripts/datalog_rt_stats.default.yaml | 14 +++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ci-scripts/datalog_rt_stats.1x1.60.yaml b/ci-scripts/datalog_rt_stats.1x1.60.yaml index 492a3bd8bf..b87bb3c8f5 100644 --- a/ci-scripts/datalog_rt_stats.1x1.60.yaml +++ b/ci-scripts/datalog_rt_stats.1x1.60.yaml @@ -7,18 +7,18 @@ ColNames : - Average; Max; Count - Average vs Reference Deviation (Reference Value; Acceptability Threshold) Ref : - feprx : 48.0 - feptx_prec : 16.0 + feprx : 46.0 + feptx_prec : 11.0 feptx_ofdm : 35.0 - feptx_total : 59.0 + feptx_total : 57.0 L1 Tx processing : 210.0 - DLSCH encoding : 129.0 - L1 Rx processing : 359.0 - PUSCH inner-receiver : 166.0 - PUSCH decoding : 270.0 - Schedule Response : 52.0 + DLSCH encoding : 137.0 + L1 Rx processing : 345.0 + PUSCH inner-receiver : 184.0 + PUSCH decoding : 276.0 + Schedule Response : 48.0 DL & UL scheduling timing : 13.0 - UL Indication : 65.0 + UL Indication : 60.0 Threshold : feprx : 1.25 feptx_prec : 1.25 diff --git a/ci-scripts/datalog_rt_stats.default.yaml b/ci-scripts/datalog_rt_stats.default.yaml index 2b8a7233ae..971e72944a 100644 --- a/ci-scripts/datalog_rt_stats.default.yaml +++ b/ci-scripts/datalog_rt_stats.default.yaml @@ -7,15 +7,15 @@ ColNames : - Average; Max; Count - Average vs Reference Deviation (Reference Value; Acceptability Threshold) Ref : - feprx : 53.0 - feptx_prec : 20.0 - feptx_ofdm : 37.0 - feptx_total : 62.0 + feprx : 43.0 + feptx_prec : 13.0 + feptx_ofdm : 33.0 + feptx_total : 55.0 L1 Tx processing : 170.0 DLSCH encoding : 118.0 - L1 Rx processing : 275.0 - PUSCH inner-receiver : 107.0 - PUSCH decoding : 246.0 + L1 Rx processing : 305.0 + PUSCH inner-receiver : 117.0 + PUSCH decoding : 303.0 Schedule Response : 25.0 DL & UL scheduling timing : 10.0 UL Indication : 34.0 From 31df643909d7d9f61fd9a9bc1bca17f5bf079b79 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 28 Oct 2022 11:41:42 +0200 Subject: [PATCH 46/49] Add new 60 MHz 2x2 timing stats file --- ci-scripts/datalog_rt_stats.60.2x2.yaml | 34 +++++++++++++++++++ .../xml_files/gnb_phytest_usrp_run_60_2x2.xml | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 ci-scripts/datalog_rt_stats.60.2x2.yaml diff --git a/ci-scripts/datalog_rt_stats.60.2x2.yaml b/ci-scripts/datalog_rt_stats.60.2x2.yaml new file mode 100644 index 0000000000..b0d861d758 --- /dev/null +++ b/ci-scripts/datalog_rt_stats.60.2x2.yaml @@ -0,0 +1,34 @@ +#this is a configuration file +#used to build real time processing statistics +#for 5G NR phy test (gNB terminate) +Title : Processing Time (us) +ColNames : + - Metric + - Average; Max; Count + - Average vs Reference Deviation (Reference Value; Acceptability Threshold) +Ref : + feprx : 84.0 + feptx_prec : 11.0 + feptx_ofdm : 35.0 + feptx_total : 100.0 + L1 Tx processing : 400.0 + DLSCH encoding : 177.0 + L1 Rx processing : 345.0 + PUSCH inner-receiver : 184.0 + PUSCH decoding : 276.0 + Schedule Response : 111.0 + DL & UL scheduling timing : 37.0 + UL Indication : 127.0 +Threshold : + feprx : 1.25 + feptx_prec : 1.25 + feptx_ofdm : 1.25 + feptx_total : 1.25 + L1 Tx processing : 1.25 + DLSCH encoding : 1.25 + L1 Rx processing : 1.25 + PUSCH inner-receiver : 1.25 + PUSCH decoding : 1.25 + Schedule Response : 48.0 + DL & UL scheduling timing : 1.25 + UL Indication : 1.25 diff --git a/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml index 53bb22cfd6..831ed5b096 100644 --- a/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml +++ b/ci-scripts/xml_files/gnb_phytest_usrp_run_60_2x2.xml @@ -34,7 +34,7 @@ Initialize_eNB Initialize gNB USRP -O ci-scripts/conf_files/gnb.band78.tm1.162PRB.usrpn300.conf --phy-test --gNBs.[0].pdsch_AntennaPorts_XP 2 --RUs.[0].nb_tx 2 --RUs.[0].nb_rx 2 -q -U 787200 -T 162 -t 23 -D 130175 -m 23 -M 162 -l 2 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time - datalog_rt_stats.2x2.yaml + datalog_rt_stats.60.2x2.yaml NR 192.168.20.2 numactl --cpunodebind=netdev:enp94s0f0 --membind=netdev:enp94s0f0 From 8e4ebb078a398872b60a70355701f19a134ffdda Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Fri, 28 Oct 2022 12:39:31 +0200 Subject: [PATCH 47/49] PSEA - IEI DNN - added macro for min DNN length --- .../NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index 757455f340..0e09425033 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -57,9 +57,15 @@ /* DNN - APN * TS 23.003 9.1 * The APN is composed of two parts, the APN Network Identifier (9.1.1) & The APN Operator Identifier (9.1.2). - * The accumulated max length of APN is 100 bytes. + * + * The DNN information element has a length in the range of 3 to 102 octets. + * The Header is consisted of two octets, the DNN IEI and the Length of the DNN contents fields, each is 1 octet. + * The DNN value payload starts from the 3rd octet. + * The accumulated max length of APN payload is 100 octets. + * The min length of the APN payload is 1 octet. */ #define APN_MAX_LEN 100 +#define APN_MIN_LEN 1 /* Mandatory Presence IE - TS 24.501 Table 8.3.2.1.1 */ From 43f3d03ddb7991f2646bc0a5838022bf464fd3d8 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Fri, 28 Oct 2022 13:24:25 +0200 Subject: [PATCH 48/49] PSEA - IEI DNN - protect code from a bad DNN length received from the network --- .../NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 67c58f1e85..367fa0a71d 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -169,10 +169,14 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ psea_msg.dnn_ie.dnn_length = *(buffer + offset++); char apn[APN_MAX_LEN]; - for (int i = 0 ; i < psea_msg.dnn_ie.dnn_length ; ++i) - apn[i] = *(buffer + offset + i); + if(psea_msg.dnn_ie.dnn_length <= APN_MAX_LEN && + psea_msg.dnn_ie.dnn_length >= APN_MIN_LEN) { + for (int i = 0 ; i < psea_msg.dnn_ie.dnn_length ; ++i) + apn[i] = *(buffer + offset + i); + LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - APN: %s\n", apn); + } else + LOG_E(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - DNN IE has invalid length\n"); - LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - APN: %s\n", apn); offset += psea_msg.dnn_ie.dnn_length; psea_iei = *(buffer + offset++); break; From 07abf4329d171c1c6cdc5965558e6bab17dd2520 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Fri, 28 Oct 2022 13:41:33 +0200 Subject: [PATCH 49/49] PSEA - IEI DNN - This is the last IEI in the message. Before this commit each time the message was captured, it entered the default switch statement, which is meant to show that we received an uknown IEI. Now after the DNN IEI, we set offset=msg_length, to exit the switch. --- openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 367fa0a71d..62d22698d7 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -177,8 +177,7 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ } else LOG_E(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - DNN IE has invalid length\n"); - offset += psea_msg.dnn_ie.dnn_length; - psea_iei = *(buffer + offset++); + offset = msg_length; break; default: